You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of the #5355 root-cause fix for the gate.enabled/gate.checkMode config-as-code ambiguity (2026-07 Orb Review Agent check-run incident). While fixing that, this repo's gateCheckMode DB column/type field was audited as a related-but-distinct piece of naming sprawl:
gateCheckMode: "off" | "enabled" (src/types.ts, src/db/schema.ts) is a derived, read-back-only value (see src/db/repositories.ts around the #4618 comments): gateCheckMode = reviewCheckMode === "disabled" ? "off" : "enabled". It has not been an independent write input since Reduce redundant config surface: linked-issue knob, gateCheckMode, label fields #4618 — every write path derives it from reviewCheckMode.
Despite that, it still appears in 447 occurrences across 48 files repo-wide (production code + ~300 test-fixture literals), including API response shapes (GithubAppBehavior.gateCheckMode, buildInstallationRepairDiagnostics, activation endpoint responses) and doc/example references.
The field name itself continues the exact enabled/checkMode naming collision pattern that caused the original incident: a reader can reasonably (and incorrectly) assume gateCheckMode is a third, independently-settable knob rather than a computed simplification of reviewCheckMode.
Requirements
Stage 1 (safe, mechanical): Mark gateCheckMode as @deprecated wherever it's exposed in a public type/API surface (GithubAppBehavior, activation endpoint responses, RepositorySettings if applicable), pointing readers at reviewCheckMode as the source of truth. No behavior change.
Stage 2 (removal, separate PR(s) from Stage 1):
Audit every one of the 447 occurrences to confirm each is a read of the derived value (not a hidden independent write path) before touching it.
Remove the DB column via a proper migrations/NNNN_*.sql (drop or backfill-then-drop, per whatever npm run db:schema-drift:check requires).
Remove gateCheckMode from RepositorySettings/GithubAppBehavior/API response shapes, updating every consumer to read reviewCheckMode (+ shouldPublishReviewCheck()) directly.
Update or delete the ~300 test-fixture literals that reference it.
Regenerate npm run ui:openapi / npm run cf-typegen as needed.
Deliverables
Stage 1: a small, low-risk PR (or folded into another in-flight PR) adding deprecation markers only.
Stage 2: a dedicated migration PR (or a short PR series, given the ≤10-file preference) that fully removes gateCheckMode, with npm run test:ci green and no dangling references (grep -rn "gateCheckMode" returns zero hits outside historical CHANGELOG/commit messages).
Expected outcome
reviewCheckMode (required | visible | disabled) becomes the single, unambiguous source of truth for review-check publish behavior everywhere in the codebase — no parallel derived field with a confusingly similar name left for a future reader (or a future incident) to misread as independently configurable.
Stage 2 should not be attempted as a single large PR given the blast radius (447 occurrences / 48 files) — split as needed to respect normal PR-size discipline.
Context
Part of the #5355 root-cause fix for the
gate.enabled/gate.checkModeconfig-as-code ambiguity (2026-07 Orb Review Agent check-run incident). While fixing that, this repo'sgateCheckModeDB column/type field was audited as a related-but-distinct piece of naming sprawl:gateCheckMode: "off" | "enabled"(src/types.ts,src/db/schema.ts) is a derived, read-back-only value (seesrc/db/repositories.tsaround the#4618comments):gateCheckMode = reviewCheckMode === "disabled" ? "off" : "enabled". It has not been an independent write input since Reduce redundant config surface: linked-issue knob, gateCheckMode, label fields #4618 — every write path derives it fromreviewCheckMode.GithubAppBehavior.gateCheckMode,buildInstallationRepairDiagnostics, activation endpoint responses) and doc/example references.enabled/checkModenaming collision pattern that caused the original incident: a reader can reasonably (and incorrectly) assumegateCheckModeis a third, independently-settable knob rather than a computed simplification ofreviewCheckMode.Requirements
gateCheckModeas@deprecatedwherever it's exposed in a public type/API surface (GithubAppBehavior, activation endpoint responses,RepositorySettingsif applicable), pointing readers atreviewCheckModeas the source of truth. No behavior change.migrations/NNNN_*.sql(drop or backfill-then-drop, per whatevernpm run db:schema-drift:checkrequires).gateCheckModefromRepositorySettings/GithubAppBehavior/API response shapes, updating every consumer to readreviewCheckMode(+shouldPublishReviewCheck()) directly.npm run ui:openapi/npm run cf-typegenas needed.Deliverables
gateCheckMode, withnpm run test:cigreen and no dangling references (grep -rn "gateCheckMode"returns zero hits outside historical CHANGELOG/commit messages).Expected outcome
reviewCheckMode(required|visible|disabled) becomes the single, unambiguous source of truth for review-check publish behavior everywhere in the codebase — no parallel derived field with a confusingly similar name left for a future reader (or a future incident) to misread as independently configurable.Links & resources
gateCheckModederived-only: Reduce redundant config surface: linked-issue knob, gateCheckMode, label fields #4618src/db/repositories.ts(search#4618) — the current derivation logicsrc/signals/registration-readiness.ts(GithubAppBehavior.gateCheckMode) — a representative public-surface consumersrc/github/backfill.ts(buildInstallationRepairDiagnostics) — another consumerNon-goals for this issue
gate.enabled/gate.checkModeYAML config ambiguity is fully independent of this DB-level field and is fixed separately).