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.
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