refactor(selfhost): dual-read GITTENSORY_REVIEW_* feature flags alongside LOOPOVER_#5593
Merged
Merged
Conversation
…side LOOPOVER_ Closes #5555. Follow-up to #4774/#5561, which covered the 7 self-host operational vars but deliberately left out this larger 22-variable GITTENSORY_REVIEW_* feature-flag family. Applies the already-merged dualPrefixEnvFlag/dualPrefixEnvString helpers (src/utils/env.ts) to all 22 flags, so LOOPOVER_REVIEW_* wins when both prefixes are set, falling back to the legacy GITTENSORY_ name otherwise. An untouched self-host .env keeps working unchanged. Two flags needed special handling rather than a mechanical swap: - REVIEW_REPOS is a raw comma-separated allowlist string, not a boolean flag -- uses dualPrefixEnvString, not dualPrefixEnvFlag, across its 2 read sites in cutover-gate.ts. - REVIEW_SELFTUNE has 2 independent read sites (selftune-wire.ts and a deliberate duplicate in settings/repository-settings.ts, inlined there specifically to avoid an import cycle) -- both converted, importing dualPrefixEnvFlag directly from utils/env rather than reintroducing the cycle. CONTENT_LANE's flag.ts previously used a hand-rolled Set-membership truthy check instead of the shared regex; functionally identical for the 4 accepted tokens (1/true/yes/on, trimmed, case-insensitive), so safely replaced with the shared helper. apps/gittensory-ui/src/lib/selfhost-env-reference.ts is NOT regenerated here -- its generator's DEFAULT_SOURCE_ROOTS never included src/review/**, src/queue/**, or src/settings/** (confirmed: none of these 22 vars, even in their single-prefix form, appear in that file on main either), so it's out of scope for this doc, unrelated to this change. Added LOOPOVER_REVIEW_* companion lines to .env.example / .env.selfhost.example instead, next to each flag's existing GITTENSORY_REVIEW_* line, matching #5561's documentation pattern -- this is the real documentation surface for these flags.
Contributor
|
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 #5593 +/- ##
==========================================
- Coverage 95.01% 95.01% -0.01%
==========================================
Files 573 573
Lines 45534 45533 -1
Branches 14680 14661 -19
==========================================
- Hits 43263 43262 -1
Misses 1520 1520
Partials 751 751
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GITTENSORY_REVIEW_*feature-flag family. Between the two PRs, all "roughly twenty" vars Environment variable family migration #4774 describes are now dual-read.dualPrefixEnvFlag/dualPrefixEnvStringhelpers (src/utils/env.ts) to all 22 flags, soLOOPOVER_REVIEW_*wins when both prefixes are set, falling back to the legacyGITTENSORY_name otherwise. An untouched self-host.envkeeps working unchanged.REVIEW_REPOSis a raw comma-separated allowlist string, not a boolean flag — usesdualPrefixEnvString, notdualPrefixEnvFlag, across its 2 read sites incutover-gate.ts.REVIEW_SELFTUNEhas 2 independent read sites (selftune-wire.tsand a deliberate duplicate insettings/repository-settings.ts, inlined there specifically to avoid an import cycle) — both converted, importingdualPrefixEnvFlagdirectly fromutils/envrather than reintroducing the cycle.CONTENT_LANE'sflag.tspreviously used a hand-rolledSet-membership truthy check instead of the shared regex; functionally identical for the 4 accepted tokens (1/true/yes/on, trimmed, case-insensitive), so safely replaced with the shared helper.apps/gittensory-ui/src/lib/selfhost-env-reference.tsis not regenerated here — its generator'sDEFAULT_SOURCE_ROOTSnever includedsrc/review/**,src/queue/**, orsrc/settings/**(confirmed: none of these 22 vars, even in single-prefix form, appear in that file onmaineither), so it's genuinely out of scope for that doc. AddedLOOPOVER_REVIEW_*companion lines to.env.example/.env.selfhost.exampleinstead, next to each flag's existingGITTENSORY_REVIEW_*line, matching refactor(selfhost): dual-read LOOPOVER_-prefixed env vars alongside GITTENSORY_ #5561's documentation pattern — that's the real documentation surface for these flags.Note on #5555's history
#5555 was auto-closed by the gate's cross-reference heuristic when PR #5561 merged, even though that PR's body only said "see #5555" (not a closing keyword) and never implemented this scope. Reopened before starting this PR; confirmed via grep that none of the 22 vars had
dualPrefixEnvFlagapplied before this PR.Test plan
npm run test:ci+npm audit --audit-level=moderate) green.tsc --noEmitclean across all 24 touched source files.