Skip to content

Commit cfb2e28

Browse files
authored
Merge pull request #13 from AztecProtocol/feat/broaden-sparse-checkout-paths
feat: broaden sparse checkout paths and add --skip-checks flag
2 parents 3e19d4a + aec3f2a commit cfb2e28

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/tools/sync.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,22 @@ import { cloneRepo, getReposStatus, getNoirCommitFromAztec, getRepoPath, REPOS_D
99
import { writeSyncMetadata, stampMetadataMcpVersion, readSyncMetadata, SyncMetadata } from "../utils/sync-metadata.js";
1010
import { clearErrorCache } from "../utils/error-lookup.js";
1111

12+
export interface RepoSyncStatus {
13+
name: string;
14+
status: string;
15+
commit?: string;
16+
}
17+
18+
export function isRepoError(repo: RepoSyncStatus): boolean {
19+
return repo.status.startsWith("Error:");
20+
}
21+
1222
export interface SyncResult {
1323
success: boolean;
1424
metadataSafe: boolean;
1525
message: string;
1626
version: string;
17-
repos: {
18-
name: string;
19-
status: string;
20-
commit?: string;
21-
}[];
27+
repos: RepoSyncStatus[];
2228
}
2329

2430
/**
@@ -105,7 +111,7 @@ export async function syncRepos(options: {
105111
// leaves the old checkout while other repos sync to the new tag, producing a
106112
// mixed-version workspace.
107113
const aztecFailed = results.some(
108-
(r) => r.name === "aztec-packages" && r.status.toLowerCase().includes("error"),
114+
(r) => r.name === "aztec-packages" && isRepoError(r),
109115
);
110116
if (aztecFailed && (force || version)) {
111117
return {
@@ -160,7 +166,7 @@ export async function syncRepos(options: {
160166
let versionedDocsMissing = false;
161167
for (const repo of syntheticRepos) {
162168
const result = results.find((r) => r.name === repo.name);
163-
if (!result || result.status.toLowerCase().includes("error")) continue;
169+
if (!result || isRepoError(result)) continue;
164170

165171
for (const sparsePath of repo.sparse || []) {
166172
if (!sparsePath.includes(effectiveVersion)) continue;
@@ -174,7 +180,7 @@ export async function syncRepos(options: {
174180
}
175181

176182
const allSuccess = results.every(
177-
(r) => !r.status.toLowerCase().includes("error")
183+
(r) => !isRepoError(r)
178184
);
179185

180186
log?.(`Sync complete: ${results.length} repos, ${allSuccess ? "all succeeded" : "some failed"}`, "info");

src/utils/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Formatting utilities for MCP tool responses
33
*/
44

5-
import type { SyncResult } from "../tools/sync.js";
5+
import { isRepoError, type SyncResult } from "../tools/sync.js";
66
import type { SearchResult, FileInfo } from "./search.js";
77
import type { SyncMetadata } from "./sync-metadata.js";
88
import type { ErrorLookupResult } from "./error-lookup.js";
@@ -18,7 +18,7 @@ export function formatSyncResult(result: SyncResult): string {
1818
];
1919

2020
for (const repo of result.repos) {
21-
const icon = repo.status.toLowerCase().includes("error") ? "✗" : "✓";
21+
const icon = isRepoError(repo) ? "✗" : "✓";
2222
lines.push(` ${icon} ${repo.name}: ${repo.status}`);
2323
}
2424

0 commit comments

Comments
 (0)