Skip to content

pr-build-zip: optional 'Try this PR in a live test site' link (central enrolment) - #119

Merged
lihsaa591 merged 4 commits into
masterfrom
feat/pr-preview-link
Oct 9, 2026
Merged

lihsaa591 merged 4 commits into
masterfrom
feat/pr-preview-link

Conversation

@lihsaa591

Copy link
Copy Markdown
Contributor

Summary

The PR build comment can now include a link that opens a fresh WordPress (Playground, in the browser) with that PR's build installed and activated, logged in as admin. Aimed at QA verification and at support reproducing issues.

  • No change in the ~90 caller repos. Repos are enrolled centrally in config/preview-link-repos.json. A repo not listed gets no link and no behaviour change. Enrolled today: only themegrill/user-registration.
  • Why not on by default for everyone: about 47 of 88 repos are add-ons (33, need their base plugin) or *-pro (14, open unlicensed), and themes need type: theme. A link that looks right but fails is worse than none. preview-link: true|false and preview-* inputs let a caller override.
  • Cannot break the build comment: the new steps are continue-on-error; the script validates every value (the link is posted to a PR) and exits 0 with no output for non-enrolled repos.
  • Only the primary ZIP is previewed. Link and zip expire together (~30 days).

One-time infra change (already done)

themegrill-pr-artifacts CORS now allows GET, HEAD from https://playground.wordpress.net. Verified: that origin is allowed, another origin is rejected.

Testing

  • npm test: 68/68 (new: link builder + validation, enrolment resolution, running the script the way the workflow does).
  • Real run: throwaway branch in themegrill/user-registration (caller changed only to @feat/pr-preview-link + preview-tools-ref), manual dispatch -> success; link generated from that run's zip (HEAD 200, correct CORS); the real "Compose comment body" step rendered locally shows the link in the comment. Branch deleted.
  • A person opened a generated link: plugin installs and activates.

Not verified

  • A live build of a NON-enrolled repo (covered by unit tests only).
  • requires (base-plugin install) and type: theme in a browser.
  • Because this edits a workflow shared by ~90 repos, a mistake would break every build. That is why the real run above was done before this PR; the sparse tooling checkout adds a few seconds to every build.

Docs

CHANGELOG entry; onboard-pr-build-zip-repo skill has an enrolment/testing section.

@lihsaa591
lihsaa591 merged commit d76736f into master Oct 9, 2026
2 checks passed
@lihsaa591
lihsaa591 deleted the feat/pr-preview-link branch October 9, 2026 10:31
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.

1 participant