feat(playground): add main-build Playground demo alongside release demo#66
Conversation
Add a second WordPress Playground badge/link that boots the current main branch. CI's package-release job now publishes the freshly built plugin ZIP to a rolling `main-preview` pre-release on every push to main, giving live Playground a stable, CORS-reachable URL for main HEAD (git:directory is unavailable in the live runtime). The existing badge is relabeled "Release" and continues to install the latest tagged release ZIP. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66 +/- ##
=======================================
Coverage 80.80% 80.80%
=======================================
Files 44 44
Lines 3084 3084
Branches 523 523
=======================================
Hits 2492 2492
Misses 185 185
Partials 407 407 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5cf17ded9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… URLs Add scripts/check-demo-links.sh and demo-links.yml (weekly + manual) that verify each Playground demo blueprint's install URL stays reachable and hard-fail if a blueprint reintroduces the hosted-browser-broken `git:directory` resource (WordPress/wordpress-playground#3875). Not run on PRs — the structural blueprint contract is already covered by src/blueprint.test.js. Also exposed as `npm run test:demo-links`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…build-badge # Conflicts: # README.md
Address three P2 findings on PR #66's main-preview publish step: - Move publishing out of `package-release` into an isolated `publish-main-preview` job so the `contents: write` token is never present during checkout/build/package and never on pull_request or codex/** runs (package-release is now read-only). - Gate publishing behind the full required CI suite (needs: quality, phpunit, playwright-playground, psalm, package-release) so the Main-build badge can't install a build from a run that later fails. - Add a `concurrency` guard (cancel-in-progress) so a slower older run can't overwrite `main-preview` with a stale ZIP; the newest run wins. The publish job reuses the artifact package-release already validated instead of rebuilding, and the resulting main-preview asset URL is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks @codex — all three P2 findings are addressed in 17b5f18 by isolating publishing into its own job:
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17b5f1839b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Replace job-level concurrency with a branch-tip check: the publish step runs only if this commit is still `main`'s tip, so a superseded older run skips instead of overwriting `main-preview` with a stale ZIP. Correct regardless of job-scheduling order (job concurrency could cancel the newer run). - Demo Link Monitor now probes the full CORS-proxy install URL the Blueprint uses, not just the underlying GitHub asset, so a proxy outage that breaks the live demo is caught. - Repoint the README Blueprint-maintenance note at `publish-main-preview` (the job that now refreshes the pre-release), not `package-release`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Round 2 addressed in 343a63d. Fixed in code:
Already addressed in 17b5f18 (these two threads re-surfaced from round 1):
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 343a63d09e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…docs) - Collapse the main-preview publish into a single tip-checked `gh release` step so the branch-tip re-check happens immediately before writing the shared asset (minimal TOCTOU window); drop the softprops action. - Demo Link Monitor: add a `jq` preflight and fail on unparseable blueprints instead of silently treating them as "no URLs to check". - Repoint the CLAUDE.md Playground note at `publish-main-preview`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Round 3 addressed in e03fc92.
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e03fc92586
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- The publish-main-preview job has no checkout, so `gh release` commands had no repository to infer; set GH_REPO so `gh release`/`gh api` resolve the repo without a workspace git remote (would have failed at runtime). - Update SPEC.md (the authoritative Blueprint spec per AGENTS.md) to the three-Blueprint contract, adding playground/blueprint-main.json. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Round 3 findings addressed in 9f3cbbd — and thanks, the P1 was a genuine runtime bug:
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Adds a second WordPress Playground demo that boots the current
mainbranch, alongside the existing released-version demo — plus a scheduled monitor that keeps the demo links honest.Main-build demo (commit
a5cf17d)playground/blueprint-main.json(new) — installs the rollingmain-previewpre-release ZIP via the Playground CORS proxy. Live browser Playground can't usegit:directory(git:directoryinstalls fail in browser Playground with "createHash is not a function" (isomorphic-git Node variant reaching browser bundle after #3841) WordPress/wordpress-playground#3875), and Borges is a webpack-built block plugin whosebuild/is gitignored — so a source archive won't work either. A CI-built release asset is howmainHEAD boots. Mirrors the release blueprint'skitchen-sink+features.intl+networkingrequirements for the CSL formatter..github/workflows/ci.yml— thepackage-releasejob now refreshes a rollingmain-previewpre-release on every push tomain(gated torefs/heads/main; PRs unaffected). Adds minimalcontents: writepermission.README.md— adds a "Main build" Playground badge; relabels the existing badge "Release".src/blueprint.test.js— asserts the exact CORS-proxiedmain-previewURL contract.Demo Link Monitor (commit
d2fb51c)scripts/check-demo-links.sh+.github/workflows/demo-links.yml— weekly (+ manual) check that every blueprint's install URL stays reachable, and a hard fail if any blueprint reintroduces the browser-brokengit:directoryresource. Schedule/dispatch only (not on PRs; structural contract already covered bysrc/blueprint.test.js). Also exposed asnpm run test:demo-links.Docs
CHANGELOG.md,CLAUDE.md— document both blueprints and the new monitor workflow.Testing
npm test— 670 passed (2 skipped), 41 suitesnpm run lint:js— cleannpm run build— successfulaction-gh-release@v3inputs verifiednpm run test:demo-links— release link reachable;main-previewlink correctly reported dead until this merges and CI publishes the rolling assetNote
The
main-builddemo badge goes live once this merges and the first post-merge CI run publishes themain-previewasset.🤖 Generated with Claude Code