You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request improves GitHub contributor fallback handling by ensuring automated accounts are excluded from citation authors and eligible human contributors are identified more reliably.
Changes
Improved automated account detection to identify additional AI-assisted coding accounts and bots, including Copilot, Gemini, ChatGPT, OpenAI, and Cursor.
Updated contributor fallback logic to include eligible human contributors rather than limiting the results based on the raw GitHub contributor list.
Added support for anonymous commit authors through the GitHub Contributors API.
Improved commit-history scanning to identify contributors who may not appear in the initial contributor results.
Added pagination support for commit-history requests when an authentication token is available.
Updated author visibility in the metadata form so all authors are displayed by default.
Improved author filtering to exclude automated accounts and unusable GitHub username-like values.
Expands automated-account filtering and contributor discovery.
Adds pagination and historical commit-author scanning.
Updates author visibility, tests, examples, and documentation.
File summaries
File
Summary
Findings
tests/services/githubImporter.test.js
Adds regression coverage
Fixtures require updates for the new request shape.
src/services/githubImporterContributors.js
Filters and discovers contributors
Moderate (3 votes): fallback limits are no longer honored.
src/services/githubImporter.js
Integrates historical authors
Critical (1 vote): existing fixtures fail with per_page=100 URLs. Moderate (1 vote): commit-history authors override established contributor ordering.
src/services/githubApi.js
Adds pagination and anonymous-author parameters
No review findings.
src/services/github.examples.js
Updates importer examples
Nit (1 vote): rename the misleading exampleCustomContributorLimit export.
src/components/MetadataForm.jsx
Shows all authors by default
No review findings.
src/App.jsx
Removes fallback-limit configuration
No review findings.
README.md
Documents contributor behavior
No review findings.
Review details
Suppressed comments (2)
src/services/github.examples.js:84
This example is still exported as exampleCustomContributorLimit, but the updated body no longer demonstrates or accepts a custom limit. The name now misleads callers about what the example does; rename the example (and any references) to describe contributor fallback authors instead.
* Example: Contributor fallback authors
* Includes all eligible human contributors when repository metadata has no authors.
*/
export async function exampleCustomContributorLimit() {
try {
const repoUrl = 'https://github.com/imageomics/OpenCite';
const { metadata, warnings } = await importGithubMetadata(repoUrl);
src/services/githubImporter.js:743
orderAuthorsByContributorRank ranks authors by their position in contributorLookupAuthors; prepending commitAuthors here lets commit-history order override the existing co-author/contributor ranking. For a repository whose recent commit author is not the highest-ranked contributor, this changes the documented contributor ordering. Append the new commit-history entries after the existing lookup list so the prior ordering remains authoritative.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Address stale test mocks, unbounded API scans, and overly broad display-name filtering.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
src/services/githubImporterContributors.js:226
When an authentication token is present, maxPages is null, so a long repository history is scanned one 100-commit request at a time until the end. A single import can therefore issue thousands of requests, consume the token's rate limit, and remain slow or fail; authenticated scans still need a finite safety cap and a warning when that cap is reached.
src/services/githubImporter.js:553
This request-size change leaves several importer test fixtures matching only commits?per_page=1&sha=main (for example tests/services/githubImporter.test.js:759, 839, 898, 1087, 1671, 1817, and 1910). The importer now requests per_page=100, so those tests fall through to Unexpected fetch URL before exercising the behavior; update all remaining mocks to accept the new URL (or make the mock branch accept both).
This applies the username heuristic to a verified GitHub profile display name, so legitimate human names such as Anne-Marie or McDonald are discarded merely because they contain a hyphen or camel case, even when they differ from the login. Use the profile/login relationship to reject unusable handles without filtering valid display-name punctuation and casing.
if (profile?.name && !matchesGithubLoginName(profile.name, login, cleanString) && !isLikelyGithubUsername(profile.name, cleanString)) {
Retain a maximum cap for contributor fallback requests
src/services/githubImporterContributors.js:218
This removes the previous upper safety bound, so a caller can pass a very large finite contributorFallbackLimit and make the importer paginate through and concurrently profile an unbounded number of GitHub accounts. That can exhaust API rate limits and memory; keep a documented maximum (for example the default 50) when normalizing the option.
This issue also appears on line 341 of the same file.
Apply fallback limit after profile eligibility filtering
src/services/githubImporterContributors.js:199
This cap is applied before the profile requests below determine whether a contributor has a usable human name or is automated by its profile name. Such entries still count toward contributors.length, so a repository with an unusable/late-detected account in the first page can stop pagination and return fewer than the requested number of eligible fallback authors even when later pages contain valid people. Apply the limit after profile eligibility is resolved, or continue fetching pages until the cap is reached by actual fallback authors.
Assert anonymous contributors are imported within the limit
tests/services/githubImporter.test.js:116
Although this fixture includes an anonymous contributor, the fallback limit is 2 and the expected result only contains Alice and Bob, so Dana Anonymous is never asserted as an imported author. A regression that drops the anonymous-record branch would still pass; add an assertion (or a focused case) where an anonymous record falls within the fallback limit.
Preserve null sentinel for unlimited contributor fallback
src/services/githubImporterContributors.js:248
This changes the established null/empty option behavior: resolveContributorFallbackLimit previously returned null to disable the cap, and the fallback code below still contains an unlimited branch for that sentinel. Converting these values to 50 silently caps callers that request an unlimited fallback and makes that branch unreachable; preserve the sentinel through candidate selection/slicing or explicitly remove and document the public behavior change.
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
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
Closes #56
This pull request improves GitHub contributor fallback handling by ensuring automated accounts are excluded from citation authors and eligible human contributors are identified more reliably.
Changes
Testing
Related Issue
Closes #56