fix(airdrop): scope _determine_tier to org merged PRs (fixes #8184) - #8226
Open
jjb9707 wants to merge 1 commit into
Open
fix(airdrop): scope _determine_tier to org merged PRs (fixes #8184)#8226jjb9707 wants to merge 1 commit into
jjb9707 wants to merge 1 commit into
Conversation
…#8184) _determine_tier queried /search/commits with `author:<user> merged:true`, which counts the claimant's commits anywhere on GitHub. Any established account reached CORE (200 wRTC) without contributing to RustChain. Switch to /search/issues with `author:<user> org:Scottcjn is:pr is:merged` so the tier reflects actual RustChain contributions. Adds a regression test asserting the contribution query is scoped to the org.
Contributor
|
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_determine_tier()decided an airdrop claimant's tier — up to CORE = 200 wRTC — from GitHub activity queried withauthor:<user> merged:trueagainst/search/commits. That counts the user's commits anywhere on GitHub, so any established account reached CORE without ever contributing to RustChain (see #8184).Root cause
/search/commits?q=author:<user> merged:true— noorg:/repo:scope, andmerged:trueis a PR-search qualifier sent to the commits endpoint.total_prsreflected "is this a real GitHub user with history", not "did they contribute here".Fix
Switch to the issues search scoped to the org and to merged PRs:
The tier now reflects actual RustChain contributions, paired with the airdrop's existing per-account/per-wallet dedup.
Verification
test_eligibility_with_mock_githubto match the new/search/issuesendpoint.test_determine_tier_scoped_to_orgregression test asserting the query is scoped (org:Scottcjn,is:pr,is:merged) and no longer uses the unscopedmerged:truequalifier, and that 5 org-merged PRs => CORE.python -m unittest test_airdrop_v2— 32 passed.Fixes #8184.