Skip to content

fix: trust bot-applied labels on trusted mirror repos - #912

Closed
Crystora wants to merge 2 commits into
entrius:testfrom
Crystora:fix/trusted-label-pipeline-bot-labels
Closed

fix: trust bot-applied labels on trusted mirror repos#912
Crystora wants to merge 2 commits into
entrius:testfrom
Crystora:fix/trusted-label-pipeline-bot-labels

Conversation

@Crystora

@Crystora Crystora commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes mirror label_multiplier for trusted first-party repos that apply scoring labels via bots/Apps (which surface in mirror data with actor_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 to feature (1.5×), bug (1.25×), or refactor (0.5×) collapse to the neutral 1.0×. Concrete example: PR #811 (entrius/gittensor) is labeled refactor by 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_pipeline flag keep the existing maintainer-only check unchanged.

This change:

  • Adds trusted_label_pipeline: bool = False to RepositoryConfig (defaults to False — fully backwards compatible).
  • Threads repo_config into _resolve_maintainer_set_label. When trusted_label_pipeline=True, the actor check is bypassed so any actor (including bots with NULL actor_association) can apply a scoring label; otherwise the existing MAINTAINER_ASSOCIATIONS rule is enforced.
  • Enables trusted_label_pipeline=true for entrius/allways, entrius/allways-ui, entrius/das-github-mirror, entrius/gittensor, entrius/gittensor-ui.
  • Adds entrius/das-github-mirror to master_repositories.json (weight: 0.2, mirror_enabled: true, trusted_label_pipeline: true).
  • Tests:
    • 12-case parametrized truth table on _resolve_maintainer_set_label covering OWNER/MEMBER/COLLABORATOR/CONTRIBUTOR/NONE/NULL actors across trusted_label_pipeline true/false.
    • 4 integration tests in TestPrMultipliers covering bot/maintainer × trusted/untrusted label resolution end-to-end.
    • Loader-level tests asserting trusted_label_pipeline parses correctly from JSON and that every live config entry has the field as a bool.

Related Issues

Fixes #911

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Testing

  • Tests added/updated
  • Manually tested

Commands run (all green):

  • uv run pre-commit run --all-files — ruff lint + format
  • uv run pre-commit run --all-files --hook-stage pre-push — pyright + pytest
  • uv run pyright — 0 errors, 0 warnings
  • uv run pytest tests/723 passed
  • uv run pytest tests/validator/oss_contributions/mirror/test_scoring.py tests/validator/test_load_weights.py -v98 passed

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

@Crystora
Crystora force-pushed the fix/trusted-label-pipeline-bot-labels branch 10 times, most recently from 063e751 to 90e2326 Compare May 1, 2026 19:42
@Crystora
Crystora force-pushed the fix/trusted-label-pipeline-bot-labels branch from 90e2326 to 5e9ad48 Compare May 1, 2026 19:43
@anderdc

anderdc commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Closing in favor of #913 per the maintainer-judgment criterion in #911 ('most elegant, most optimal, most forward-thinking'). Same five deliverables, ~30% smaller diff, cleaner commit history.

@anderdc anderdc closed this May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bot-applied labels don't affect scoring multiplier (label_multiplier always 1.0x)

2 participants