Skip to content

Add a "Test the build" comment to pull requests - #588

Merged
rtio merged 4 commits into
trunkfrom
add/test-the-build-pr-comment
Nov 12, 2026
Merged

rtio merged 4 commits into
trunkfrom
add/test-the-build-pr-comment

Conversation

@rtio

@rtio rtio commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Will this change require new documentation or changes to existing documentation?

Changes proposed in this Pull Request:

To try a pull request you had to check out the branch and build it. A workflow now builds the zip on each pull request and posts a "Test the build" comment with two WordPress Playground previews, which cannot connect to Square; fork pull requests get it in the run summary. Jetpack Beta and Jurassic Ninja are not included, because the plugin is not registered with the Jetpack Beta Builder.

Steps to test the changes in this Pull Request:

  1. Wait for the "Test the build" comment.
  2. Open both Playground links: one opens WooCommerce > Settings > Square, the other the Square onboarding wizard. Products lists a "Sample product".
  3. Push a commit. The same comment is updated.

Changelog entry

Dev - Add a "Test the build" comment with WordPress Playground previews to pull requests.

🤖 Generated with Claude Code

Closes #589

rtio and others added 3 commits November 12, 2026 09:42
Trying the code of a pull request meant checking the branch out and
running the build locally. The only workflow that builds an installable
zip, generate-zip.yml, runs on demand or for QIT, and nothing told a
reviewer where to get its output. A reviewer without a development
environment, a designer for example, had no way in at all.

Build the zip on every pull request and post one comment, updated on
each push, with the ways to try that build:

- WordPress Playground: two links that open a store with WooCommerce
  and the build in the visitor's browser, one on the Square settings
  and one on the onboarding wizard. The Blueprint skips WooCommerce's
  setup wizard, opens the store, turns HPOS on and adds a sample
  product, so there is nothing to do by hand first. Signing in to
  Square has to redirect back to the site, and a site in a browser tab
  has no public address, so the comment says the previews cannot
  connect, take payments, sync products or receive webhooks.
- Jetpack Beta and Jurassic Ninja: both are served by the Jetpack Beta
  Builder, which only takes builds from plugins registered with it.
  This plugin is not registered yet, so those two options and the
  webhook call are left out until the SQUARE_LIVE_BRANCH_SECRET secret
  exists. Nothing else has to change once it does. Jurassic Ninja
  redirects its create URL to its homepage for visitors who are not
  logged in, so that option says to log in first.

The work is split in two jobs. The first runs the pull request's build
scripts and its dependencies' install scripts with a read-only token
and no secrets. The second holds the secret and the token that can
comment, and runs no code from the pull request.

Playground's artifact proxy picks a build by branch name, forks
included, so a link cannot promise whose code it runs. The Blueprints
carry no secret and the comment tells visitors not to enter Square
tokens in a preview. The preview artifact is named after the run ID, so
a link always installs the build of the run that wrote it, and is kept
for 14 days because the links download it on every click.

Pull requests from forks get a read-only token and cannot be commented
on from a pull_request workflow. Their build information goes to the
summary of the workflow run instead.

The workflow lives under .github, which is export-ignored, so nothing
here ships in the release zip.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The "Test the build" comment said under the Jurassic Ninja link that
the reader has to be logged in. Jurassic Ninja redirects its create URL
to its homepage for anyone who is not, so a reader who clicks first and
reads second lands on a page that launches nothing and has no hint why.

Say it before the link, as a warning, in the words the same comment
uses in the other Woo extensions.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The comment left Jetpack Beta and Jurassic Ninja out while the plugin
is not registered with the Jetpack Beta Builder, and renumbered
WordPress Playground as Option 1. A reader who knows the comment from
another Woo extension could not tell whether those two options were
missing by mistake, unsupported, or waiting on something.

Always write the same three options in the same order. While the
workflow has no SQUARE_LIVE_BRANCH_SECRET, Options 1 and 2 keep their
heading and say that they are not available yet and what they need,
with no link, since a link could not work.

Each option that does work now also says what its limit is for this
plugin: Jetpack Beta runs the build with the settings and the Square
connection the site already has, so it belongs on a test site; a
Jurassic Ninja site starts without a Square connection.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

This is linked to GitHub issue #589.

@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Test the build

WordPress Playground - runs in your browser

ℹ️ Neither can connect to Square: signing in to Square has to send you back to the site, and a site that runs in your browser tab has no public address to come back to. Without a connection the store cannot take payments, sync products or receive webhooks, so the previews show what a merchant sees before connecting. Do not enter Square access tokens or other credentials in a preview. The links stop working 14 days after the last build.


Build info:

  • Latest commit: 04fa8c0
  • Build time: 2026-11-12 16:53:49 UTC

Note: the build is updated when a new commit is pushed to this PR.

… the build" comment

The comment listed three options. Jetpack Beta and Jurassic Ninja were
rendered as "Not available yet", because both install a pull request's
build through the Jetpack Beta Builder and this plugin is not registered
with it. The workflow also carried the steps for them: a webhook call
behind a repository secret that does not exist, a second artifact named
for the Beta Builder, and a `-dev` folder name and `Stable tag` bump that
only the Beta Builder reads.

A section that only says an option is unavailable gives a reviewer
nothing to click, and steps wired to a missing secret are dead code.

Show only what works today: the WordPress Playground previews, under a
heading that names them instead of "Option 3". Drop the Beta Builder
steps, the extra artifact and the secret reference. The remaining
artifact now holds the zip exactly as `npm run build` produces it, so the
Blueprints install `woocommerce-square.zip`.

The two jobs stay separate: the first runs the pull request's code with a
read-only token, the second holds the token that can comment.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@rtio
rtio marked this pull request as ready for review November 12, 2026 18:13
@rtio
rtio merged commit 4369965 into trunk Nov 12, 2026
9 of 17 checks passed
@rtio
rtio deleted the add/test-the-build-pr-comment branch November 12, 2026 18:56
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.

Tracking Issue for PR #588: Add a \"Test the build\" comment to pull requests

1 participant