Skip to content

Fix merged PRs with a missing base_ref being dropped in OSS scoring#1526

Open
cleanjunc wants to merge 2 commits into
entrius:testfrom
cleanjunc:fix/merged-pr-null-base-ref
Open

Fix merged PRs with a missing base_ref being dropped in OSS scoring#1526
cleanjunc wants to merge 2 commits into
entrius:testfrom
cleanjunc:fix/merged-pr-null-base-ref

Conversation

@cleanjunc

Copy link
Copy Markdown

Summary

On the OSS contribution path, check_merged_branch_eligibility coerced a null base_ref to an empty string (base_ref or ''), and the empty string never matches an acceptable branch pattern. As a result, any merged PR with a missing base_ref was 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_ref side 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 the if acceptable guard, which left the base ref check always running. The leftover base_ref or '' coercion then turned a null base_ref into an over blocking case. This change closes that gap.

The issue discovery path already guarded against a null base_ref and treated it as pre-backfill data that should fall through. The null handling now lives inside the shared check_merged_branch_eligibility so 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_ref are 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

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Testing

  • Tests added/updated
  • Manually tested

Added test_missing_base_ref_falls_through on 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

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

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merged PRs with a missing base_ref are dropped on the OSS scoring path

1 participant