Refs #406: Use API bounty capacity in queue health#474
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pr_queue_health.py script now fetches live bounty state and award capacity from an external MergeWork API endpoint, supplementing GitHub issue data. A new _load_api_bounties() function retrieves and normalizes bounty records while handling fetch and validation failures. The load_live_queue() function integrates this API data, preferring API-derived state and awards when available and gracefully falling back on API errors. Test coverage validates the API integration path and robustness on malformed responses. ChangesAPI-driven bounty enrichment for queue health analysis
Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
Reviewed PR #474 at current head I would hold this for one small observability gap before merge: Evidence on this head:
Suggested fix: keep the fallback, but include an Assessment: this is a good direction for MergeWork because queue-health should use actual award capacity, but without a surfaced fallback warning the tool can still produce overconfident payability output when the API layer is unavailable. |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f2c0ce42-8a2c-4a43-81c1-9f453bfe2cac
📒 Files selected for processing (2)
scripts/pr_queue_health.pytests/test_pr_queue_health.py
|
Thanks, agreed. I pushed What changed:
Fresh validation:
|
|
Pushed Changes:
Fresh validation:
|
GHX5T-SOL
left a comment
There was a problem hiding this comment.
Reviewed current head 1935aa2d526ed9c7589da0556d725bfa0a19ad5d.
No blocker found in this current-head pass. The earlier silent-fallback concern has been addressed: API failures now carry data_sources.bounties = github_issues plus api_bounty_warning, and text/markdown reports render the degraded source. The latest head also validates matching API rows and fails over at the 200-row safety cap instead of silently trusting a potentially truncated list.
Evidence checked:
- PR is open, non-draft, mergeable/CLEAN, with GitHub CI and CodeRabbit successful.
- Diff is scoped to
scripts/pr_queue_health.pyandtests/test_pr_queue_health.py. _load_api_bounties()now wraps malformed UTF-8/JSON/API failures, validatesstatusandawards_remaining, and records visible fallback metadata throughload_live_queue()/analyze_queue().- Live read-only queue health completed with
data_sources.bounties = github_issues+mergework_api. - Live API scan returned 76
ramimbo/mergeworkbounty rows and no duplicate(repo, issue_number)keys; the app model also has a uniqueness constraint for that pair.
Validation:
/home/kali/money/mergework/.venv/bin/python -m pytest tests/test_pr_queue_health.py -q-> 14 passed/home/kali/money/mergework/.venv/bin/python -m pytest -q-> 419 passed/home/kali/money/mergework/.venv/bin/python -m ruff check scripts/pr_queue_health.py tests/test_pr_queue_health.py-> passed/home/kali/money/mergework/.venv/bin/python -m ruff format --check scripts/pr_queue_health.py tests/test_pr_queue_health.py-> 2 files already formatted/home/kali/money/mergework/.venv/bin/python -m mypy app scripts/pr_queue_health.py-> success, no issues in 31 source filesgitleaks detect --no-banner --redact --source . --log-opts upstream/main..HEAD --exit-code 1-> no leaks found
Summary
pr_queue_healthlive mode with public MergeWork API bounty metadata for the target repostatusandawards_remainingto avoid treating exhausted open GitHub bounty issues as payableRefs #406.
Evidence
This addresses a real queue-health edge case: GitHub issue state alone can show a bounty issue as open while the public MergeWork API reports no remaining award capacity. Without the API overlay, live queue reports can incorrectly mark PRs against exhausted bounties as still payable. The invalid UTF-8 regression keeps the fallback boundary intact for malformed API responses.
Validation
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ~/.local/bin/uv run --extra dev python -m pytest tests/test_pr_queue_health.py -q->14 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ~/.local/bin/uv run --extra dev python -m pytest -q->419 passed~/.local/bin/uv run --extra dev ruff check .-> passed~/.local/bin/uv run --extra dev ruff format --check .->79 files already formatted~/.local/bin/uv run --extra dev mypy app scripts/pr_queue_health.py-> successgit diff --check-> cleanNote: pytest plugin autoload is disabled because this workstation has an unrelated ROS Humble pytest plugin on the global path.
Summary by CodeRabbit
New Features
Improvements
Tests