-
Notifications
You must be signed in to change notification settings - Fork 152
feat: add playground support #1659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat: add playground support #1659
Conversation
WalkthroughTwo new configuration files have been added: a WordPress blueprint JSON file specifying environment setup parameters, and a GitHub Actions workflow YAML file for automating plugin asset deployment on pushes to the master branch. No code or exported entities are modified. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (3)
.wordpress-org/blueprints/blueprint.json (2)
14-15
: Missing trailing newline (nitpick)Linters complain (
no new line character at the end of file
).
Not required by JSON, but adding it keeps CI & editors quiet.} } +
8-13
:login
step lacks a password – will prompt interactivelyIf the step engine follows the published spec, omitting
"password"
causes an interactive prompt, defeating automation:- "username": "admin" + "username": "admin", + "password": "password"Because this is an ephemeral playground instance you can keep the default credentials; just include them explicitly.
.github/workflows/asset-deploy.yml (1)
18-18
: Add newline at EOFYAML-lint flags the missing newline.
IGNORE_OTHER_FILES: true +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.wordpress-org/blueprints/blueprint.json
(1 hunks).github/workflows/asset-deploy.yml
(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Inspections
.wordpress-org/blueprints/blueprint.json
[error] 1-1: Error: Start tag expected, '<' not found on line 1, column 1. The file may be malformed or not an XML file.
[error] 1-1: ERROR: The file ".wordpress-org/blueprints/blueprint.json" does not exist.
🪛 YAMLlint (1.37.1)
.github/workflows/asset-deploy.yml
[error] 18-18: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (3)
.github/workflows/asset-deploy.yml (1)
1-5
: Confirm branch-trigger is correctThe workflow only fires on pushes to
master
.
If your default branch ismain
(GitHub’s current default) this job will never run..wordpress-org/blueprints/blueprint.json (2)
3-6
: Ignore outdated suggestion onpreferredVersions
removalThe current WordPress Playground blueprint schema still uses a top-level
preferredVersions
key to declare PHP and WordPress versions. Removing or replacing it will break blueprint validation and environment setup.• Keep this block as is in .wordpress-org/blueprints/blueprint.json (lines 3–6):
"preferredVersions": { "php": "8.0", "wp": "latest" }Likely an incorrect or invalid review comment.
1-14
: CI Failure Due to Unrecognized Blueprint FormatI don’t see any references to
blueprint.json
orblueprint.xml
in your GitHub Actions workflows, yet the CI is clearly attempting to parse your JSON file as XML:
- The file at
.wordpress-org/blueprints/blueprint.json
is being fed into an XML parser (hence theStart tag expected, '<' not found…
error).- No workflow in
.github/workflows/
mentions eitherblueprint.json
orblueprint.xml
.Please verify your pipeline configuration and make one of the following changes:
- Rename and convert
.wordpress-org/blueprints/blueprint.json
→.wordpress-org/blueprints/blueprint.xml
so it matches the CI’s expected format
OR- Update your CI (in whichever config drives the “blueprint” step) to accept JSON input instead of XML.
{ | ||
"landingPage": "/wp-admin/", | ||
"preferredVersions": { | ||
"php": "8.0", | ||
"wp": "latest" | ||
}, | ||
"plugins": ["wp-user-frontend"], | ||
"steps": [ | ||
{ | ||
"step": "login", | ||
"username": "admin" | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
CI can’t find / parse the blueprint – verify path & expected format
The pipeline reports
ERROR: The file ".wordpress-org/blueprints/blueprint.json" does not exist
and an XML-related parse error (Start tag expected, '<' not found
).
This usually happens when:
- The consumer is looking for
.wordpress-org/blueprint.json
(noblueprints/
sub-dir) or a different extension, or - The CI task expects an XML blueprint, not JSON.
Until the file is in the exact location/format the job expects, “playground support” will remain broken.
Please double-check the spec used by the WordPress Playground action (or whatever step consumes this file) and rename / relocate / convert accordingly.
🏁 Script executed:
#!/bin/bash
set -e
echo "=== Listing all blueprint.json files ==="
fd blueprint.json || echo "No blueprint.json files found."
echo
echo "=== Searching for 'blueprint' references in GitHub Actions workflows ==="
rg -n "blueprint" .github/workflows || echo "No references to 'blueprint' in workflows."
echo
echo "=== Searching for 'blueprints/' directory references ==="
rg -n "blueprints/" -C2 .
Length of output: 630
CI Blueprint Path Mismatch
The CI job is currently unable to locate your blueprint because it’s expecting a different path or format. The file lives at:
• .wordpress-org/blueprints/blueprint.json
but the pipeline error indicates it’s looking for:
• .wordpress-org/blueprint.json
(or an XML-formatted blueprint).
Please verify the WordPress Playground action’s spec and update one of the following so they match:
• Move or rename the file to .wordpress-org/blueprint.json
• Update your workflow/config to point at blueprints/blueprint.json
• If the action requires XML rather than JSON, convert the blueprint to the expected format
Once the path and format align, “playground support” will be restored.
🧰 Tools
🪛 GitHub Actions: Inspections
[error] 1-1: Error: Start tag expected, '<' not found on line 1, column 1. The file may be malformed or not an XML file.
[error] 1-1: ERROR: The file ".wordpress-org/blueprints/blueprint.json" does not exist.
🤖 Prompt for AI Agents
In .wordpress-org/blueprints/blueprint.json lines 1 to 14, the CI pipeline
cannot find the blueprint because it expects the file at
.wordpress-org/blueprint.json or in XML format. To fix this, either move or
rename the current JSON file to .wordpress-org/blueprint.json, or update the CI
workflow configuration to point to blueprints/blueprint.json. If the action
requires XML format, convert the JSON blueprint to XML accordingly.
name: Push to trunk | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use a maintained version of actions/checkout
actions/checkout@master
is deprecated. Switch to the latest tagged release (currently v4
) or pin to a specific commit for supply-chain safety.
- - uses: actions/checkout@master
+ - uses: actions/checkout@v4
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- uses: actions/checkout@master | |
- uses: actions/checkout@v4 |
🤖 Prompt for AI Agents
In .github/workflows/asset-deploy.yml at line 11, replace the deprecated
'actions/checkout@master' with the latest stable tagged release, such as
'actions/checkout@v4', to ensure the action is maintained and improve
supply-chain security.
uses: 10up/action-wordpress-plugin-asset-update@stable | ||
env: | ||
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | ||
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | ||
SLUG: wp-user-frontend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Pin external action to a commit or tag
10up/action-wordpress-plugin-asset-update@stable
floats with every push to the stable
branch.
For reproducible builds and better supply-chain security, pin to a full SHA or semver tag:
- - name: WordPress.org plugin asset/readme update
- uses: 10up/action-wordpress-plugin-asset-update@stable
+ - name: WordPress.org plugin asset/readme update
+ uses: 10up/[email protected] # <-- example; replace with latest tag/SHA
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
uses: 10up/action-wordpress-plugin-asset-update@stable | |
env: | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SLUG: wp-user-frontend | |
- name: WordPress.org plugin asset/readme update | |
uses: 10up/[email protected] # <-- example; replace with latest tag or full SHA | |
env: | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SLUG: wp-user-frontend |
🤖 Prompt for AI Agents
In .github/workflows/asset-deploy.yml around lines 13 to 17, the GitHub action
uses a floating tag 'stable' for 10up/action-wordpress-plugin-asset-update,
which can change unexpectedly. To fix this, replace 'stable' with a specific
commit SHA or a fixed semver tag to ensure reproducible builds and improve
supply-chain security.
close issue
Summary by CodeRabbit