Skip to content

Ignore native bounty ids in queue refs#547

Open
tinyopsstudio wants to merge 8 commits into
ramimbo:mainfrom
tinyopsstudio:tinyops-pr-queue-native-bounty-ref
Open

Ignore native bounty ids in queue refs#547
tinyopsstudio wants to merge 8 commits into
ramimbo:mainfrom
tinyopsstudio:tinyops-pr-queue-native-bounty-ref

Conversation

@tinyopsstudio
Copy link
Copy Markdown

@tinyopsstudio tinyopsstudio commented May 27, 2026

Bounty #406

Summary:

  • keep PR queue health focused on GitHub bounty issue references instead of native MRWK bounty ids
  • ignore phrases like live bounty #66 / MRWK bounty #66 while still accepting issue #406, Refs #406, and /claim #406
  • update the missing-reference copy and add regression coverage for mixed native-bounty-id plus GitHub-issue evidence text

Evidence:

Verification:

  • uv run --extra dev python -m pytest tests/test_pr_queue_health.py -q
  • uv run --extra dev python -m pytest -q
  • uv run --extra dev ruff check scripts/pr_queue_health.py tests/test_pr_queue_health.py
  • uv run --extra dev ruff format --check scripts/pr_queue_health.py tests/test_pr_queue_health.py
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Broader recognition of bounty and issue reference formats (bounty, issues, refs, fixes, closes, claims).
  • Improvements

    • Reports now include "Issue #" wording alongside existing reference variants.
    • When a PR contains both a native bounty reference and an explicit issue reference, the explicit issue takes precedence in reporting.
  • Tests

    • Added test covering reference-priority behavior and updated assertions to match new messaging.

Review Change Stack

Bounty ramimbo#427: scripts/pr_queue_health.py
Bounty ramimbo#427: tests/test_pr_queue_health.py
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 09500af2-9862-4b01-89f9-018057bec43e

📥 Commits

Reviewing files that changed from the base of the PR and between db9e5e9 and ae62167.

📒 Files selected for processing (2)
  • scripts/pr_queue_health.py
  • tests/test_pr_queue_health.py

📝 Walkthrough

Walkthrough

Expanded the bounty-reference regex to detect more keywords while excluding native-like prefixed "bounty" mentions; updated the missing-bounty message to include "Issue #"; added/adjusted tests to validate mixed native/issue-reference scenarios and markdown formatting.

Changes

Bounty Reference Parsing

