Skip to content

Make test docs change.#29

Open
dmsnell wants to merge 15 commits into
trunkfrom
try/docs-change
Open

Make test docs change.#29
dmsnell wants to merge 15 commits into
trunkfrom
try/docs-change

Conversation

@dmsnell

@dmsnell dmsnell commented Jun 15, 2026

Copy link
Copy Markdown
Owner

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.

@github-actions

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props dmsnell.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

WordPress Playground Preview

The changes in this pull request can previewed and tested using a WordPress Playground instance.

Open WordPress Playground Preview

@adamziel adamziel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sirreal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +46 to +58
"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"
]
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these for?

Comment on lines +17 to +44
"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"
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refs probably need to be updated.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +27 to +31
* 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 &lt; a < or `<` or a raw character reference?
* What about &amp;lt; and `&lt;`?
*
Comment on lines +115 to +116
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.
Comment on lines +792 to +802
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}`);
}
}
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.

4 participants