Skip to content

fix(validator): OSS mirror scoring still rejects merged PRs with null base_ref on test #1636

Description

@RealDiligent

Description

OSS mirror PR scoring rejects merged PRs when base_ref is null, even though issue discovery already treats missing branch metadata as pre-backfill data and falls through.

In check_merged_branch_eligibility (gittensor/validator/oss_contributions/mirror/scoring.py), the base-ref gate uses base_ref or ''. When the mirror omits base_ref on older rows, that becomes '', which never matches the acceptable branch set, so valid merged PRs are dropped at load time and never enter merged_prs.

Issue discovery skips the branch gate when solving_pr.base_ref is None (see tests/validator/issue_discovery/test_scan.py::test_missing_base_ref_falls_through_to_solved). OSS scoring should behave the same way.

Steps to Reproduce

  1. Load a merged mirror PR with base_ref: null and default_branch: main.
  2. Call _should_skip_merged_mirror_pr.
  3. Observe the PR is skipped with reason merged to None not in acceptable branches=....

Expected Behavior

When base_ref is missing, skip the base-ref check (same fall-through as null head_ref / head_repo_full_name) so pre-backfill mirror rows can still score.

Actual Behavior

The PR is rejected and earns no OSS contribution score.

Environment

  • Repo: entrius/gittensor
  • Branch: test
  • Affected file: gittensor/validator/oss_contributions/mirror/scoring.py

Additional Context

Parity bug between OSS scoring and issue discovery. Prior reports: #1599.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions