From 7f6656bb4ab11e4f3ed7e3589f4dea3c8a0f5200 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Sun, 12 Jul 2026 12:34:22 -0700 Subject: [PATCH] chore(types): widen gateCheckMode to optional, drop internal-only passthroughs (#5373) Widen RepositorySettings.gateCheckMode from required to optional everywhere it's declared (src/types.ts, the 4 OpenAPI response schemas, and the gittensory-engine package's own RepositorySettings copy), regenerating openapi.json -- unlocks safely omitting it from test fixtures without a TS error. Production code (repositories.ts) is untouched and keeps always populating the field on every read, so this is not a behavior change on its own. Widening it exposed 4 call sites in src/queue/processors.ts that copied settings.gateCheckMode into recordAuditEvent metadata (now typed to reject undefined) and one in src/github/backfill.ts's summarizeRepairSettings -- both internal-only diagnostics surfaces (audit log entries, installation-repair summaries), never a documented API response. Stopped passing it through in all 5 spots; reviewCheckMode (the real authority) is unaffected and still present. --- apps/gittensory-ui/public/openapi.json | 4 ---- .../gittensory-engine/src/types/manifest-deps-types.ts | 7 ++++--- src/github/backfill.ts | 1 - src/openapi/schemas.ts | 8 ++++---- src/queue/processors.ts | 4 ---- src/types.ts | 8 +++++--- 6 files changed, 13 insertions(+), 19 deletions(-) diff --git a/apps/gittensory-ui/public/openapi.json b/apps/gittensory-ui/public/openapi.json index 6f1ff545cf..3c8a50fff1 100644 --- a/apps/gittensory-ui/public/openapi.json +++ b/apps/gittensory-ui/public/openapi.json @@ -3911,7 +3911,6 @@ "commentMode", "publicAudienceMode", "checkRunMode", - "gateCheckMode", "reviewCheckMode", "quietByDefault", "behavior", @@ -9659,7 +9658,6 @@ "publicSignalLevel", "checkRunMode", "checkRunDetailLevel", - "gateCheckMode", "regateSweepOrderMode", "reviewCheckMode", "gatePack", @@ -9783,7 +9781,6 @@ "commentMode", "publicAudienceMode", "checkRunMode", - "gateCheckMode", "reviewCheckMode", "autoLabelEnabled" ] @@ -10398,7 +10395,6 @@ "publicSignalLevel", "checkRunMode", "checkRunDetailLevel", - "gateCheckMode", "regateSweepOrderMode", "reviewCheckMode", "gatePack", diff --git a/packages/gittensory-engine/src/types/manifest-deps-types.ts b/packages/gittensory-engine/src/types/manifest-deps-types.ts index 6b15989c72..f55eb08d88 100644 --- a/packages/gittensory-engine/src/types/manifest-deps-types.ts +++ b/packages/gittensory-engine/src/types/manifest-deps-types.ts @@ -155,9 +155,10 @@ export type RepositorySettings = { publicSignalLevel: "minimal" | "standard"; checkRunMode: "off" | "enabled"; checkRunDetailLevel: "minimal" | "standard"; - /** @deprecated (#4618, tracked for removal in #5373) computed read-back of {@link reviewCheckMode} - * below, kept only for API/dashboard back-compat display -- read `reviewCheckMode` instead. */ - gateCheckMode: "off" | "enabled"; + /** @deprecated (#4618, being removed per #5373) computed read-back of {@link reviewCheckMode} below, + * kept only for API/dashboard back-compat display -- read `reviewCheckMode` instead. Optional (widened + * ahead of full removal) so callers building a partial RepositorySettings no longer need to supply it. */ + gateCheckMode?: "off" | "enabled" | undefined; /** Scheduled re-gate sweep candidate ordering (#3815). `staleness` (default) picks whichever open PR the * sweep has gone longest WITHOUT re-gating (see selectRegateCandidates), which is what gives the sweep its * documented full-coverage-in-ceil(open/max)-ticks convergence guarantee even under dry-run/pause (when diff --git a/src/github/backfill.ts b/src/github/backfill.ts index 407e12ad20..83cc2fe1ba 100644 --- a/src/github/backfill.ts +++ b/src/github/backfill.ts @@ -1168,7 +1168,6 @@ function summarizeRepairSettings(settings: RepositorySettings) { commentMode: settings.commentMode, publicAudienceMode: settings.publicAudienceMode, checkRunMode: settings.checkRunMode, - gateCheckMode: settings.gateCheckMode, reviewCheckMode: settings.reviewCheckMode, autoLabelEnabled: settings.autoLabelEnabled, }; diff --git a/src/openapi/schemas.ts b/src/openapi/schemas.ts index 47a51c95c1..00d896473f 100644 --- a/src/openapi/schemas.ts +++ b/src/openapi/schemas.ts @@ -672,7 +672,7 @@ export const RepositorySettingsSchema = z checkRunDetailLevel: z.enum(["minimal", "standard"]), // @deprecated (#4618, tracked for removal in #5373): computed read-back of reviewCheckMode kept only // for API/dashboard back-compat display -- read reviewCheckMode instead. - gateCheckMode: z.enum(["off", "enabled"]), + gateCheckMode: z.enum(["off", "enabled"]).optional(), regateSweepOrderMode: z.enum(["staleness", "oldest-first"]), reviewCheckMode: z.enum(["required", "visible", "disabled"]), autoProjectMilestoneMatch: z.enum(["off", "suggest", "auto"]).optional(), @@ -889,7 +889,7 @@ export const RepoSettingsPreviewSchema = z checkRunDetailLevel: z.enum(["minimal", "standard"]), // @deprecated (#4618, tracked for removal in #5373): computed read-back of reviewCheckMode kept only // for API/dashboard back-compat display -- read reviewCheckMode instead. - gateCheckMode: z.enum(["off", "enabled"]), + gateCheckMode: z.enum(["off", "enabled"]).optional(), regateSweepOrderMode: z.enum(["staleness", "oldest-first"]), reviewCheckMode: z.enum(["required", "visible", "disabled"]), autoProjectMilestoneMatch: z.enum(["off", "suggest", "auto"]).optional(), @@ -1294,7 +1294,7 @@ export const InstallationRepairSchema = z checkRunMode: z.enum(["off", "enabled"]), // @deprecated (#4618, tracked for removal in #5373): computed read-back of reviewCheckMode kept only // for API/dashboard back-compat display -- read reviewCheckMode instead. - gateCheckMode: z.enum(["off", "enabled"]), + gateCheckMode: z.enum(["off", "enabled"]).optional(), reviewCheckMode: z.enum(["required", "visible", "disabled"]), autoProjectMilestoneMatch: z.enum(["off", "suggest", "auto"]).optional(), autoProjectMilestoneMatchBackend: z.enum(["github", "linear"]).optional(), @@ -2215,7 +2215,7 @@ export const RegistrationReadinessSchema = z checkRunMode: z.enum(["off", "enabled"]), // @deprecated (#4618, tracked for removal in #5373): computed read-back of reviewCheckMode kept only // for API/dashboard back-compat display -- read reviewCheckMode instead. - gateCheckMode: z.enum(["off", "enabled"]), + gateCheckMode: z.enum(["off", "enabled"]).optional(), reviewCheckMode: z.enum(["required", "visible", "disabled"]), autoProjectMilestoneMatch: z.enum(["off", "suggest", "auto"]).optional(), autoProjectMilestoneMatchBackend: z.enum(["github", "linear"]).optional(), diff --git a/src/queue/processors.ts b/src/queue/processors.ts index 07b136551b..73787bb246 100644 --- a/src/queue/processors.ts +++ b/src/queue/processors.ts @@ -8006,7 +8006,6 @@ async function maybePublishPrPublicSurface( metadata: { deliveryId: webhook.deliveryId, repoFullName, - gateCheckMode: settings.gateCheckMode, reviewCheckMode: settings.reviewCheckMode, publishedOutputs, failedOutputs, @@ -8034,7 +8033,6 @@ async function maybePublishPrPublicSurface( publicSurface: settings.publicSurface, label: decision.willLabel ? settings.gittensorLabel : null, checkRunMode: settings.checkRunMode, - gateCheckMode: settings.gateCheckMode, reviewCheckMode: settings.reviewCheckMode, publicAudienceMode: settings.publicAudienceMode, publishedOutputs, @@ -8084,7 +8082,6 @@ async function maybePublishPrPublicSurface( publicSurface: settings.publicSurface, label: decision.willLabel ? settings.gittensorLabel : null, checkRunMode: settings.checkRunMode, - gateCheckMode: settings.gateCheckMode, reviewCheckMode: settings.reviewCheckMode, publicAudienceMode: settings.publicAudienceMode, publishedOutputs, @@ -8103,7 +8100,6 @@ async function maybePublishPrPublicSurface( publicSurface: settings.publicSurface, labelApplied: decision.willLabel, checkRunMode: settings.checkRunMode, - gateCheckMode: settings.gateCheckMode, reviewCheckMode: settings.reviewCheckMode, publicAudienceMode: settings.publicAudienceMode, publishedOutputs, diff --git a/src/types.ts b/src/types.ts index 261afef5fc..8a807f350d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -715,11 +715,13 @@ export type RepositorySettings = { // #4620: "deep" removed -- it was never wired to any different behavior than "standard" (formatCheckRunOutput // and buildCheckRunAnnotations in rules/advisory.ts both branch only on `=== "minimal"` vs not). checkRunDetailLevel: "minimal" | "standard"; - /** @deprecated (#4618, tracked for removal in #5373) Legacy shadow of {@link reviewCheckMode} (#2852): a + /** @deprecated (#4618, being removed per #5373) Legacy shadow of {@link reviewCheckMode} (#2852): a * computed read-back value only, for API/dashboard back-compat display. `"enabled"` when * `reviewCheckMode !== "disabled"`, else `"off"` -- see getRepositorySettings/upsertRepositorySettings in - * db/repositories.ts. No write path accepts this field anymore; set {@link reviewCheckMode} directly instead. */ - gateCheckMode: "off" | "enabled"; + * db/repositories.ts. No write path accepts this field anymore; set {@link reviewCheckMode} directly + * instead. Optional (widened ahead of full removal) so callers building a partial RepositorySettings no + * longer need to supply it; production code (repositories.ts) still always populates it on every read. */ + gateCheckMode?: "off" | "enabled" | undefined; /** Scheduled re-gate sweep candidate ordering (#3815). `staleness` (default) picks whichever open PR the * sweep has gone longest WITHOUT re-gating (see selectRegateCandidates), which is what gives the sweep its * documented full-coverage-in-ceil(open/max)-ticks convergence guarantee even under dry-run/pause (when