fix(ci): use search API for first-time contributor detection#524
Merged
mchmarny merged 2 commits intoNVIDIA:mainfrom Apr 10, 2026
Merged
fix(ci): use search API for first-time contributor detection#524mchmarny merged 2 commits intoNVIDIA:mainfrom
mchmarny merged 2 commits intoNVIDIA:mainfrom
Conversation
Both the issue and PR steps in the welcome workflow used paginated list endpoints (issues.listForRepo, pulls.list) that only inspect the first page (~30 items). On high-traffic repos this causes false positives (returning contributors re-welcomed) or false negatives (first-timers missed). Switch both steps to search.issuesAndPullRequests with author filtering, which returns an accurate total_count across all results.
289d21a to
d6f8a2c
Compare
mchmarny
approved these changes
Apr 10, 2026
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
Use the GitHub Search API for first-time contributor detection in the welcome workflow, replacing paginated list endpoints that only checked the first ~30 results.
Motivation / Context
Both the issue step (
issues.listForRepo) and PR step (pulls.list) used paginated list endpoints without iterating pages, defaulting to ~30 results per page. On high-traffic repos this causes false positives (returning contributors re-welcomed) or false negatives (first-timers missed).Fixes: N/A
Related: #488
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/api,pkg/server)pkg/recipe)pkg/bundler,pkg/component/*)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/).github/workflows/welcome.yaml)Implementation Notes
Replaced both
github.rest.issues.listForRepo(issue step) andgithub.rest.pulls.list(PR step) withgithub.rest.search.issuesAndPullRequestsusingtype:issue author:<login>andtype:pr author:<login>queries respectively. The search API returnstotal_countacross all results, eliminating the pagination limitation.Residual risk: The search API indexes asynchronously, so in rare cases a just-opened issue/PR may not yet appear in search results, causing the welcome message to be silently skipped. This is unlikely in practice and the impact is cosmetic only (missed welcome comment).
Testing
Risk Assessment
Rollout notes: N/A
Checklist
make testwith-race)make lint)git commit -S) — GPG signing info