Clean up MCP bounty selector reuse#882
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)
📝 WalkthroughWalkthroughRefactors submit_work_proof bounty selector handling: adds has_bounty_selector(), extends selected_bounty(require_selector=False) to return None, unifies submit_work_proof resolution via selected_bounty("bounty_id", require_selector=False), and adds tests for selector parity and validation. Changessubmit_work_proof bounty selector refactor
Possibly related issues
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 |
xiefuzheng713-alt
left a comment
There was a problem hiding this comment.
Approved for current head d1f918f0a4d7978d1fc9b55bf01c8dca3ee029b2.
I reviewed app/mcp_tools.py, tests/test_mcp_tools.py, and the existing submit-work-proof coverage in tests/test_api_mcp.py. The refactor reuses the shared selected_bounty() selector for submit_work_proof while keeping the generic no-selector path separate via require_selector=False. The existing selector validation is still applied for mixed bounty_id/issue_number, repo-without-issue, repo scoping, ambiguous issue numbers, non-positive ids, and unknown bounty selectors.
Validation I ran locally:
uv run --python 3.12 --extra dev python -m pytest tests/test_mcp_tools.py tests/test_api_mcp.py -q-> 116 passed, 1 existing Starlette/httpx warning.uv run --python 3.12 --extra dev ruff check app/mcp_tools.py tests/test_mcp_tools.py tests/test_api_mcp.py-> passed.uv run --python 3.12 --extra dev ruff format --check app/mcp_tools.py tests/test_mcp_tools.py tests/test_api_mcp.py-> 3 files already formatted.uv run --python 3.12 --extra dev mypy app/mcp_tools.py-> success.git diff --check-> clean.git merge-tree --write-tree origin/main HEAD-> clean tree9b6cf0918a1954c3ae3910443c2deaf2110e36df.
I also rechecked GitHub state before approving: this is not my PR, there were no prior human reviews on this head, mergeStateStatus=CLEAN, and the hosted Quality/readiness/docs/image check is successful. Scope is limited to MCP bounty selector reuse and regression coverage; I did not see ledger, wallet, treasury, payout, admin-token, exchange/bridge/cash-out, private-data, or MRWK price behavior changes.
alan747271363-art
left a comment
There was a problem hiding this comment.
Reviewed current head d1f918f0a4d7978d1fc9b55bf01c8dca3ee029b2 again after the PR changed from the earlier clean approval state to current mergeStateStatus=DIRTY / mergeable=CONFLICTING.
Requesting changes because the branch-local MCP bounty selector reuse still validates, but the PR is now blocked by a current-main content conflict in app/mcp_tools.py. The hosted checks are green on the PR head, but they predate the current-main conflict and do not make the branch mergeable now.
Validation on this exact head:
.\.venv\Scripts\python.exe -m pytest tests/test_mcp_tools.py tests/test_api_mcp.py -q-> 116 passed, 1 existing Starlette/httpx warning..\.venv\Scripts\python.exe -m ruff check app/mcp_tools.py tests/test_mcp_tools.py tests/test_api_mcp.py-> passed..\.venv\Scripts\python.exe -m ruff format --check app/mcp_tools.py tests/test_mcp_tools.py tests/test_api_mcp.py-> 3 files already formatted..\.venv\Scripts\python.exe -m mypy app/mcp_tools.py-> success..\.venv\Scripts\python.exe scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree $(git rev-parse origin/main) HEAD-> failed with a content conflict inapp/mcp_tools.py;tests/test_mcp_tools.pyauto-merged.
Suggested next step: rebase or merge current main, resolve app/mcp_tools.py, then rerun the MCP API/tool tests plus ruff/mypy/docs smoke checks before merge.
Scope reviewed: MCP bounty selector reuse in app/mcp_tools.py and focused tool/API coverage only. No wallet material, ledger mutation, treasury/proposal execution, payout execution, admin-token behavior, private data, credentials, bridge/exchange/cash-out behavior, or MRWK price behavior was used.
…cp-selector-cleanup # Conflicts: # app/mcp_tools.py
|
Resolved the current-main conflict reported in the changes-requested review by merging Validation on head
Hosted CI is green on the new head; CodeRabbit was still pending when checked. |
mauricemohr88-debug
left a comment
There was a problem hiding this comment.
Reviewed current head b74c491285db04a889b0966e0e17e2917c6d300a.
I inspected the submit_work_proof selector refactor in app/mcp_tools.py and the focused regression coverage in tests/test_mcp_tools.py. The change removes the duplicated bounty-selection path and reuses selected_bounty("bounty_id", require_selector=False) so bounty_id, issue_number, optional repo, selector conflicts, repo-without-issue, and unknown bounty behavior stay centralized. The separate has_bounty_selector() check preserves the intended split between generic no-selector guidance and explicit-but-unknown selectors returning bounty not found.
Validation I ran locally on this head:
uv run --python 3.12 --extra dev python -m pytest tests/test_mcp_tools.py tests/test_api_mcp.py -q-> 135 passed, 1 existing Starlette/httpx warning.uv run --python 3.12 --extra dev ruff check app/mcp_tools.py tests/test_mcp_tools.py tests/test_api_mcp.py-> passed.uv run --python 3.12 --extra dev ruff format --check app/mcp_tools.py tests/test_mcp_tools.py tests/test_api_mcp.py-> 3 files already formatted.uv run --python 3.12 --extra dev mypy app/mcp_tools.py-> success.uv run --python 3.12 --extra dev python scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean treed7936c4541ddd7762f67ad3bab62c2deaf2110e36df.
GitHub state checked before review: this is not my PR, current head has no human review yet, hosted Quality/readiness/docs/image check is successful, and CodeRabbit is still pending, which appears to be why mergeStateStatus remains UNSTABLE. I do not see a code blocker from local review, but I would still wait for the pending CodeRabbit status before merge.
Scope reviewed: MCP bounty selector reuse and focused API/tool regression coverage only. No wallet material, ledger mutation, treasury mutation, payout execution, admin-token behavior, private data, credentials, exchange, bridge, cash-out, or MRWK price behavior was used.
heickerv1001-dev
left a comment
There was a problem hiding this comment.
Bounty #838 finding on PR #882: submit_work_proof no longer rejects mixed selectors. In app/mcp_tools.py, the old if has_bounty_id and has_issue_number: raise ValueError("use bounty_id or issue_number, not both") check was removed, but the new selected_bounty(..., require_selector=False) path now returns the bounty_id match immediately when both bounty_id and issue_number are present. That means issue_number is silently ignored instead of surfacing the validation error that tests/test_mcp_tools.py still expects. This is a real behavior regression, not just a docs mismatch.
|
Rechecked current head The
Validation on current head:
So I do not see the claimed silent-ignore regression on the current PR head. |
Errordog2
left a comment
There was a problem hiding this comment.
Reviewed the MCP bounty selector reuse cleanup.
Validation performed locally:
.venv\Scripts\python.exe -m pytest tests/test_mcp_tools.py-> 13 passed.venv\Scripts\python.exe -m pytest tests/test_mcp_work_proof.py-> 8 passed.venv\Scripts\python.exe -m ruff check app/mcp_tools.py tests/test_mcp_tools.py-> passed.venv\Scripts\python.exe -m ruff format --check app/mcp_tools.py tests/test_mcp_tools.py-> passed.venv\Scripts\python.exe -m mypy app/mcp_tools.py app/mcp_work_proof.py-> passedgit diff --check-> passedgit merge-tree $(git merge-base origin/main HEAD) origin/main HEAD-> clean merge
The refactor keeps the generic submit_work_proof path intact, returns bounty not found when a provided selector misses, and centralizes the id/issue/repo validation through the shared selector helper. Looks good to me.
|
Closing this unmerged for the current queue pass. The referenced bounty #846 is filled and closed, so this PR is not payable from that round. The successor cleanup round #936 is still a pending |
Refs #846
Summary
Validation
No private data, credentials, wallet material, production mutation, proposal execution, payout/proof/ledger behavior, balance, exchange, bridge, cash-out, price behavior, or fabricated payout claims used.
Summary by CodeRabbit
Bug Fixes
Tests