fix(issue-discovery): apply repository label policy to solving-PR scoring#1282
Open
bitloi wants to merge 1 commit into
Open
fix(issue-discovery): apply repository label policy to solving-PR scoring#1282bitloi wants to merge 1 commit into
bitloi wants to merge 1 commit into
Conversation
…ring _mirror_issue_for_scoring resolved discovery_base_score, time_decay, and review_quality but never applied the repository label policy (default_label_multiplier / label_multipliers) from repo_config. This left the issue-discovery path inconsistent with OSS PR scoring since entrius#1027. Fix: - Add Issue.discovery_label_multiplier (float, default 1.0) alongside the existing discovery_* multiplier fields in classes.py. - In _mirror_issue_for_scoring, resolve the label multiplier from solving_pr.labels using the same trusted_label_pipeline trust gate as _resolve_trusted_scoring_label in oss_contributions/mirror/scoring.py. - Multiply discovery_label_multiplier into discovery_earned_score in the scoring loop. repos with default_label_multiplier: 0.0 (e.g. entrius/oc-1, which is scheduled to receive issue_discovery_share > 0 imminently) will now correctly produce discovery_earned_score == 0.0 for unlabelled solving PRs. Downweight labels (refactor: 0.25 in entrius/allways, entrius/gittensor, etc.) are also now applied consistently across both scoring paths. Tests: add TestMirrorIssueForScoringLabelMultiplier (unit) and TestLabelPolicyIssueDiscovery (integration) covering zero-default/no-label, matching-label override, downweight, and untrusted-actor gate cases.
92e42f8 to
b3b9269
Compare
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
_mirror_issue_for_scoringinissue_discovery/scan.pyresolveddiscovery_base_score,discovery_time_decay_multiplier, anddiscovery_review_quality_multiplierfrom the solving PR but never applied the repository label policy (default_label_multiplier/label_multipliers). This left issue-discovery scoring inconsistent with OSS PR scoring, which applies the same policy via_resolve_trusted_scoring_labelsince #1027.Changes:
Issue.discovery_label_multiplier: float = 1.0alongside the existingdiscovery_*multiplier fields inclasses.py_mirror_issue_for_scoring, resolve the label multiplier fromsolving_pr.labelsusing the sametrusted_label_pipelinetrust gate as_resolve_trusted_scoring_labeldiscovery_label_multiplierintodiscovery_earned_scorein the scoring loopRepos with
default_label_multiplier: 0.0(e.g.entrius/oc-1, which is receivingissue_discovery_share > 0imminently) will now correctly producediscovery_earned_score == 0.0for unlabelled solving PRs. Downweight labels (refactor: 0.25inentrius/allways,entrius/gittensor,entrius/das-github-mirror) are also applied consistently across both scoring paths.Related Issues
Closes #1281
Type of Change
Testing
Added
TestMirrorIssueForScoringLabelMultiplier(4 unit tests) andTestLabelPolicyIssueDiscovery(3 integration tests) covering: zero-default multiplier with unlabelled solving PR earns zero score; matching label overrides zero default; downweight label reduces score; untrusted actor label falls back to default multiplier.Checklist