fix(ci): guard RepoSettingsPreviewSchema against settings-preview drift - #7053
Conversation
The settings-parity check's own header names both RepositorySettingsSchema and RepoSettingsPreviewSchema as hand-authored Zod schemas needing drift protection, but main() only diffed RepositorySettingsSchema against the RepositorySettings type -- RepoSettingsPreviewSchema had no check at all. Add a second pure extraction (extractRepoSettingsPreviewFieldNames) + diff wired into main(), covering RepoSettingsPreviewSchema.settings against buildRepoSettingsPreview's return shape (the named RepoSettingsPreview type in src/signals/settings-preview.ts). It brace-matches the nested settings block so the inline commandAuthorization members don't leak in, and fails CI with the same actionable message as the existing check. This surfaced a real drift: the schema has always declared autoProjectMilestoneMatch/autoProjectMilestoneMatchBackend (since JSONbored#3290) but the builder never populated them, so the endpoint never returned the two fields its own OpenAPI spec documents. Wire them into the builder's return shape (they are plain RepositorySettings fields) so the endpoint honors the spec and the new parity check passes; the schema and generated openapi.json are unchanged. Closes JSONbored#7011
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7053 +/- ##
==========================================
- Coverage 95.98% 93.74% -2.24%
==========================================
Files 609 692 +83
Lines 48137 68706 +20569
Branches 15132 18760 +3628
==========================================
+ Hits 46202 64409 +18207
- Misses 1118 3302 +2184
- Partials 817 995 +178
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-17 20:09:52 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
scripts/check-openapi-settings-parity.mjs's header names bothRepositorySettingsSchemaandRepoSettingsPreviewSchemaas hand-authored Zod schemas needing drift protection, butmain()only checked the former. This adds the missing second check forRepoSettingsPreviewSchema.settings.extractRepoSettingsPreviewFieldNamesdiffs the schema'ssettingskey set againstbuildRepoSettingsPreview's return shape — its named return typeRepoSettingsPreviewinsrc/signals/settings-preview.ts(the source of truth the issue names). It brace-matches the nestedsettingsblock so the inlinecommandAuthorizationmembers don't leak in, and fails CI with the same actionable message as the existing check.RepoSettingsPreviewSchema.settingshas declaredautoProjectMilestoneMatch/autoProjectMilestoneMatchBackendsince feat(agent): add Linear backend for project/milestone matching #3290, butbuildRepoSettingsPreviewnever populated them — so the endpoint never returned two fields its own OpenAPI spec documents. They are plainRepositorySettingsfields, so I wired them into the builder's return shape to honor the spec. The Zod schema and generatedopenapi.jsonare unchanged.RepositorySettingsSchema/RepositorySettingscheck is untouched.Closes #7011
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #7011).Validation
git diff --checknpm run actionlintnpm run typechecknpm run ui:openapi:settings-parity— both checks green (RepositorySettings110 fields,RepoSettingsPreview.settings37 fields)npm run ui:openapi:check— generated spec unchangedsrc/signals/settings-preview.tsare exercised bytest/unit/settings-preview.test.ts(no new branches); new script functions have full unit coverage intest/unit/ci-openapi-settings-parity.test.tsnpm audit --audit-level=moderate— 0 vulnerabilitiesNot run locally (unaffected by this backend-only change; no MCP/UI/worker surface touched):
test:workers,build:mcp,test:mcp-pack,ui:lint,ui:typecheck,ui:build.Safety
Notes