fix(openapi): add 11 missing RepositorySettings fields + a structural-drift CI check - #2601
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-02 12:42:14 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 7 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
…-drift CI check RepositorySettingsSchema and RepoSettingsPreviewSchema (hand-authored Zod schemas in src/openapi/schemas.ts) were missing 11 real fields the runtime RepositorySettings TS type has and GET /v1/repos/:owner/:repo/settings actually serializes: sizeGateMode, gateDryRun, premergeContentRecheck, aiReviewMode, aiReviewByok, aiReviewProvider, aiReviewModel, aiReviewAllAuthors, aiReviewCloseConfidence, closeOwnerAuthors, badgeEnabled. ui:openapi:check only verifies the generated openapi.json matches the Zod schema -- it never verifies the Zod schema matches the actual TS interface, so this silently breaks generated API clients (including @jsonbored/gittensory-mcp) with no CI signal. Added all 11 fields to RepositorySettingsSchema, plus the 6 the RepoSettingsPreview.settings sub-type separately carries (badgeEnabled + 5 aiReview* fields) to RepoSettingsPreviewSchema. Added scripts/check-openapi-settings-parity.mjs: parses the top-level field names out of the RepositorySettings type block in src/types.ts and diffs them against RepositorySettingsSchema.shape's keys, failing with the exact field names on any asymmetric difference. Wired into test:ci as ui:openapi:settings-parity, right after the existing ui:openapi:check step (same push/ui/uiContract gating), and documented in the contributing skill's reference table. Regenerated apps/gittensory-ui/public/openapi.json. Closes #2556
0cd05a2 to
77abcd5
Compare
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 77abcd5 | Commit Preview URL Branch Preview URL |
Jul 02 2026, 12:35 PM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2601 +/- ##
==========================================
+ Coverage 96.01% 96.02% +0.01%
==========================================
Files 231 233 +2
Lines 25987 26077 +90
Branches 9446 9474 +28
==========================================
+ Hits 24951 25041 +90
Misses 425 425
Partials 611 611
🚀 New features to boost your workflow:
|
Summary
RepositorySettingsSchema/RepoSettingsPreviewSchema(hand-authored Zod schemas insrc/openapi/schemas.ts) were missing 11 real fields the runtimeRepositorySettingsTS type has andGET /v1/repos/:owner/:repo/settingsactually serializes:sizeGateMode,gateDryRun,premergeContentRecheck,aiReviewMode,aiReviewByok,aiReviewProvider,aiReviewModel,aiReviewAllAuthors,aiReviewCloseConfidence,closeOwnerAuthors,badgeEnabled.ui:openapi:checkonly verifies the generatedopenapi.jsonmatches the Zod schema — it never verifies the Zod schema matches the actual TS interface, so this silently breaks generated API clients (including@jsonbored/gittensory-mcp) with no CI signal.Scope
src/openapi/schemas.ts— added all 11 fields toRepositorySettingsSchema, plus the 6 fields (badgeEnabled+ 5aiReview*) that the separateRepoSettingsPreview.settingssub-type carries toRepoSettingsPreviewSchema.scripts/check-openapi-settings-parity.mjs(+.d.mts) — parses the top-level field names out of theRepositorySettingstype block insrc/types.tsand diffs them againstRepositorySettingsSchema.shape's keys, failing with the exact field names on any asymmetric difference. Pure functions (extractRepositorySettingsFieldNames,diffFieldSets) are exported and directly unit-tested.package.json— newui:openapi:settings-parityscript, wired intotest:ciright afterui:openapi:check..github/workflows/ci.yml— new "OpenAPI settings-parity check" step, gated identically to "OpenAPI drift check"..claude/skills/contributing-to-gittensory/reference.md— documented the new check.apps/gittensory-ui/public/openapi.json— regenerated.test/unit/ci-openapi-settings-parity.test.ts— new tests for the extraction/diff logic plus a regression test asserting the real type and schema are in parity.Validation
npx vitest run test/unit/ci-openapi-settings-parity.test.ts test/unit/openapi.test.ts— 7/7 passing, 100% line/branch coverage on the changedsrc/openapi/schemas.tsnpm run typecheck— cleannpm run actionlint— cleannpm run test:ci— full local gate greennpm audit --audit-level=moderate— 0 vulnerabilitiesSafety
.optional()/.nullable()matching the TS type's own optionality, so no existing consumer's parsing behavior changes.ui/uiContractpaths change (same gate as the existing OpenAPI drift check) — zero added cost for unrelated PRs..github/workflows/**, a guarded path — expect this to be held for manual owner merge rather than auto-merged.Closes #2556