Layer / File(s) Summary
Pattern and messaging updates
scripts/pr_queue_health.py
BOUNTY_REF_RE regex broadened to match "bounty", "issue", "refs", "fixes", "closes", and "claims" keywords with optional `live
Reference extraction and dedupe
scripts/pr_queue_health.py
_bounty_refs now uses finditer, builds a deduplicated set of referenced numbers, and skips bounty matches when the optional native-like prefix is present.
Test coverage for reference handling
tests/test_pr_queue_health.py
Added test_pr_queue_health_ignores_native_bounty_ids_when_issue_ref_is_present to assert native bounty IDs are ignored when an explicit issue reference exists; adjusted markdown assertion formatting for the "Missing bounty references" message.

Possibly Related PRs

  • ramimbo/mergework#438: Modifies BOUNTY_REF_RE and missing bounty references messaging to recognize /claim #<issue> formats with corresponding test updates.
  • ramimbo/mergework#413: Modifies missing bounty references and markdown reporting strings that directly interact with this PR's messaging changes.
  • ramimbo/mergework#324: Introduces bounty/refs parsing behavior that this PR extends and refines.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Ignore native bounty ids in queue refs' clearly and concretely describes the main change: modifying the PR queue health parser to ignore native bounty ID phrases while accepting GitHub issue references.
Description check ✅ Passed The description includes a bounty reference, clear summary of changes, detailed evidence sections documenting before/after behavior, verification commands, and security assurance, fulfilling the template requirements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Mergework Public Artifact Hygiene ✅ Passed PR contains no investment, price, cash-out, fabricated payout claims, or private security details. Changes are technical reference-format parsing improvements with no problematic artifact claims.
Bounty Pr Focus ✅ Passed PR diff matches stated files with regex expansion, native-prefix filtering, comprehensive tests covering mixed and native-only cases, and no unrelated scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c075eaa7-7daa-426e-b4ea-dea56fe7d5a7

📥 Commits

Reviewing files that changed from the base of the PR and between d8532d4 and 67e738a.

📒 Files selected for processing (2)
  • scripts/pr_queue_health.py
  • tests/test_pr_queue_health.py

Comment thread tests/test_pr_queue_health.py
Copy link
Copy Markdown

@Baijack-star Baijack-star left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one correctness issue that still leaves the advertised native-id case noisy.

The new pattern only suppresses live bounty #... and MRWK bounty #..., but the PR title and summary describe ignoring native bounty ids in general. A body that uses the natural wording native bounty #66 / issue #406 still matches bounty #66, so analyze_queue emits unknown_bounty_reference even though the GitHub issue ref is present.

Repro I ran on this branch:

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ./.venv/bin/python - <<'PY'
from scripts.pr_queue_health import analyze_queue
fixture = {
    "bounties": [{"number": 406, "state": "OPEN", "awards_remaining": 16}],
    "pull_requests": [{
        "number": 547,
        "title": "Refs #406: Ignore native bounty ids",
        "body": "Evidence: native bounty #66 / issue #406 preflight returned status=open.",
        "merge_state": "clean",
        "labels": [],
    }],
}
report = analyze_queue(fixture)
print(report["summary"])
print(report["closed_bounty_references"])
PY

Observed:

{'pull_requests': 1, 'open_bounties': 1, 'closed_or_exhausted_bounties': 0, 'closed_bounty_references': 1, 'missing_bounty_references': 0, 'dirty_or_unstable_merge_state': 0, 'needs_info': 0, 'duplicate_scope_groups': 0}
[{'pull_request': 547, 'title': 'Refs #406: Ignore native bounty ids', 'url': None, 'reason': 'unknown_bounty_reference', 'detail': 'Referenced bounty #66 was not in input'}]

The focused suite itself passes (PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ./.venv/bin/python -m pytest tests/test_pr_queue_health.py -q, 10 passed), so this likely needs an added regression case and either a broader native-id prefix list or parsing that prefers explicit issue/refs/fixes/closes/claims references over generic native bounty evidence text.

@tinyopsstudio
Copy link
Copy Markdown
Author

Addressed the requested-change case in the updated PR head db9e5e9fafbf22fc9426a8ac78773a31e740cd24.

What changed:

  • broadened the native-id filter to skip native bounty #... and internal bounty #... alongside live bounty #... and MRWK bounty #...;
  • added regression rows for both native bounty #66 / issue #406 and internal bounty #66, issue #406.

Repro from the review now returns no queue-health finding:

{'pull_requests': 1, 'open_bounties': 1, 'closed_or_exhausted_bounties': 0, 'closed_bounty_references': 0, 'missing_bounty_references': 0, 'dirty_or_unstable_merge_state': 0, 'needs_info': 0, 'duplicate_scope_groups': 0}
[]

Validation after the update:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_pr_queue_health.py -q -> 10 passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q -> 415 passed
  • uv run --extra dev ruff check scripts/pr_queue_health.py tests/test_pr_queue_health.py -> passed
  • uv run --extra dev ruff format --check scripts/pr_queue_health.py tests/test_pr_queue_health.py -> 2 files already formatted
  • git diff --check -> clean

Copy link
Copy Markdown

@Baijack-star Baijack-star left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I rechecked the requested-change case on head db9e5e9fafbf22fc9426a8ac78773a31e740cd24; the native/internal wording that failed before is now covered and resolves cleanly to the GitHub issue reference.

Validation run locally:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ./.venv/bin/python -m pytest tests/test_pr_queue_health.py -q -> 10 passed
  • ./.venv/bin/python -m ruff check scripts/pr_queue_health.py tests/test_pr_queue_health.py -> passed
  • ./.venv/bin/python -m ruff format --check scripts/pr_queue_health.py tests/test_pr_queue_health.py -> passed
  • git diff --check origin/main...HEAD -> clean

I also reran the ad hoc parser smoke for these bodies and each produced zero closed_bounty_references and zero missing_bounty_references:

  • native bounty #66 / issue #406
  • internal bounty #66, issue #406
  • MRWK bounty #66 / issues #406
  • live bounty #66 / issue #406

No remaining blocker from my earlier requested-change finding.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e058d6a8-16b4-4053-8c2b-2c85bdb0a281

📥 Commits

Reviewing files that changed from the base of the PR and between 67e738a and db9e5e9.

📒 Files selected for processing (2)
  • scripts/pr_queue_health.py
  • tests/test_pr_queue_health.py

Comment thread scripts/pr_queue_health.py
Comment thread tests/test_pr_queue_health.py
@tinyopsstudio
Copy link
Copy Markdown
Author

Addressed the latest CodeRabbit edge-case comments in PR head 2ed82bd29cbc64f13aae6736305a3835402b6760.

What changed:

  • replaced the fixed-width negative-lookbehind regex with a broader reference matcher plus a native-prefix filter, so live bounty #66 and live\tbounty #66 are ignored as native/live evidence ids;
  • kept normal non-native wording such as relive bounty #66, archive bounty #66, and plain bounty #66 as valid GitHub bounty references;
  • added a native-only negative test so a PR body with only live bounty #66 and no GitHub issue ref reports missing_bounty_reference;
  • kept the mixed native/live plus explicit GitHub issue coverage for MRWK bounty #66 maps to issue #406, native bounty #66 / issue #406, and internal bounty #66, issue #406.

Extra parser sanity check:

live bounty #66 => []
live  bounty #66 => []
live	bounty #66 => []
MRWK bounty #66 maps to issue #406 => [406]
native bounty #66 / issue #406 => [406]
internal bounty #66, issue #406 => [406]
relive bounty #66 => [66]
archive bounty #66 => [66]
bounty #66 => [66]

Validation:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_pr_queue_health.py -q -> 12 passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q -> 417 passed
  • uv run --extra dev ruff check scripts/pr_queue_health.py tests/test_pr_queue_health.py -> passed
  • uv run --extra dev ruff format --check scripts/pr_queue_health.py tests/test_pr_queue_health.py -> 2 files already formatted
  • git diff --check -> clean

@tinyopsstudio
Copy link
Copy Markdown
Author

Addressed the CodeRabbit whitespace/native-only follow-up on the updated PR branch.

What changed:

  • replaced the fixed-width negative-lookbehind bounty regex with an optional native-prefix capture;
  • native-prefixed bounty ids now ignore live, MRWK, native, and internal prefixes with arbitrary whitespace before bounty;
  • normal bounty references still count, including the boundary case relive bounty #406;
  • added regression coverage for live bounty #66, live\tbounty #67, and a native-bounty-only PR that must still report missing_bounty_reference.

Validation:

  • uv run --extra dev python -m pytest tests/test_pr_queue_health.py -q -> 11 passed
  • uv run --extra dev python -m pytest -q -> 416 passed
  • uv run --extra dev ruff check scripts/pr_queue_health.py tests/test_pr_queue_health.py -> passed
  • uv run --extra dev ruff format --check scripts/pr_queue_health.py tests/test_pr_queue_health.py -> 2 files already formatted

@tinyopsstudio
Copy link
Copy Markdown
Author

Correction/remote-branch verification: I fetched the exact TinyOps branch currently backing this PR and verified head ae62167 / PR head 2ed82bd29cbc64f13aae6736305a3835402b6760.

The branch content handles the CodeRabbit edge cases:

live bounty #66 => []
live  bounty #66 => []
live	bounty #66 => []
MRWK bounty #66 maps to issue #406 => [406]
native bounty #66 / issue #406 => [406]
internal bounty #66, issue #406 => [406]
relive bounty #66 => [66]
archive bounty #66 => [66]
bounty #66 => [66]

Validation on the fetched remote branch:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_pr_queue_health.py -q -> 11 passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q -> 416 passed
  • uv run --extra dev ruff check scripts/pr_queue_health.py tests/test_pr_queue_health.py -> passed
  • uv run --extra dev ruff format --check scripts/pr_queue_health.py tests/test_pr_queue_health.py -> 2 files already formatted
  • git diff --check -> clean

Note: my previous follow-up used the local patch worktree count before fetching the exact branch state; the fetched remote branch evidence above is the authoritative verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants