Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/cli/test/commands/results/serve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3497,12 +3497,20 @@ describe('serve app', () => {
autoPush: false,
});

git(`git -C "${cloneDir}" fetch --quiet origin ${resultsBranch}`, tempDir);
const metadataRemoteRef = `refs/remotes/origin/${resultsBranch}`;
const artifactRemoteRef = `refs/remotes/origin/${AGENTV_RESULTS_ARTIFACTS_REF}`;
const metadataRefLookup = () =>
git(
`git -C "${cloneDir}" show-ref --verify --quiet ${metadataRemoteRef} && echo present || true`,
tempDir,
);
const artifactRefLookup = () =>
git(
`git -C "${cloneDir}" show-ref --verify --quiet ${artifactRemoteRef} && echo present || true`,
tempDir,
);
expect(metadataRefLookup()).toBe('present');
expect(artifactRefLookup()).toBe('');

const app = createApp([], tempDir, tempDir, undefined, { studioDir });
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/evaluation/results-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2095,9 +2095,7 @@ export async function getResultsRepoSyncStatus(config?: ResultsConfig): Promise<

try {
if (usesStorageBranchWorktree(normalized)) {
await fetchResultsRepo(normalized.path, normalized.remote, normalized.branch).catch(
() => undefined,
);
// Dashboard status is read-only; explicit sync paths do the fetch.
return withGitInspection(
baseStatus,
await inspectResultsStorageBranchGit(normalized.path, normalized),
Expand Down
32 changes: 32 additions & 0 deletions packages/core/test/evaluation/results-repo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,38 @@ describe('results repo write path', () => {
expect(remoteFiles).not.toContain('README.md');
}, 20000);

it('does not fetch a repo_path storage branch during status inspection', async () => {
const { remoteDir, seedDir } = initializeRemoteRepo(rootDir);
const projectDir = path.join(rootDir, 'source-project-status-readonly');
git(`git clone --quiet "${remoteDir}" "${projectDir}"`, rootDir);
const originalOrigin = git('git remote get-url origin', projectDir);
const storageBranch = initializeRemoteStorageBranch(seedDir, DEFAULT_RESULTS_BRANCH);
const remoteRef = `refs/remotes/origin/${storageBranch}`;

expect(
git(`git show-ref --verify --quiet "${remoteRef}" && echo present || true`, projectDir),
).toBe('');

const status = await getResultsRepoSyncStatus({
repo_path: projectDir,
branch: storageBranch,
remote: 'origin',
sync: { auto_push: false },
});

expect(status).toMatchObject({
configured: true,
available: true,
repo: projectDir,
repo_path: projectDir,
branch: storageBranch,
});
expect(git('git remote get-url origin', projectDir)).toBe(originalOrigin);
expect(
git(`git show-ref --verify --quiet "${remoteRef}" && echo present || true`, projectDir),
).toBe('');
}, 20000);

it('commits repo_path metadata overlays to the configured storage branch during sync', async () => {
const { remoteDir, seedDir } = initializeRemoteRepo(rootDir);
const storageBranch = initializeRemoteStorageBranch(seedDir, DEFAULT_RESULTS_BRANCH);
Expand Down
Loading