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
1 change: 1 addition & 0 deletions src/signals/focus-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ export function reviewConfigToJson(review: FocusManifestReviewConfig): JsonValue
if (review.note !== null) out.note = review.note;
if (review.profile !== null) out.profile = review.profile;
if (review.inlineComments !== null) out.inline_comments = review.inlineComments;
if (review.instructions !== null) out.instructions = review.instructions;
if (review.pathInstructions.length > 0) out.path_instructions = review.pathInstructions.map((entry) => ({ path: entry.path, instructions: entry.instructions }));
if (review.excludePaths.length > 0) out.exclude_paths = [...review.excludePaths];
if (review.preMergeChecks.length > 0) {
Expand Down
16 changes: 16 additions & 0 deletions test/unit/focus-manifest-loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ describe("focus-manifest loader", () => {
expect(fetched).toEqual(["owner/repo"]);
});

it("preserves review.instructions across the repo-file cache round trip", async () => {
const env = createTestEnv();
let fetches = 0;
const fetcher = async () => {
fetches += 1;
return JSON.stringify({ review: { instructions: "Follow our async-error conventions." } });
};

const first = await loadRepoFocusManifest(env, "owner/review-instructions", { fetcher });
expect(first.review.instructions).toBe("Follow our async-error conventions.");

const second = await loadRepoFocusManifest(env, "owner/review-instructions", { fetcher });
expect(fetches).toBe(1);
expect(second.review.instructions).toBe("Follow our async-error conventions.");
});

it("falls back to an empty manifest when no repo file is published and never throws", async () => {
const env = createTestEnv();
const manifest = await loadRepoFocusManifest(env, "owner/missing", { fetcher: async () => null });
Expand Down
Loading