Skip to content

Fail when the WordPress.org account lookup fails - #316

Merged
obenland merged 1 commit into
WordPress:trunkfrom
obenland:fix/wporg-lookup-errors
Nov 30, 2026
Merged

obenland merged 1 commit into
WordPress:trunkfrom
obenland:fix/wporg-lookup-errors

Conversation

@obenland

Copy link
Copy Markdown
Member

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

Copilot AI lite review requested due to automatic review settings November 30, 2026 17:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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
obenland force-pushed the fix/wporg-lookup-errors branch from d603a2c to 79bf606 Compare November 30, 2026 19:49
@obenland
obenland merged commit 4685578 into WordPress:trunk Nov 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants