fix(issue-discovery): keep fresh scoring data when open-count fetch fails (#1249)#1312
Closed
jeffrey701 wants to merge 1 commit into
Closed
Conversation
…ails (entrius#1249) run_issue_discovery makes two mirror calls per miner: one for the scoring payload (since=lookback) and one for the open-issue count. When the first succeeds and the second fails, the current code restores stale cached aggregates and drops the freshly-fetched solved-issue evidence — penalising miners for transient mirror flakiness on the supplementary call. Treat the open-count fetch as soft-fail: when it raises, fall back to the prior cycle's per-repo total_open_issues (via a new helper, _open_counts_from_cache) and continue scoring against the lookback dataset already in hand. Empty fallback when no cache row exists. Closes entrius#1249
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
run_issue_discoverymakes two mirror calls per miner — one for the scoring payload (since=lookback) and one for the open-issue count. When call 1 succeeds and call 2 fails, the current code calls_restore_issue_discovery_from_cacheandcontinues, discarding the freshly-fetched solved-issue evidence and reverting to stale cached aggregates.Soft-fail the open-count call: when it raises, fall back to the prior cycle's per-repo
total_open_issuesvia a new helper_open_counts_from_cache(evaluation, evaluation_cache, enabled_names). Scoring then proceeds against the lookback dataset that was already retrieved. Empty fallback ({}) when no cache row exists — still better than dropping the miner entirely.Implementation matches the issue's "Possible Solution" section.
Closes #1249
Test plan
uv run pytest tests/validator/issue_discovery/— 54/54 pass._count_open_issuesover freshcurrent_response)._open_counts_from_cachereturns prior-cycle per-repo counts (or{}), scoring runs overresponse.issues.