fix: keep bounty verifier star errors shaped#4881
Conversation
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
saim256
left a comment
There was a problem hiding this comment.
I reviewed the verifier error-path change and the added regression coverage. The fix keeps verify_stars() returning the same report shape on GithubException, which prevents generate_report() from failing on missing count/is_star_king/repos keys when GitHub rate limits or API failures occur.
Validation performed locally:
python -m pytest tools\bounty-bot-pro\tests\test_verifier.py -q-> 2 passedpython -m py_compile tools\bounty-bot-pro\verifier.py tools\bounty-bot-pro\tests\test_verifier.py-> syntax OK; existing invalid-escape warning on the wallet markdown string remains non-blockinggit diff --check origin/main...pr-4881-> passedpython tools\bcos_spdx_check.py --base-ref origin/main-> OK
No blocking issues found.
loganoe
left a comment
There was a problem hiding this comment.
Reviewed the verifier error-shape fix and the new focused tests. The change preserves the report contract by returning count/is_star_king/repos even when PyGithub raises, and the generated-report path now has regression coverage around reward inputs. Verified with: PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -q tools/bounty-bot-pro/tests/test_verifier.py (2 passed; existing verifier SyntaxWarning remains unrelated).
508704820
left a comment
There was a problem hiding this comment.
Code Review: Keep Bounty Verifier Star Errors Shaped
Summary
Adds 93-line test file for the bounty verifier tool with stub-based module loading. Tests star/PR verification with mocked GitHub and Google API dependencies.
What Works Well
- Stub module loading: Creates mock github and google modules for testing without real API calls
- 93 lines: Good coverage of verifier logic
- importlib.util: Clean module loading pattern
Verdict: Approve
Good test coverage for the bounty verification tool with proper dependency mocking.
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM.
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM.
loganoe
left a comment
There was a problem hiding this comment.
Approved. The change keeps verify_stars() error returns compatible with generate_report() by preserving the count, is_star_king, and repos keys on the GithubException path, and the new offline tests cover both the failure shape and the report calculation path.
Validation performed: git diff --check origin/main...HEAD, PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest -q tools/bounty-bot-pro/tests/test_verifier.py, and python3 -m py_compile tools/bounty-bot-pro/verifier.py tools/bounty-bot-pro/tests/test_verifier.py all pass. The compile/test run still emits the pre-existing invalid-backtick escape warning in verifier.py, which is outside this patch's changed line.
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix.
**Verdict: Approve.
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix. Addresses the issue correctly.
**Verdict: Approve.
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix. Addresses the issue correctly.
**Verdict: Approve.
jaxint
left a comment
There was a problem hiding this comment.
LGTM! Thanks for contributing. Approved.
TJCurnutte
left a comment
There was a problem hiding this comment.
Verified review
Approved for PR #4881 at head f3600bb5494fad86a3255bcb386aca4ceb2dc1e8.
I inspected the PR metadata/diff for: fix: keep bounty verifier star errors shaped.
Changed scope: tools/bounty-bot-pro/tests/test_verifier.py (+93/-0), tools/bounty-bot-pro/verifier.py (+6/-1).
Local validation
git diff --check origin/main...HEAD— passpython3 tools/bcos_spdx_check.py --base-ref origin/main— passpython3 -B -m py_compile tools/bounty-bot-pro/tests/test_verifier.py tools/bounty-bot-pro/verifier.py— passpython3 -B -m pytest tools/bounty-bot-pro/tests/test_verifier.py -q— passadded-line secret pattern scan— pass
Review reasoning
- The diff is focused on the stated security/validation/bugfix scope and is small enough to review in this bounty tick.
- Whitespace, SPDX, syntax/static, and added-line secret checks passed for this exact head.
- I did not find a blocker in the changed files or validation output.
Boundary: this review certifies the current diff/head only; payout/merge is not assumed.
himanalot
left a comment
There was a problem hiding this comment.
Reviewed tools/bounty-bot-pro/verifier.py and the new offline tests. verify_stars() now returns the same report shape on GithubException as on success (count, is_star_king, and repos), which prevents the report path from turning transient GitHub errors into KeyErrors. The tests stub GitHub/Gemini/dotenv dependencies and cover both the failure shape and generated report reward inputs.
I do not see a blocking issue in this patch. Approved.
PR Review — Standard Quality ✓PR: #4881 — Fix bounty verifier star errors shaped What I reviewed
Observations
LGTM. Bounty: #2782 |
Summary
verify_stars()error responses shaped like successful responsesis_star_kingandrepostest_verifier.pyplaceholder with offline unit tests that stub GitHub/Gemini/dotenv dependenciesRoot cause
generate_report()expectsverify_stars()to returncount,is_star_king, andrepos. OnGithubException,verify_stars()returned onlyerrorandcount, so transient GitHub API failures could turn the verifier report path into aKeyError.Validation
python -m pytest tools\bounty-bot-pro\tests\test_verifier.py -q-> 2 passedpython -m py_compile tools\bounty-bot-pro\verifier.py tools\bounty-bot-pro\tests\test_verifier.py-> passed; emits the existing markdown-backtick SyntaxWarning already covered by separate open PRsgit diff --check -- tools\bounty-bot-pro\verifier.py tools\bounty-bot-pro\tests\test_verifier.pypython tools\bcos_spdx_check.py --base-ref origin/main