From 94ed64ec991f79998e7ff84ab504b0cd006fda0a Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Sun, 12 Jul 2026 12:00:44 -0700 Subject: [PATCH] chore(types): mark gateCheckMode @deprecated at every declaration site (#5373) #4618 already made gateCheckMode a computed read-back of reviewCheckMode with narrative comments explaining it in most places, but several public-surface type declarations (RepositorySettings, GithubAppBehavior, the settings-preview response shape, the activation preview response, the gittensory-engine package's own RepositorySettings copy, and the OpenAPI response schemas) never got an explicit @deprecated marker on the field itself. Add one everywhere it was missing so IDEs/readers see it at the point of use, not just in a few narrative comments elsewhere in the codebase. Also drops gateCheckMode from the UI's local ActivationResponse type -- confirmed dead: the field was declared but never read anywhere in that component. Stage 1 of #5373's two-stage plan; the DB column/full removal (Stage 2) is tracked separately given its size (447 occurrences across 48 files). --- .../site/app-panels/activation-preview.test.tsx | 1 - .../src/components/site/app-panels/activation-preview.tsx | 1 - .../gittensory-engine/src/types/manifest-deps-types.ts | 2 ++ src/openapi/schemas.ts | 8 ++++++++ src/services/maintainer-activation.ts | 2 ++ src/signals/registration-readiness.ts | 2 ++ src/signals/settings-preview.ts | 2 ++ src/types.ts | 8 ++++---- 8 files changed, 20 insertions(+), 6 deletions(-) diff --git a/apps/gittensory-ui/src/components/site/app-panels/activation-preview.test.tsx b/apps/gittensory-ui/src/components/site/app-panels/activation-preview.test.tsx index f17747b431..113d8bbe99 100644 --- a/apps/gittensory-ui/src/components/site/app-panels/activation-preview.test.tsx +++ b/apps/gittensory-ui/src/components/site/app-panels/activation-preview.test.tsx @@ -96,7 +96,6 @@ describe("ActivationPreview", () => { ok: true, data: { repoFullName: "acme/widgets", - gateCheckMode: "enabled", reviewCheckMode: "required", checkRunMode: "enabled", linkedIssueGateMode: "advisory", diff --git a/apps/gittensory-ui/src/components/site/app-panels/activation-preview.tsx b/apps/gittensory-ui/src/components/site/app-panels/activation-preview.tsx index b188e20d4e..fa6165f873 100644 --- a/apps/gittensory-ui/src/components/site/app-panels/activation-preview.tsx +++ b/apps/gittensory-ui/src/components/site/app-panels/activation-preview.tsx @@ -34,7 +34,6 @@ type ActivationPreviewResponse = { type ActivationResponse = { repoFullName: string; - gateCheckMode: string; reviewCheckMode: string; checkRunMode: string; linkedIssueGateMode: string; diff --git a/packages/gittensory-engine/src/types/manifest-deps-types.ts b/packages/gittensory-engine/src/types/manifest-deps-types.ts index bae7e63f31..6b15989c72 100644 --- a/packages/gittensory-engine/src/types/manifest-deps-types.ts +++ b/packages/gittensory-engine/src/types/manifest-deps-types.ts @@ -155,6 +155,8 @@ 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"; /** 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 diff --git a/src/openapi/schemas.ts b/src/openapi/schemas.ts index 0769ae537d..47a51c95c1 100644 --- a/src/openapi/schemas.ts +++ b/src/openapi/schemas.ts @@ -670,6 +670,8 @@ export const RepositorySettingsSchema = z publicSignalLevel: z.enum(["minimal", "standard"]), checkRunMode: z.enum(["off", "enabled"]), 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"]), regateSweepOrderMode: z.enum(["staleness", "oldest-first"]), reviewCheckMode: z.enum(["required", "visible", "disabled"]), @@ -885,6 +887,8 @@ export const RepoSettingsPreviewSchema = z publicSignalLevel: z.enum(["minimal", "standard"]), checkRunMode: z.enum(["off", "enabled"]), 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"]), regateSweepOrderMode: z.enum(["staleness", "oldest-first"]), reviewCheckMode: z.enum(["required", "visible", "disabled"]), @@ -1288,6 +1292,8 @@ export const InstallationRepairSchema = z commentMode: z.enum(["off", "detected_contributors_only", "all_prs"]), publicAudienceMode: z.enum(["oss_maintainer", "gittensor_only"]), 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"]), reviewCheckMode: z.enum(["required", "visible", "disabled"]), autoProjectMilestoneMatch: z.enum(["off", "suggest", "auto"]).optional(), @@ -2207,6 +2213,8 @@ export const RegistrationReadinessSchema = z commentMode: z.enum(["off", "detected_contributors_only", "all_prs"]), publicAudienceMode: z.enum(["oss_maintainer", "gittensor_only"]), 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"]), reviewCheckMode: z.enum(["required", "visible", "disabled"]), autoProjectMilestoneMatch: z.enum(["off", "suggest", "auto"]).optional(), diff --git a/src/services/maintainer-activation.ts b/src/services/maintainer-activation.ts index 350d302c92..71a80978a7 100644 --- a/src/services/maintainer-activation.ts +++ b/src/services/maintainer-activation.ts @@ -19,6 +19,8 @@ export type MaintainerActivationPreview = { repoFullName: string; generatedAt: string; // What's on today, so the UI can show the current state next to the one-click ramp. + /** @deprecated (#4618, tracked for removal in #5373) sourced from the computed read-back + * `RepositorySettings["gateCheckMode"]` -- kept only for API/dashboard back-compat display. */ currentGateMode: RepositorySettings["gateCheckMode"]; aiReviewConfigured: boolean; evaluatedCount: number; diff --git a/src/signals/registration-readiness.ts b/src/signals/registration-readiness.ts index 4cc2fbe92f..42c9416254 100644 --- a/src/signals/registration-readiness.ts +++ b/src/signals/registration-readiness.ts @@ -36,6 +36,8 @@ export type GithubAppBehavior = { commentMode: RepositorySettings["commentMode"]; publicAudienceMode: RepositorySettings["publicAudienceMode"]; checkRunMode: RepositorySettings["checkRunMode"]; + /** @deprecated (#4618, tracked for removal in #5373) computed read-back of {@link reviewCheckMode} kept + * only for API/dashboard back-compat display -- read `reviewCheckMode` instead. */ gateCheckMode: RepositorySettings["gateCheckMode"]; reviewCheckMode: RepositorySettings["reviewCheckMode"]; quietByDefault: boolean; diff --git a/src/signals/settings-preview.ts b/src/signals/settings-preview.ts index cd32be3b8b..c0bc9546da 100644 --- a/src/signals/settings-preview.ts +++ b/src/signals/settings-preview.ts @@ -191,6 +191,8 @@ export type RepoSettingsPreview = { publicSignalLevel: RepositorySettings["publicSignalLevel"]; checkRunMode: RepositorySettings["checkRunMode"]; checkRunDetailLevel: RepositorySettings["checkRunDetailLevel"]; + /** @deprecated (#4618, tracked for removal in #5373) computed read-back of {@link reviewCheckMode} + * kept only for API/dashboard back-compat display -- read `reviewCheckMode` instead. */ gateCheckMode: RepositorySettings["gateCheckMode"]; regateSweepOrderMode: RepositorySettings["regateSweepOrderMode"]; reviewCheckMode: RepositorySettings["reviewCheckMode"]; diff --git a/src/types.ts b/src/types.ts index 7c2d6ceecf..261afef5fc 100644 --- a/src/types.ts +++ b/src/types.ts @@ -715,10 +715,10 @@ 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"; - /** Legacy shadow of {@link reviewCheckMode} (#2852), deprecated (#4618): 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. */ + /** @deprecated (#4618, tracked for removal in #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"; /** 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