Harden source validation in live bounty checker scripts (#1145)#1172
Harden source validation in live bounty checker scripts (#1145)#1172yanyishuai wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 46 minutes and 28 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
qingfeng312
left a comment
There was a problem hiding this comment.
Finding:
- [P1] Normalize formatting before this source-validation hardening PR can merge. The current head
06b7a26a494a14087f8d4297a2ef51937dfa8287passes the full pytest run (916 passed, 1 warning), but CI fails atruff format --check .. The formatter reports three files requiring reformatting:app/work_discovery.py,tests/run_safety_caps.py, andtests/test_account_validation.py. Please run the project formatter and push only the formatting delta.
Evidence checked:
- PR #1172 is open, non-draft, and authored by another account.
- Inspected the changed file list covering
app/work_discovery.py,scripts/check_bounty_issue_states.py,scripts/check_live_bounty_closing_refs.py,scripts/claim_inventory.py,tests/run_safety_caps.py, and related tests/docs. - Checked CI run
28329645698: pytest passed, thenruff format --check .failed on the three files above.
Scope boundary: review evidence only. No wallet signing, treasury mutation, payout execution, exchange, bridge, private data, credentials, or secrets involved.
06b7a26 to
4546912
Compare
4546912 to
646ebac
Compare
|
@qingfeng312 Formatting + lint fixes pushed (stacked on #983).
Latest head: |
|
@qingfeng312 CI is green on the latest head ( |
1 similar comment
|
@qingfeng312 CI is green on the latest head ( |
qingfeng312
left a comment
There was a problem hiding this comment.
Follow-up on current head 646ebac1d9f659adffd26d4bea90370fa1f62759.
The earlier formatter blocker has been resolved. I rechecked the updated source-validation changes in scripts/check_bounty_issue_states.py and scripts/check_live_bounty_closing_refs.py, along with the shared helper/test files in the stacked branch.
The source argument validation now rejects empty and whitespace-only --input/--repo values before live execution, and the valid fixture/live/fix paths remain bounded to the intended maintenance-script behavior.
Validation checked: GitHub CI Quality, readiness, docs, and image checks passed on run 28349494898; CodeRabbit status is success on this head. I did not find a remaining blocker for the scoped #1145 change.
|
@qingfeng312 Approval noted for #1145 — head The source-validation hardening is merge-ready whenever maintainers have bandwidth. |
|
@qingfeng312 Follow-up on #1145 — source-validation hardening is still green on Ready to merge whenever maintainers have bandwidth. |
Summary
--inputand--repovalues up front inscripts/check_bounty_issue_states.pyandscripts/check_live_bounty_closing_refs.py.is not None) after validation, not string truthiness.--fix requires --repo, not --inputcheck into the new validator so it surfaces a clean argparse error instead of aSystemExitmessage.Why
argparsehappily accepts""or" "for arequired=Truesource argument, and the previousif args.input:/else load_live_data(...)branches then silently selected the wrong runtime path or fell through to a rawghtraceback. The new_validate_source_argshelpers fail fast with bounded CLI errors and keep existing valid fixture / live /--fixbehavior intact.Behavior
--input "",--input " ",--repo "",--repo " ": argparse error, noghcall, no traceback.--fix --input ...: argparse error (wasSystemExit).--input path/to/fixture.json): unchanged.--repo owner/name): unchanged.--fix --repo ...: unchanged.Tests
pytest tests/): 924 passed.python scripts/check_bounty_issue_states.py --input ""and--repo " "exit witherror: --input/--repo must not be empty or whitespace-onlyand no traceback.python scripts/check_live_bounty_closing_refs.py --input " "exits with the same shape of error.Closes #1145
Solana wallet for bounty payout:
Do4v7foHJvRJLpRRoGaVPWX6DDEjX3yTK7J91gpwUQpE