fix: trust bot-applied labels on trusted mirror repos - #912
Closed
Crystora wants to merge 2 commits into
Closed
Conversation
Crystora
force-pushed
the
fix/trusted-label-pipeline-bot-labels
branch
10 times, most recently
from
May 1, 2026 19:42
063e751 to
90e2326
Compare
Crystora
force-pushed
the
fix/trusted-label-pipeline-bot-labels
branch
from
May 1, 2026 19:43
90e2326 to
5e9ad48
Compare
Collaborator
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
Fixes mirror
label_multiplierfor trusted first-party repos that apply scoring labels via bots/Apps (which surface in mirror data withactor_association=NULL).Today the mirror filters labels to actors in
MAINTAINER_ASSOCIATIONS(OWNER/MEMBER/COLLABORATOR). Bot-applied labels get NULL actor_association and are silently dropped, so PRs that should resolve tofeature(1.5×),bug(1.25×), orrefactor(0.5×) collapse to the neutral 1.0×. Concrete example: PR #811 (entrius/gittensor) is labeledrefactorby an automation but scores at 1.0× instead of 0.5×.This PR adds a per-repo opt-in flag rather than weakening the global rule. Repos that haven't earned the
trusted_label_pipelineflag keep the existing maintainer-only check unchanged.This change:
trusted_label_pipeline: bool = FalsetoRepositoryConfig(defaults toFalse— fully backwards compatible).repo_configinto_resolve_maintainer_set_label. Whentrusted_label_pipeline=True, the actor check is bypassed so any actor (including bots with NULLactor_association) can apply a scoring label; otherwise the existingMAINTAINER_ASSOCIATIONSrule is enforced.trusted_label_pipeline=trueforentrius/allways,entrius/allways-ui,entrius/das-github-mirror,entrius/gittensor,entrius/gittensor-ui.entrius/das-github-mirrortomaster_repositories.json(weight: 0.2,mirror_enabled: true,trusted_label_pipeline: true)._resolve_maintainer_set_labelcoveringOWNER/MEMBER/COLLABORATOR/CONTRIBUTOR/NONE/NULLactors acrosstrusted_label_pipelinetrue/false.TestPrMultiplierscovering bot/maintainer × trusted/untrusted label resolution end-to-end.trusted_label_pipelineparses correctly from JSON and that every live config entry has the field as abool.Related Issues
Fixes #911
Type of Change
Testing
Commands run (all green):
uv run pre-commit run --all-files— ruff lint + formatuv run pre-commit run --all-files --hook-stage pre-push— pyright + pytestuv run pyright— 0 errors, 0 warningsuv run pytest tests/— 723 passeduv run pytest tests/validator/oss_contributions/mirror/test_scoring.py tests/validator/test_load_weights.py -v— 98 passedChecklist