Skip to content

ci: Use GH concurrency queue instead of turnstile in build.yml#49068

Open
anomiex wants to merge 1 commit into
trunkfrom
update/ci-build-replace-turnstile
Open

ci: Use GH concurrency queue instead of turnstile in build.yml#49068
anomiex wants to merge 1 commit into
trunkfrom
update/ci-build-replace-turnstile

Conversation

@anomiex
Copy link
Copy Markdown
Contributor

@anomiex anomiex commented May 21, 2026

Proposed changes

GitHub has recently added the ability to have an actual queue (max 100 entries) for its concurrency feature. This should perform better than turnstile, so let's try it out.

To make this work, we have to stop using GitHub's matrixing for the build step, because the new update_wpcom_mirrors step needs to depend on only the wpcom build and not the other parts of the matrix. So instead we have to repeat the boilerplate for each of the three parts of the matrix, and use yaml anchors to avoid repeating all the steps too.

This does dd some risk of out-of-order pushes. Say we have two trunk pushes, A and B, pushed in that order.

  • With turnstile, if B gets to update_mirrors while A is still on build, it'll wait on A. The only opportunity for B to run ahead of A is if B's once-per-minute check happens to run in between when A's build or merge_artifacts finishes and its next job (merge_artifacts or update_mirrors) gets queued.
  • With concurrency groups, it'll run them in the order that each update_mirrors is queued, with no regard for which workflow started first.

The effect of out-of-order pushes is that B's run would push a squashed A+B commit, then A's run will find nothing to do.

OTOH, on the plus side, this improves the deploy-to-Simple pipeline when there are a bunch of merges. Right now, B can't push the two plugins until A completely finishes building and pushing everything. With the concurrency queues, we can put the two push jobs into separate queues, so B can go ahead and start pushing Jetpack even if A is still working on all the non-wpcom stuff.

Related product discussion/links

p1779371671037339-slack-C05Q5HSS013

Does this pull request change what data or activity we track or use?

No

Testing instructions

  • Works in this PR?
  • Merge it in a fork, see how it works on trunk. You might have to hack the push-to-mirrors bits to not skip while also not trying to actually push.

GitHub has recently added the ability to have an actual queue (max 100
entries) for its concurrency feature. This should perform better than
turnstile, so let's try it out.

To make this work, we have to stop using GitHub's matrixing for the
`build` step, because the new `update_wpcom_mirrors` step needs to
depend on only the wpcom build and not the other parts of the matrix.
So instead we have to repeat the boilerplate for each of the three parts
of the matrix, and use yaml anchors to avoid repeating all the steps
too.

This does dd some risk of out-of-order pushes. Say we have two trunk
pushes, A and B, pushed in that order.

* With turnstile, if B gets to `update_mirrors` while A is still on
  `build`, it'll wait on A. The only opportunity for B to run ahead of A
  is if B's once-per-minute check happens to run in between when A's
  `build` or `merge_artifacts` finishes and its next job
  (`merge_artifacts` or `update_mirrors`) gets queued.
* With concurrency groups, it'll run them in the order that each
  `update_mirrors` is queued, with no regard for which workflow started
  first.

The effect of out-of-order pushes is that B's run would push a squashed
A+B commit, then A's run will find nothing to do.

OTOH, on the plus side, this improves the deploy-to-Simple pipeline
when there are a bunch of merges. Right now, B can't push the two
plugins until A completely finishes building and pushing everything.
With the concurrency queues, we can put the two push jobs into separate
queues, so B can go ahead and start pushing Jetpack even if A is still
working on all the non-wpcom stuff.
@anomiex anomiex self-assigned this May 21, 2026
@anomiex anomiex requested a review from a team as a code owner May 21, 2026 18:57
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the update/ci-build-replace-turnstile branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/ci-build-replace-turnstile
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/ci-build-replace-turnstile

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added the Actions GitHub actions used to automate some of the work around releases and repository management label May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@anomiex
Copy link
Copy Markdown
Contributor Author

anomiex commented May 21, 2026

I'm not sure I'm entirely happy with this one. It winds up with a bunch of extra skipped jobs in the PR output, that might be confusing.

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

Labels

Actions GitHub actions used to automate some of the work around releases and repository management [Pri] Normal [Status] In Progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant