Skip to content

Commit d8c58e0

Browse files
committed
fix(config): migrate badgeEnabled/publicQualityMetrics off the DB
Batch A (#6442, merged as #6557) deliberately excluded these two fields because loadPublicRepoBadge/loadPublicRepoQualityMetrics read them via a raw getRepositorySettings call that bypasses the manifest overlay -- a perf tradeoff for two unauthenticated, high-frequency public routes. Per maintainer direction, finish the migration instead: both routes now read resolveRepositorySettings, accepting the manifest-cache lookup (and occasional cold-cache GitHub fetch) so .loopover.yml is honored here like every other settings.* field. Drops the two columns (migration 0158), removes them from the dashboard/ internal write paths and the maintainer settings panel, and updates the tests that seeded them via the DB to seed the focus manifest instead. Each live repo's current effective value (false) was already backfilled into its private .loopover.yml config before this drop. Part of #6442, epic #6440.
1 parent a47d1c3 commit d8c58e0

17 files changed

Lines changed: 71 additions & 73 deletions

.loopover.yml.example

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,10 +924,12 @@ settings:
924924
# Bool. Default: true.
925925
backfillEnabled: true
926926

927-
# Render a README status badge for the repo. Bool. Default: false.
927+
# Render a README status badge for the repo. Bool. Default: false. Config-as-code only (Batch A
928+
# follow-up, loopover#6442) -- no DB column or dashboard toggle.
928929
badgeEnabled: false
929930

930-
# Publish a public per-repo review-quality page. Bool. Default: false.
931+
# Publish a public per-repo review-quality page. Bool. Default: false. Config-as-code only (Batch A
932+
# follow-up, loopover#6442) -- no DB column or dashboard toggle.
931933
publicQualityMetrics: false
932934

933935
# Per-repo kill-switch: when true, the agent does nothing on this repo.

CONTRIBUTING.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,12 @@ Public GitHub surfaces:
284284

285285
Config as code (`.loopover.yml`) — every repository setting is controllable from the config file:
286286

287-
- **`settings:`** is a partial of the repository settings: any behaviour a maintainer can toggle in the
288-
dashboard can be set here as code — `commentMode`, `publicAudienceMode`, `publicSurface`, `checkRunMode`,
289-
`reviewCheckMode`, the gate-blocker modes, `autoLabelEnabled`, `gittensorLabel`, `requireLinkedIssue`,
290-
`backfillEnabled`, etc.
287+
- **`settings:`** is a partial of the repository settings. Any behaviour a maintainer can toggle in the
288+
dashboard can also be set here as code — `reviewCheckMode`, the gate-blocker modes, `autoLabelEnabled`,
289+
`gittensorLabel`, `requireLinkedIssue`, etc. A subset is config-as-code **only** (no DB column, no
290+
dashboard toggle — this file is their sole source): `commentMode`, `publicAudienceMode`,
291+
`publicSignalLevel`, `checkRunMode`, `checkRunDetailLevel`, `publicSurface`, `includeMaintainerAuthors`,
292+
`backfillEnabled`, `badgeEnabled`, `publicQualityMetrics`, `regateSweepOrderMode`.
291293
- **`gate:`** is a friendly typed alias for the gate subset — `enabled` (on/off), `linkedIssue`,
292294
`duplicates`, `readiness: { mode, minScore }` (each `off | advisory | block`).
293295
- **`review:`** customizes the public review-panel CONTENT: `footer: { text }` (custom lead copy — the

apps/loopover-ui/content/docs/github-app.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ gates every author identically, regardless of config.
141141

142142
<CodeBlock
143143
lang="yaml"
144-
code={`# Repository settings as code — any dashboard toggle:
144+
code={`# Repository settings as code -- reviewCheckMode is also a dashboard toggle; checkRunMode/commentMode/
145+
# publicSurface are config-as-code only (no DB column or dashboard toggle):
145146
settings:
146147
reviewCheckMode: required # review-agent check on/off (required|visible|disabled)
147148
checkRunMode: enabled # the advisory Context check on/off

apps/loopover-ui/content/docs/tuning.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ gate:
394394
provider: anthropic
395395
model: claude-3-5-sonnet-latest
396396
397-
# Generic dashboard-equivalent overrides
397+
# Generic settings overrides -- commentMode/checkRunMode/checkRunDetailLevel/badgeEnabled are
398+
# config-as-code only (no DB column or dashboard toggle); this file is their sole source.
398399
settings:
399400
commentMode: detected_contributors_only
400401
checkRunMode: enabled

apps/loopover-ui/src/components/site/app-panels/gate-ramp-control.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ const ADVISORY_SETTINGS = {
3535
slopAiAdvisory: false,
3636
autoLabelEnabled: true,
3737
requireLinkedIssue: false,
38-
badgeEnabled: false,
39-
publicQualityMetrics: false,
4038
commandAuthorization: {},
4139
autonomy: {},
4240
autoMaintain: { requireApprovals: 1, mergeMethod: "squash" as const },

apps/loopover-ui/src/components/site/app-panels/maintainer-settings.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,10 @@ const SLOP_FIELDS: FieldDef[] = [
143143
];
144144

145145
// commentMode/publicSurface/publicSignalLevel/publicAudienceMode/checkRunMode/checkRunDetailLevel/
146-
// includeMaintainerAuthors moved off the dashboard entirely (Batch A, loopover#6442) -- configure them via
147-
// this repo's own .loopover.yml settings.* block instead.
146+
// includeMaintainerAuthors/badgeEnabled/publicQualityMetrics moved off the dashboard entirely (Batch A +
147+
// follow-up, loopover#6442) -- configure them via this repo's own .loopover.yml settings.* block instead.
148148
const SURFACE_FIELDS: FieldDef[] = [
149149
{ key: "requireLinkedIssue", label: "Require a linked issue", kind: "toggle" },
150-
{ key: "badgeEnabled", label: "Repo badge", kind: "toggle" },
151-
{ key: "publicQualityMetrics", label: "Public quality page", kind: "toggle" },
152150
];
153151

154152
function repoApiBase(repoFullName: string): string | null {

apps/loopover-ui/src/lib/maintainer-settings-editable.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ const SETTINGS: MaintainerSettingsEditable = {
2121
slopAiAdvisory: false,
2222
autoLabelEnabled: true,
2323
requireLinkedIssue: false,
24-
badgeEnabled: false,
25-
publicQualityMetrics: false,
2624
commandAuthorization: {},
2725
autonomy: {},
2826
autoMaintain: { requireApprovals: 1, mergeMethod: "squash" },
@@ -35,7 +33,7 @@ describe("maintainer-settings-editable (#2218)", () => {
3533
const payload = buildMaintainerSettingsSavePayload(SETTINGS);
3634
expect(Object.keys(payload).sort()).toEqual([...MAINTAINER_SETTINGS_EDITABLE_KEYS].sort());
3735
expect(payload.linkedIssueGateMode).toBe("advisory");
38-
expect(payload.badgeEnabled).toBe(false);
36+
expect(payload.autoLabelEnabled).toBe(true);
3937
});
4038

4139
it("buildMaintainerSettingsSavePayload merges a partial patch over the base settings", () => {
@@ -47,7 +45,7 @@ describe("maintainer-settings-editable (#2218)", () => {
4745
expect(payload.duplicatePrGateMode).toBe("block");
4846
// Untouched fields pass through unchanged.
4947
expect(payload.qualityGateMode).toBe("advisory");
50-
expect(payload.badgeEnabled).toBe(false);
48+
expect(payload.autoLabelEnabled).toBe(true);
5149
});
5250

5351
it("an empty patch object is a no-op (same as omitting it)", () => {

apps/loopover-ui/src/lib/maintainer-settings-editable.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ export type MaintainerSettingsEditable = {
3636
// #6443: gittensorLabel/createMissingLabel removed -- no longer DB-backed, config-as-code only via
3737
// .loopover.yml's settings: block now (the dashboard can no longer write them).
3838
requireLinkedIssue: boolean;
39-
badgeEnabled: boolean;
40-
publicQualityMetrics: boolean;
4139
commandAuthorization: CommandAuthorization;
4240
autonomy: Partial<Record<AgentActionClass, AutonomyLevel>>;
4341
autoMaintain: { requireApprovals: number; mergeMethod: AutoMergeMethod };
@@ -61,8 +59,6 @@ export const MAINTAINER_SETTINGS_EDITABLE_KEYS: Array<keyof MaintainerSettingsEd
6159
"slopAiAdvisory",
6260
"autoLabelEnabled",
6361
"requireLinkedIssue",
64-
"badgeEnabled",
65-
"publicQualityMetrics",
6662
"commandAuthorization",
6763
"autonomy",
6864
"autoMaintain",

config/examples/loopover.full.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,12 @@ settings:
938938
# Bool. Default: true.
939939
backfillEnabled: true
940940

941-
# Render a README status badge for the repo. Bool. Default: false.
941+
# Render a README status badge for the repo. Bool. Default: false. Config-as-code only (Batch A
942+
# follow-up, loopover#6442) -- no DB column or dashboard toggle.
942943
badgeEnabled: false
943944

944-
# Publish a public per-repo review-quality page. Bool. Default: false.
945+
# Publish a public per-repo review-quality page. Bool. Default: false. Config-as-code only (Batch A
946+
# follow-up, loopover#6442) -- no DB column or dashboard toggle.
945947
publicQualityMetrics: false
946948

947949
# Per-repo kill-switch: when true, the agent does nothing on this repo.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- Config-as-code migration (Batch A follow-up, loopover#6442/epic #6440): badgeEnabled and
2+
-- publicQualityMetrics were deliberately excluded from 0157's drop because loadPublicRepoBadge/
3+
-- loadPublicRepoQualityMetrics (src/api/routes.ts) read them via a raw getRepositorySettings call that
4+
-- bypasses the manifest overlay -- a perf tradeoff for two unauthenticated, high-frequency public routes.
5+
-- Both routes now read resolveRepositorySettings (manifest-aware) instead, accepting that tradeoff so
6+
-- .loopover.yml is honored for these two fields like every other settings.* field. Each live repo's
7+
-- current effective value was confirmed unchanged (false) before this drop. SQLite 3.35+ / D1 supports
8+
-- DROP COLUMN directly (same precedent as 0122/0146/0150/0157).
9+
ALTER TABLE repository_settings DROP COLUMN badge_enabled;
10+
ALTER TABLE repository_settings DROP COLUMN public_quality_metrics;

0 commit comments

Comments
 (0)