Skip to content

[Website] Fix plugin-proxy artifact lookup for busy repos#3211

Merged
adamziel merged 1 commit intotrunkfrom
fix/plugin-proxy-workflow-lookup
Jan 28, 2026
Merged

[Website] Fix plugin-proxy artifact lookup for busy repos#3211
adamziel merged 1 commit intotrunkfrom
fix/plugin-proxy-workflow-lookup

Conversation

@akirk
Copy link
Member

@akirk akirk commented Jan 28, 2026

Motivation for the change, related issues

The plugin-proxy was failing with artifact_not_found when trying to fetch GitHub Actions artifacts from repositories with high workflow activity (e.g., Gutenberg).

For example, @getdave ran into this in his call for testing: https://make.wordpress.org/test/2026/01/27/call-for-testing-customizable-navigation-mobile-overlays/

Which uses this URL https://href.li/?https://playground.wordpress.net/?blueprint-url=https://gist.githubusercontent.com/getdave/6feb0e42612912a25cec599320e67766/raw/78004dc70b666b9c82c639c49340159a629788fe/blueprint-gutenberg-experiment.json&gutenberg-branch=trunk

The gutenberg-branch=trunk tries to fetch the build artifact using a URL like this:

https://playground.wordpress.net/plugin-proxy.php?org=WordPress&repo=gutenberg&workflow=Build%20Gutenberg%20Plugin%20Zip&artifact=gutenberg-plugin&branch=trunk

The issue: The proxy used the generic /repos/{org}/{repo}/actions/runs?branch={branch} endpoint which returns only 30 results by default. For repos like Gutenberg where "Props Bot" runs very frequently, it would dominate the first page of results, pushing the "Build Gutenberg Plugin Zip" workflow runs out of view.

Implementation details

Changed the artifact lookup to:

  1. First fetch all workflows from /repos/{org}/{repo}/actions/workflows
  2. Find the workflow matching the requested name
  3. Query that specific workflow's runs via /repos/{org}/{repo}/actions/workflows/{workflow_id}/runs?branch={branch}

This ensures we always find runs for the requested workflow regardless of how frequently other workflows run.

Testing Instructions (or ideally a Blueprint)

Test the plugin proxy endpoint locally:

cd packages/playground/website/public
GITHUB_TOKEN=<your-token> php -S localhost:8080

Then verify the Gutenberg artifact can be fetched:

curl 'http://localhost:8080/plugin-proxy.php?org=WordPress&repo=gutenberg&workflow=Build%20Gutenberg%20Plugin%20Zip&artifact=gutenberg-plugin&branch=trunk&verify_only'

Should return HTTP 200 instead of the previous {"error":"artifact_not_found"}.

Use workflow-specific endpoint to fetch GitHub Actions runs instead of
the generic runs endpoint. Repos with high-frequency workflows (like
Gutenberg's Props Bot) would push less frequent workflow runs out of the
first page of results, causing artifact_not_found errors.
Copy link
Collaborator

@adamziel adamziel left a comment

Choose a reason for hiding this comment

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

If the API response is sorted by "most recent", this is good to go

Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

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

I tested this locally according to instructions.

Results

###On trunk (before fix): ❌
HTTP Status: 400 Bad Request
Response: {"error":"artifact_not_found"}
Issue: The generic /actions/runs?branch=trunk endpoint returns only 30 results by default. With Gutenberg's high workflow activity (especially frequent "Props Bot" runs), the "Build Gutenberg Plugin Zip" workflow gets pushed out of the first page of results.

###On fix/plugin-proxy-workflow-lookup (after fix): ✅
HTTP Status: 200 OK
Response: Success (artifact found)
Solution: The fix first fetches all workflows, finds the specific workflow ID for "Build Gutenberg Plugin Zip", then queries only that workflow's runs. This ensures the correct workflow is always found regardless of other workflow activity.

Conclusion

LGTM 🚀

@adamziel adamziel merged commit 8a9430f into trunk Jan 28, 2026
35 checks passed
@adamziel adamziel deleted the fix/plugin-proxy-workflow-lookup branch January 28, 2026 15:08
@adamziel
Copy link
Collaborator

Merging and deploying to help the users impacted by this. Let's still confirm the API endpoint returns the most recent runs first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants