Share GitHub issue JSON request helper#898
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 (1)
📝 WalkthroughWalkthroughRefactored HTTP/JSON plumbing in ChangesHTTP JSON Request Plumbing
🚥 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.
Reviewed current head ad2c7d453a1e0bdf3be81a2e6dc229d62aa0fe60.
I focused on app/github_issue_finalization.py. The refactor keeps the existing _github_request() construction path, preserves the timeout=10 opener behavior, keeps empty-body JSON reads returning {}, keeps dict wrappers returning {} for non-object responses, and leaves _get_json_list() returning only dict items from list responses. The changed call sites still route POST/GET/PATCH through the same small wrappers, so this is a maintainability extraction without bounty lifecycle, label, comment, paid-finalization, ledger, wallet, or treasury behavior changes.
Validation I ran locally:
uv run --python 3.12 --extra dev python -m pytest tests/test_github_issue_finalization.py -q-> 17 passed.uv run --python 3.12 --extra dev ruff check app/github_issue_finalization.py tests/test_github_issue_finalization.py-> passed.uv run --python 3.12 --extra dev ruff format --check app/github_issue_finalization.py tests/test_github_issue_finalization.py-> 2 files already formatted.uv run --python 3.12 --extra dev mypy app/github_issue_finalization.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 tree3f2b900d8a93bca6f0637b842411d8fe8978cb05.
I also checked the open PR list for other changes touching app/github_issue_finalization.py; #898 was the only current open PR on that file. GitHub shows Quality and CodeRabbit successful and the PR merge state is CLEAN.
Bounty #846
Summary
app/github_issue_finalization.py_read_jsonwrapper while preserving empty-object fallback behavior for non-object responsesWhy this fits #846
This is a focused maintainability cleanup in one module. It reduces repeated request/open/read boilerplate across GitHub issue finalization helpers without changing bounty lifecycle semantics, labels, comments, ledger, wallet, treasury, payout, or public API behavior.
Duplicate/current check
app/github_issue_finalization.pyor this GitHub JSON request helper extraction.Validation
UV_CACHE_DIR=.uv-cache uv run pytest tests/test_github_issue_finalization.py -q-> 17 passed.UV_CACHE_DIR=.uv-cache uv run ruff check app/github_issue_finalization.py tests/test_github_issue_finalization.py-> passed.UV_CACHE_DIR=.uv-cache uv run ruff format --check app/github_issue_finalization.py tests/test_github_issue_finalization.py-> 2 files already formatted.UV_CACHE_DIR=.uv-cache uv run mypy app/github_issue_finalization.py-> success.git diff --check-> clean.No private data, credentials, wallet material, payout execution, treasury mutation, ledger mutation, bridge, exchange, cash-out, MRWK price behavior, or issue mutation was used.
Summary by CodeRabbit