Fix merged PRs with a missing base_ref being dropped in OSS scoring#1526
Open
cleanjunc wants to merge 2 commits into
Open
Fix merged PRs with a missing base_ref being dropped in OSS scoring#1526cleanjunc wants to merge 2 commits into
cleanjunc wants to merge 2 commits into
Conversation
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
On the OSS contribution path,
check_merged_branch_eligibilitycoerced a nullbase_refto an empty string (base_ref or ''), and the empty string never matches an acceptable branch pattern. As a result, any merged PR with a missingbase_refwas rejected as a non acceptable branch merge and dropped at load time, so the miner silently lost the score for that PR.This is the missing
base_refside of the same gate touched by #958 and #963. #963 fixed the under blocking case by making the acceptable set fall back to'main'and dropping theif acceptableguard, which left the base ref check always running. The leftoverbase_ref or ''coercion then turned a nullbase_refinto an over blocking case. This change closes that gap.The issue discovery path already guarded against a null
base_refand treated it as pre-backfill data that should fall through. The null handling now lives inside the sharedcheck_merged_branch_eligibilityso both paths behave identically, and the now redundant guard in the issue discovery path is removed so the logic lives in one place.PRs that do carry a
base_refare unaffected: matches, mismatches, wildcards, and the default branch fallback all behave exactly as before, so the #958 fix is fully preserved.Related Issues
Closes #1525
Relates to #958, #963
Type of Change
Testing
Added
test_missing_base_ref_falls_throughon the OSS path, mirroring the existing issue discovery coverage. Verified that the new test fails against the original source and passes with the fix. The #958 regression test (test_no_default_branch_no_additional_blocks_non_main_base_ref) still passes, confirming non acceptable concrete base refs remain blocked. All 156 tests across the affected modules pass.Checklist