Use API bounty state in submission gate#481
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)
📝 WalkthroughWalkthroughLive-context bounty state resolution now prefers MergeWork API state over GitHub issue state when available. The ChangesAPI Bounty State Preference
Possibly related PRs
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
GHX5T-SOL
left a comment
There was a problem hiding this comment.
Reviewed PR #481 at current head 7141b1fffb37fd9c7d1f614ec7769ee9fb25e560 as a non-author review. No blocker found in this focused pass.
Evidence checked:
- Diff is limited to
scripts/submission_quality_gate.pyandtests/test_submission_quality_gate.py. _load_live_context()already uses MergeWork API rows to verifyawards_remaining; this change also takes the APIstatewhen the API row is present, so a stale/closed GitHub issue state cannot false-fail a bounty that the MergeWork API says is open and payable.- The new regression covers the exact mismatch: GitHub issue
CLOSED, API rowopenwithawards_remaining: 1, and the gate now reportsbounty_payableas passing instead of closed/exhausted. - Current live public API rows for
ramimbo/mergework#406and#447both reportstatus: openwith awards remaining, matching the intended API-as-payability-source behavior. - GitHub CI is successful and CodeRabbit reports no actionable comments on the reviewed head.
Validation run locally:
uv run --extra dev python -m pytest tests/test_submission_quality_gate.py -q->24 passeduv run --extra dev python -m pytest tests/test_pr_queue_health.py -q->9 passeduv run --extra dev python -m pytest -q->415 passeduv run --extra dev ruff check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py-> passeduv run --extra dev ruff format --check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py->2 files already formatteduv run --extra dev python -m mypy scripts/submission_quality_gate.py-> successuv run --extra dev python scripts/docs_smoke.py-> docs smoke okgit diff --check origin/main...HEAD-> cleangitleaks detect --no-banner --redact --source . --log-opts origin/main..HEAD --exit-code 1-> no leaks found
Assessment: this is a narrow correctness fix for the live submission gate. It keeps GitHub issue data as the fallback, but when API payability data is present it makes the state and awards source consistent.
adliebe
left a comment
There was a problem hiding this comment.
Reviewed current head 7141b1fffb37fd9c7d1f614ec7769ee9fb25e560. No blocker found.
This is a focused correctness fix for the live submission quality gate: when MergeWork API bounty data is available, the gate should use the API-backed bounty state for payability instead of the GitHub issue state. I checked the API-field boundary specifically because the live API returns status, while the gate internally evaluates state.
Evidence inspected:
scripts/submission_quality_gate.pylines 399-421 on this head:_load_api_bounties()reads/api/v1/bounties?status=open, filters by repo, and normalizes live APIstatusinto internalstateviaitem.get("status", "open").scripts/submission_quality_gate.pylines 495-517:_load_live_context()loads API bounties first, then sets bountystatefromapi_bounty.get("state", issue.get("state")), so the one-line change consumes the normalized API field rather than raw API JSON.- Live API readback from
https://api.mrwk.ltclab.site/api/v1/bounties?status=open&limit=1shows bounty rows exposestatus: "open"plusawards_remaining, matching the loader's normalization contract. - The added regression covers the intended stale-GitHub-state case: GitHub issue
CLOSED, API bountyopen,awards_remaining: 1, and the gate now passesbounty_payable. - GitHub current-head checks are successful:
Quality, readiness, docs, and image checksand CodeRabbit both passed for this head.
I did not rerun local pytest in this Windows workspace; this review is based on exact current-head file inspection, live API readback, the PR regression, and successful remote CI. The API status -> internal state normalization is the key path, and it is covered by the current implementation.
Summary:
statewhen live submission-gate context has an API row for a bounty.Linked bounty:
Refs #406
Evidence:
Before this fix,
_load_live_context()could build a bounty withpayability_verified: trueand APIawards_remaining: 1, but keep the GitHub issuestate: CLOSED.evaluate_submission()then failed the claim as closed/exhausted even though the API row said it was payable.Changed files:
scripts/submission_quality_gate.pytests/test_submission_quality_gate.pyTests:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_submission_quality_gate.py::test_submission_quality_gate_live_context_uses_api_state_for_payability -q-> 1 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_submission_quality_gate.py -q-> 24 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q-> 415 passeduv run --extra dev ruff check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py-> passeduv run --extra dev ruff format --check scripts/submission_quality_gate.py tests/test_submission_quality_gate.py-> 2 files already formatteduv run --extra dev mypy app scripts/submission_quality_gate.py-> successPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py-> docs smoke okgit diff --check-> cleanOut of scope:
Summary by CodeRabbit
Bug Fixes
Tests