Repository navigation
Fail when the WordPress.org account lookup fails - #316
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The change adds explicit handling for unsuccessful WordPress.org responses, regression coverage, and the regenerated bundle, with no active review issues identified.
No open issues 🎉
What changed in this PR
Updates the WordPress.org account lookup to fail the action when the API returns an unsuccessful HTTP response, preventing contributors from being incorrectly reported as unlinked.
Changes:
- Added HTTP response validation and descriptive errors for failed lookups.
- Added regression coverage and updated fetch mocks.
- Regenerated the bundled action entry point.
| File | Description |
|---|---|
| tests/contribution-collector.test.mjs | Adds regression coverage for failed WordPress.org lookups and updates response mocks. |
| src/utils.js | Throws a descriptive error when the WordPress.org lookup returns an unsuccessful response. |
| dist/index.js | Includes the bundled implementation of the updated lookup failure handling. |
Review effort: Lite
The lookup's error response was read as data, so no GitHub user matched a WordPress.org account. Every contributor was then listed as unlinked, without a warning. The lookup rejects requests with more than 100 entries this way, which a branch with a broken rebase reached in WordPress/gutenberg#84609. A failed lookup now fails the run, as a network error already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
obenland
force-pushed
the
fix/wporg-lookup-errors
branch
from
November 30, 2026 19:49
d603a2c to
79bf606
Compare
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.
When the WordPress.org account lookup returned an error, Props Bot read the error response as data. No GitHub user matched a WordPress.org account, so every contributor was listed as unlinked, and the log showed no warning.
That happened in WordPress/gutenberg#84609 (props comment). After a broken rebase, its branch carried 1,251 commits, and the lookup got about 140 entries. The lookup rejects more than 100 with
HTTP 400 rest_invalid_param: 100 entries get a 200, 101 get a 400. Sent on their own, the same 78 usernames resolve normally.A failed lookup now fails the run, as a network error already does, instead of producing a props list that leaves out the WordPress.org usernames of everyone credited.
Batching requests to stay under 100 entries isn't part of this. Reaching that many on a normal pull request is unlikely.
🤖 Generated with Claude Code