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
3 changes: 2 additions & 1 deletion src/signals/focus-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export type FocusManifestSettings = Partial<
| "aiReviewAllAuthors"
| "closeOwnerAuthors"
| "autoLabelEnabled"
| "badgeEnabled"
| "gittensorLabel"
| "createMissingLabel"
| "publicSurface"
Expand Down Expand Up @@ -773,7 +774,7 @@ function parseSettingsOverride(value: JsonValue | undefined, warnings: string[])
if (blacklistLabel !== null) out.blacklistLabel = blacklistLabel;
const publicSurface = normalizeOptionalEnum(r.publicSurface, "settings.publicSurface", ["off", "comment_and_label", "comment_only", "label_only"] as const, warnings);
if (publicSurface !== null) out.publicSurface = publicSurface;
for (const key of ["aiReviewByok", "aiReviewAllAuthors", "closeOwnerAuthors", "autoLabelEnabled", "createMissingLabel", "includeMaintainerAuthors", "requireLinkedIssue", "backfillEnabled", "privateTrustEnabled", "agentPaused", "agentDryRun"] as const) {
for (const key of ["aiReviewByok", "aiReviewAllAuthors", "closeOwnerAuthors", "autoLabelEnabled", "badgeEnabled", "createMissingLabel", "includeMaintainerAuthors", "requireLinkedIssue", "backfillEnabled", "privateTrustEnabled", "agentPaused", "agentDryRun"] as const) {
const flag = normalizeOptionalBoolean(r[key], `settings.${key}`, warnings);
if (flag !== null) out[key] = flag;
}
Expand Down
12 changes: 12 additions & 0 deletions test/unit/focus-manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,18 @@ describe("parseFocusManifest settings override + resolveEffectiveSettings", () =
expect(eff.linkedIssueGateMode).toBe("block"); // gate: wins over settings:
});

it("wires settings.badgeEnabled into the manifest parser and lets it override the DB value (#2555)", () => {
const parsedTrue = parseFocusManifest({ settings: { badgeEnabled: true } });
expect(parsedTrue.settings.badgeEnabled).toBe(true);
expect(parsedTrue.warnings).toEqual([]);
const parsedFalse = parseFocusManifest({ settings: { badgeEnabled: false } });
expect(parsedFalse.settings.badgeEnabled).toBe(false);

const db = { badgeEnabled: false } as unknown as RepositorySettings;
const eff = resolveEffectiveSettings(db, parseFocusManifest({ settings: { badgeEnabled: true } }));
expect(eff.badgeEnabled).toBe(true); // settings: override wins over the DB-stored value
});

it("parses aiReview from settings: and lets gate.aiReview win in resolveEffectiveSettings", () => {
const parsed = parseFocusManifest({ settings: { aiReviewMode: "advisory", aiReviewByok: true } });
expect(parsed.settings.aiReviewMode).toBe("advisory");
Expand Down
Loading