Make test docs change.#29
Conversation
…orkflow' into docs/add-playground-preview-codex
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
This is the opposite of my typical code review. I haven't read the code too deeply, but I can confirm it works and helps me test the phpdoc-parser PR WordPress/phpdoc-parser#258
sirreal
left a comment
There was a problem hiding this comment.
This is awesome. It seems like this can move forward and be improved iteratively. I don't see much risk associated with this.
This PR has the comment:
The changes in this pull request can previewed and tested using a WordPress Playground instance.
It would be good to be clear on a docs preview vs. preview of code changes.
| "routes": [ | ||
| "/reference/", | ||
| "/reference/classes/wp_html_tag_processor/", | ||
| "/reference/classes/wp_html_tag_processor/next_tag/", | ||
| "/reference/classes/wp_html_tag_processor/set_attribute/" | ||
| ], | ||
| "samplePosts": { | ||
| "class": "wp_html_tag_processor", | ||
| "methods": [ | ||
| "wp_html_tag_processor-next_tag", | ||
| "wp_html_tag_processor-set_attribute" | ||
| ] | ||
| } |
| "phpdocParser": { | ||
| "repo": "dmsnell/phpdoc-parser", | ||
| "ref": "4a30fe65c691aca7ea74ca0dd35f2e5e6ba261dc", | ||
| "expectedFile": "generate-json-manually.php" | ||
| }, | ||
| "wporgDeveloper": { | ||
| "repo": "WordPress/wporg-developer", | ||
| "ref": "04ff394005b5c4f9efc888803e23e031cda37e6b", | ||
| "themePath": "source/wp-content/themes/wporg-developer-2023" | ||
| }, | ||
| "wporgParent2021": { | ||
| "repo": "WordPress/wporg-parent-2021", | ||
| "ref": "6ebb648ce929999f014d90a82dec12b9d0799fb6", | ||
| "themePath": "source/wp-content/themes/wporg-parent-2021" | ||
| }, | ||
| "wporgMuPlugins": { | ||
| "repo": "WordPress/wporg-mu-plugins", | ||
| "ref": "cda0c88c54a82c6c0e3df1c88a70b7a390d4fada", | ||
| "muPluginsPath": "mu-plugins" | ||
| }, | ||
| "postsToPosts": { | ||
| "repo": "scribu/wp-posts-to-posts", | ||
| "ref": "d2f297dbe257a09438da6ffe22c9a876acb7b49b" | ||
| }, | ||
| "codeSyntaxBlock": { | ||
| "url": "https://downloads.wordpress.org/plugin/code-syntax-block.3.2.1.zip", | ||
| "slug": "code-syntax-block" | ||
| } |
There was a problem hiding this comment.
The refs probably need to be updated.
There was a problem hiding this comment.
Pull request overview
This PR introduces an automated “Docs Playground preview” pipeline (build + publish) for pull requests, alongside a small change to the WP_HTML_Tag_Processor class PHPDoc.
Changes:
- Add a PR-triggered workflow to build a WordPress Playground snapshot + diagnostics bundle for API docs preview.
- Add a
workflow_run-triggered workflow to publish preview artifacts (GitHub release assets) and post a Playground preview comment on the PR. - Add the supporting build harness (
build.mjs) and pinned Node dependency set under.github/docs-playground-preview/.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/wp-includes/html-api/class-wp-html-tag-processor.php |
Updates PHPDoc content for the HTML API tag processor class. |
.github/workflows/docs-playground-preview-build.yml |
New workflow to build docs preview artifacts on PR events. |
.github/workflows/docs-playground-preview-publish.yml |
New workflow to publish artifacts + comment on PRs after the build workflow completes. |
.github/scripts/docs-playground-preview/build.mjs |
Node-based build harness to stage WP source, generate reference JSON, build/validate a Playground snapshot, and emit diagnostics. |
.github/docs-playground-preview/package.json |
Pins the Playground CLI dependency used by the harness. |
.github/docs-playground-preview/package-lock.json |
Locks the full dependency tree for reproducible installs. |
.github/docs-playground-preview/dependencies.json |
Central configuration for upstream refs, budgets, routes, and versions used by the harness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * This is the HTML API. Welcome to WordPress. Things like `<` and `>` are hard to type in | ||
| * the docs because you don’t know if <img> is interpreted as an IMG tag or if `<img>` is | ||
| * required to be escaped by back-quotes. Also, is < a < or `<` or a raw character reference? | ||
| * What about &lt; and `<`? | ||
| * |
| gh api -X GET "/repos/${GITHUB_REPOSITORY}/actions/artifacts/${ARTIFACT_ID}/zip" > bundle.zip | ||
| unzip -oq bundle.zip -d bundle |
| comment-template: | | ||
| ### WordPress Playground Preview | ||
|
|
||
| A docs preview was generated for this pull request, but the docs smoke validation has not passed yet. Use this preview for manual inspection while the failing validation is investigated. |
| function enforceBudgets(budgets, zipInfo) { | ||
| if (zipInfo.compressedBytes > budgets.compressedFailBytes) { | ||
| throw new Error(`Snapshot exceeds compressed budget: ${zipInfo.compressedBytes} > ${budgets.compressedFailBytes}`); | ||
| } | ||
| if (zipInfo.uncompressedBytes > budgets.uncompressedFailBytes) { | ||
| throw new Error(`Snapshot exceeds uncompressed budget: ${zipInfo.uncompressedBytes} > ${budgets.uncompressedFailBytes}`); | ||
| } | ||
| if (zipInfo.compressedBytes > budgets.compressedWarnBytes) { | ||
| console.warn(`Warning: snapshot exceeds compressed warning budget: ${zipInfo.compressedBytes}`); | ||
| } | ||
| } |
Trac ticket:
Use of AI Tools
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.