Mirror tracked-repo reconciliation from consensus snapshots#1653
Open
LandynDev wants to merge 1 commit into
Open
Mirror tracked-repo reconciliation from consensus snapshots#1653LandynDev wants to merge 1 commit into
LandynDev wants to merge 1 commit into
Conversation
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
Env-gated reconciler that keeps the GT mirror's tracked-repo set in sync with the consensus snapshot: voted repos get registered and deep-backfilled, repos absent for a full hysteresis window get deregistered. Runs inside the team validator after each snapshot store — no side deployment.
Motivation
With open-world voting the mirror needs a definitive tracked list without churn. The snapshot union changes at most 2x/day, so registrations/deregistrations follow a stable list; vote flicker between snapshots is invisible by construction.
Changes
weight_consensus/mirror_sync.py: diffs the eligible-voter basket union againstGET /admin/repos, acts only on state transitions; registers withdays=40backfill (mirror's register default is 10); warns on voted repos pending GitHub App install; deregisters only when the consensus gate is active, a fullMIRROR_DEREG_SNAPSHOTS=4(~2 days) history window exists, and the repo appears in none of it; caps atMIRROR_MAX_TRACKED_REPOS=300by aggregate shareMIRROR_ADMIN_API_KEYenv (team validator); requiresSTORE_DB_RESULTSsince hysteresis reads basket history from postgres_store_weight_consensusafter the DB write; failures isolated by the store-hook try/except, consensus never affectedStacked on #1651. Server side: entrius/das-github-mirror#226.