Skip to content

Internal: Add WP Playground PR preview and build artifact comment [TMZ-1068] - #681

Open
Ntnelbaba wants to merge 1 commit into
mainfrom
internal/TMZ-1068-playground-pr-preview
Open

Internal: Add WP Playground PR preview and build artifact comment [TMZ-1068]#681
Ntnelbaba wants to merge 1 commit into
mainfrom
internal/TMZ-1068-playground-pr-preview

Conversation

@Ntnelbaba

@Ntnelbaba Ntnelbaba commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Brings Elementor Core's PR experience to Hello Theme, adapted for a theme (not a plugin):

  • Theme-only Playground preview - tests/playwright/blueprints/pr-preview.json installs and activates only the built hello-elementor theme from a nightly.link artifact URL. No Elementor plugin, options, experiments, or other packages are added by the blueprint.
  • Reusable preview workflow - .github/workflows/playground-preview.yml downloads the PR build artifact, validates hello-elementor.<version>.zip, repacks a Playground artifact rooted at hello-elementor/, generates the playground.wordpress.net URL, and creates a transient playground-preview deployment on the PR head SHA.
  • Build integration - build.yml runs the playground-preview job only for successful PR builds in elementor-owned repos, and now posts a build-artifact comment on elementor-owned PRs (with a fork fallback that prints artifact info to the job log), mirroring Core.

Notes

  • Fork PRs skip the deployment link (read-only token) and fall back to logged artifact info.
  • No theme runtime code, tests, or docs were changed; no unrelated action/version bumps.

Test plan

  • Open a same-repo PR and confirm the "Hello Elementor Build" comment appears with a working artifact link.
  • Confirm the playground-preview deployment shows up and its URL boots WordPress with only Hello Elementor active (theme active, no Elementor plugin).
  • Open a fork PR and confirm CI stays green with artifact info printed to the log (no failed deployment step).

Ref: TMZ-1068

Made with Cursor

✨ PR Description

1. Problem & Context

Enable WP Playground PR previews and build artifact tracking for Elementor repo PRs. Automates environment setup with timestamped builds and GitHub deployment integration.

2. What Changed (Where)

  • .github/workflows/build.yml: Add job permissions, environment variables (DATE_VERSION, PACKAGE_VERSION), PR comment with artifact link, fork PR artifact info fallback
  • .github/workflows/playground-preview.yml: New workflow downloads build artifact, repacks for Playground, generates blueprint JSON, creates GitHub deployment
  • tests/playwright/blueprints/pr-preview.json: Blueprint template for Playground environment with theme installation

3. How It Works

Build job exports artifact_name output, generates versioned ZIP filename and timestamp. For Elementor repo PRs, posts/updates comment with artifact download link; for forks, prints artifact info to logs. Playground preview workflow downloads artifact, restructures directory layout, generates theme zip URL in blueprint JSON, creates deployment with Playground URL as environment_url. Blueprint auto-logs in, installs theme from URL, activates hello-elementor.

4. Risks

  • Playground preview only runs on Elementor repo PRs (startsWith(github.repository, 'elementor/')), but build job comment condition uses startsWith(github.event.pull_request.head.repo.full_name, 'elementor/') — different scopes could diverge
  • Artifact retention 7 days vs preview artifact 3 days; if build fails or artifacts expire, deployment link breaks silently
  • No validation that pr-preview.json blueprint is valid before deployment creation

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

…Z-1068]

Adapt Elementor Core's PR flow for Hello Theme (theme-only):
- Minimal theme-only Playground blueprint installing/activating the built
  hello-elementor theme from a nightly.link artifact URL
- Reusable playground-preview workflow creating a transient deployment
- build.yml wiring: preview job for successful PR builds in elementor repos,
  plus build-artifact PR comment with a fork log fallback

Ref: TMZ-1068
Co-authored-by: Cursor <cursoragent@cursor.com>
@wiz-9a149474ff

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations 2 Low
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 2 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio.

retention-days: 7
- name: Find existing comment on PR (Elementor repo)
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.repo.full_name, 'elementor/')
uses: peter-evans/find-comment@v4
body-includes: 'Hello Elementor Build'
- name: Comment build info on PR (Elementor repo)
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.repo.full_name, 'elementor/')
uses: peter-evans/create-or-update-comment@v5
@github-actions

Copy link
Copy Markdown

Hello Elementor Build

Last updated at: 20260816.1105
Version: 3.4.9

✅ Hello Elementor build is ready for download.

You can download the latest build from the link below:

🔗 hello-elementor.3.4.9.zip

The build is available for 7 days.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants