fix(review): give LOOPOVER_DUPLICATE_WINNER a per-repo config override - #6005
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Duplicate-winner adjudication (whether the earliest claimant in a
duplicate-issue cluster is spared, or every sibling closes) was
controlled by a single fleet-wide LOOPOVER_DUPLICATE_WINNER env var --
no per-repo override existed at any of its 8 call sites across
processors.ts, duplicate-detection.ts, and the maintainer-activation
preview route.
Adds duplicateWinnerMode ("inherit" | "off" | "enabled", mirroring
moderationGateMode/skipAutomationBotAuthors' shape) as a
RepositorySettings field wired through .loopover.yml
settings.duplicateWinnerMode, and a resolveDuplicateWinnerEnabled
helper (src/settings/duplicate-winner-mode.ts) that every call site
now goes through instead of reading the env var directly -- "inherit"
(the default) reproduces today's exact fleet-wide behavior, "off"/
"enabled" let one repo opt out or in regardless of the global default.
JSONbored
force-pushed
the
fix/config-duplicate-winner-override
branch
from
July 15, 2026 06:45
a26870d to
39cdc9f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6005 +/- ##
=======================================
Coverage 95.16% 95.16%
=======================================
Files 591 592 +1
Lines 46934 46940 +6
Branches 15000 15003 +3
=======================================
+ Hits 44664 44670 +6
Misses 1512 1512
Partials 758 758
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Bundle ReportChanges will increase total bundle size by 259 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
This was referenced Jul 15, 2026
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
LOOPOVER_DUPLICATE_WINNERenv var, read directly at 8 separate call sites acrosssrc/queue/processors.ts,src/queue/duplicate-detection.ts, and the maintainer-activation preview route (src/api/routes.ts) -- no per-repo override existed anywhere.duplicateWinnerMode("inherit" | "off" | "enabled", mirroringmoderationGateMode/skipAutomationBotAuthors' existing shape) as aRepositorySettingsfield wired through.loopover.yml settings.duplicateWinnerMode.src/settings/duplicate-winner-mode.ts(isDuplicateWinnerEnabledGlobally+resolveDuplicateWinnerEnabled, mirroringsrc/settings/automation-bot-skip.ts's existing resolver pattern), which every one of the 8 call sites now goes through instead of readingenv.LOOPOVER_DUPLICATE_WINNERdirectly."inherit"(the default) reproduces today's exact fleet-wide behavior byte-for-byte;"off"/"enabled"let one repo opt out or in regardless of the global default.reconcileLiveDuplicateSiblings(src/queue/duplicate-detection.ts) now also takessettingsso its live-reconciliation short-circuit respects the same per-repo override, not just the bare env flag -- previously a repo with an override would have gotten a stale winner election if the fast path had stayed env-only.Test plan
npm run test:ci(full local gate) greennpm audit --audit-level=moderate-- 0 vulnerabilitiestest/unit/duplicate-winner-mode.test.ts: the resolver's inherit/off/enabled truth table, both directionsparseFocusManifest/resolveEffectiveSettingstest forduplicateWinnerMode(mirrors the existingmoderationGateModetest)test/unit/reconcile-live-duplicate-siblings.test.tswith 2 regression cases: a per-repo"enabled"override reconciles even when the global flag is off, and"off"stays untouched even when the global flag is onsettingsparameter (queue-lifecycle-guards.test.ts, and theSETTINGS_FIELD_TOKENSdocs-parity map infocus-manifest.test.ts)