[Website] Fix plugin-proxy artifact lookup for busy repos#3211
[Website] Fix plugin-proxy artifact lookup for busy repos#3211
Conversation
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.
adamziel
left a comment
There was a problem hiding this comment.
If the API response is sorted by "most recent", this is good to go
getdave
left a comment
There was a problem hiding this comment.
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 🚀
|
Merging and deploying to help the users impacted by this. Let's still confirm the API endpoint returns the most recent runs first |
Motivation for the change, related issues
The plugin-proxy was failing with
artifact_not_foundwhen 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=trunktries to fetch the build artifact using a URL like this: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:
/repos/{org}/{repo}/actions/workflows/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:
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"}.