Share submission requirement action construction#917
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)
📝 WalkthroughWalkthroughThis PR refactors action dictionary construction in ChangesAction construction refactoring
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 |
szx19970521
left a comment
There was a problem hiding this comment.
Reviewed current head 86cc78e for #838.
This is a behavior-preserving maintainability refactor. I inspected app/submission_requirements.py and tests/test_mcp_work_proof.py and verified that _next_action() centralizes the existing action dictionary shape while preserving the same ids, required flags, and text for open/full/closed/unknown availability paths and issue-vs-PR submission modes. The new test locks the open PR/evidence ordering and representative text for confirm_award_slot and include_bounty_reference.
Validation performed locally on this exact head:
` ext
python -m pytest tests/test_mcp_work_proof.py tests/test_api_mcp.py::test_mcp_submit_work_proof_returns_structured_bounty_guidance tests/test_api_mcp.py::test_mcp_submit_work_proof_returns_structured_generic_guidance tests/test_api_mcp.py::test_mcp_submit_work_proof_structures_terminal_bounty_availability -q
12 passed, 1 existing warning
python -m pytest tests/test_mcp_work_proof.py tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_api_mcp.py -q
145 passed, 1 existing warning
python -m ruff check app/submission_requirements.py tests/test_mcp_work_proof.py
All checks passed
python -m ruff format --check app/submission_requirements.py tests/test_mcp_work_proof.py
2 files already formatted
python -m mypy app/submission_requirements.py
Success: no issues found in 1 source file
python scripts/docs_smoke.py
docs smoke ok
`
GitHub state checked before approval: mergeable=true, CodeRabbit success, and no prior human review on this head. I did not see a hosted Quality check run for this PR head, so this approval relies on the local validation above plus the successful CodeRabbit pre-merge checks. No blocker found.
NiXouuuu
left a comment
There was a problem hiding this comment.
Current-head review for 86cc78e. I inspected app/submission_requirements.py and tests/test_mcp_work_proof.py. The _next_action helper preserves the id/required/text action shape for open/full/closed/unknown availability, issue mode, and PR/evidence mode; the new test locks open PR/evidence action ordering plus representative confirm_award_slot and include_bounty_reference text. Local validation on this head: focused pytest -> 12 passed, 1 existing Starlette/httpx warning; tests/test_mcp_work_proof.py -> 9 passed; ruff check app/submission_requirements.py tests/test_mcp_work_proof.py -> passed; ruff format --check app/submission_requirements.py tests/test_mcp_work_proof.py -> 2 files already formatted; mypy app/submission_requirements.py -> success; python scripts/docs_smoke.py -> docs smoke ok; git diff --check origin/main...HEAD -> clean; git merge-tree origin/main HEAD -> clean tree bc3fbdda2d6aa283a9aff3365ef91c355aded568. GitHub state checked: mergeable=true, CodeRabbit status success/review skipped, no hosted check-runs exist on this head, so mergeStateStatus remains UNSTABLE because the standard quality workflow did not run. No blockers found in the focused maintainability refactor.
Errordog2
left a comment
There was a problem hiding this comment.
Reviewed the submission requirement action-construction refactor.
Validation performed locally:
.venv\Scripts\python.exe -m pytest tests/test_mcp_work_proof.py -k "submission_requirements or work_proof_guidance_json or generic_work_proof_guidance"-> 8 passed.venv\Scripts\python.exe -m ruff check app/submission_requirements.py tests/test_mcp_work_proof.py-> passed.venv\Scripts\python.exe -m ruff format --check app/submission_requirements.py tests/test_mcp_work_proof.py-> passed.venv\Scripts\python.exe -m mypy app/submission_requirements.py app/mcp_work_proof.py-> passedgit diff --check-> passedgit merge-tree $(git merge-base origin/main HEAD) origin/main HEAD-> clean merge
The helper removes repeated action dictionaries while preserving the existing open/full/closed/unknown and issue/pr submission action ordering. The new open PR-mode test covers the important default path. Looks good to me.
Summary
_next_action()helper for submission requirement action dictionariesBounty
Bounty #846
Duplicate/scope check
app/submission_requirements.py.submission_requirements.py+next_actionsandwork_proof_submission_requirements+next_actionsreturned no same-scope open PR.Validation
.\.venv\Scripts\python.exe -m pytest tests\test_mcp_work_proof.py tests\test_api_mcp.py::test_mcp_submit_work_proof_returns_structured_bounty_guidance tests\test_api_mcp.py::test_mcp_submit_work_proof_returns_structured_generic_guidance tests\test_api_mcp.py::test_mcp_submit_work_proof_structures_terminal_bounty_availability -q-> 12 passed, 1 existing Starlette/httpx warning..\.venv\Scripts\python.exe -m pytest tests\test_mcp_work_proof.py tests\test_serializers.py tests\test_bounty_api_routes.py tests\test_api_mcp.py -q-> 145 passed, 1 existing Starlette/httpx warning..\.venv\Scripts\python.exe -m pytest -q-> 791 passed, 1 existing Starlette/httpx warning..\.venv\Scripts\python.exe -m ruff check .-> passed..\.venv\Scripts\python.exe -m ruff format --check .-> 111 files already formatted..\.venv\Scripts\python.exe -m mypy app-> success across 42 source files..\.venv\Scripts\python.exe scripts\docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean treebc3fbdda2d6aa283a9aff3365ef91c355aded568.Scope
Maintainability-only helper extraction in
app/submission_requirements.pyplus focused tests. No public submission-requirements text, bounty lifecycle behavior, ledger behavior, wallet behavior, treasury behavior, payout behavior, proposal execution, admin-token behavior, private data, exchange, bridge, cash-out, or MRWK price behavior changed.Summary by CodeRabbit
Refactor
Tests