fix(issue-discovery): zero per-repo issue fields for repos absent this round#1640
Open
jaytbarimbao-collab wants to merge 1 commit into
Open
Conversation
…s round _finalize_repo_issue_scores only rewrote the repos seen this round (sorted(set(repo_acc) | set(open_counts))), but _roll_up_issue_totals sums over ALL evaluation.repo_evaluations. A repo that was issue-scored in a prior round and is absent this round (e.g. an evaluation restored from the cache after an OSS PR-fetch failure, which carries prior-round repo_evaluations) kept its stale per-repo issue values, and those got summed back into the round-level totals — inflating total_solved_issues / issue_discovery_score / is_issue_eligible in stored data, CLI `miner score`, analytics, and the cross-round cache. The no-issues path (_clear_issue_discovery_fields) already zeroes every repo_evaluation, which is the intended contract; the scoring path had drifted from it. Extract the per-repo reset into a shared _reset_repo_issue_fields helper and apply it on the scoring path to any repo not seen this round, before the roll-up. Add a regression test asserting a repo absent this round is zeroed and not summed into the round totals. Fixes entrius#1610
Author
|
@anderdc @LandynDev fixes #1610. |
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
_finalize_repo_issue_scoresonly rewrote the repos seen this round (sorted(set(repo_acc) | set(open_counts))), but_roll_up_issue_totalssums over allevaluation.repo_evaluations. A repo issue-scored in a prior round that is absent this round — e.g. an evaluation restored from the cache after an OSS PR-fetch failure (store_or_use_cached_evaluation), which carries prior-roundrepo_evaluations— kept its stale per-repo issue values, and those got summed back into the round-level totals. This inflatestotal_solved_issues/issue_discovery_score/is_issue_eligiblein stored data, CLIminer score, analytics, and the cross-round cache.The no-issues path (
_clear_issue_discovery_fields) already zeroes everyrepo_evaluation, which is the intended contract; the scoring path had drifted from it. This extracts the per-repo reset into a shared_reset_repo_issue_fieldshelper and applies it on the scoring path to any repo not seen this round, before the roll-up.Current-round emission allocation reads the freshly-rebuilt
issue_discovery_issueslist, so this is a stored-data / reporting correctness fix, not an emissions change.Related Issues
Fixes #1610
Type of Change
Testing
TestFinalizeStaleRepoReset::test_repo_absent_this_round_is_zeroed_not_summedasserts a repo absent this round is zeroed and not summed into the round totals. Fails ontestbefore the fix (repo stays at 7 solved / 8.12 score, roll-up inherits it), passes after.ruff+pyrightclean.Checklist