From cf1dce7d6462c31cdc4c0d5ca8592ec4f4b198e7 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Sun, 9 Aug 2026 15:44:26 +0400 Subject: [PATCH 01/11] Docs: Add a staging preview fixture The staging lifecycle needs a fork head distinct from its base. Change one PHPDoc sentence so the parser input and exact source SHA can be verified without changing executable Core behavior. --- src/wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index f5002a45de1e8..86374fb67e9f6 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -3063,7 +3063,7 @@ function wp_get_default_extension_for_mime_type( $mime_type ) { /** * Retrieves the file type from the file name. * - * You can optionally define the mime array, if needed. + * The MIME array can optionally be supplied when needed. * * @since 2.0.4 * From 2c2708a4d5e9e0d8d54f67a929f15c31b868fda3 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Sun, 9 Aug 2026 21:11:53 +0400 Subject: [PATCH 02/11] Build/Test Tools: Let Playground choose validation workers The validator forced one worker even though the pinned CLI warns that low worker counts can deadlock on file locks. A ready server could then stop answering health checks and invalidate every snapshot. Use the CLI default and lock that command line down. --- .../docs-playground-preview/lib/validate.mjs | 46 +++++++++++-------- .../test/validate.test.mjs | 18 ++++++++ 2 files changed, 46 insertions(+), 18 deletions(-) diff --git a/.github/scripts/docs-playground-preview/lib/validate.mjs b/.github/scripts/docs-playground-preview/lib/validate.mjs index be2c745bc6be0..5f99e443a0db8 100644 --- a/.github/scripts/docs-playground-preview/lib/validate.mjs +++ b/.github/scripts/docs-playground-preview/lib/validate.mjs @@ -62,6 +62,30 @@ function startServer( command, args ) { return { child, closed, output: () => output }; } +export function createValidationServerArguments( + inputs, + blueprint, + baseUrl, + port +) { + return [ + 'server', + '--php', + inputs.dependencies.playground.phpVersion, + '--wp', + inputs.wordpress.version, + '--blueprint', + blueprint, + '--blueprint-may-read-adjacent-files', + '--site-url', + baseUrl, + '--port', + String( port ), + '--verbosity', + 'normal', + ]; +} + async function stopServer( server ) { if ( server.child.exitCode !== null || server.child.signalCode !== null ) { return; @@ -119,24 +143,10 @@ async function withPlaygroundServer( inputs, options, inspect ) { ); const port = await availablePort(); const baseUrl = `http://127.0.0.1:${ port }`; - const server = startServer( options.playgroundCli, [ - 'server', - '--php', - inputs.dependencies.playground.phpVersion, - '--wp', - inputs.wordpress.version, - '--blueprint', - blueprint, - '--blueprint-may-read-adjacent-files', - '--site-url', - baseUrl, - '--port', - String( port ), - '--workers', - '1', - '--verbosity', - 'normal', - ] ); + const server = startServer( + options.playgroundCli, + createValidationServerArguments( inputs, blueprint, baseUrl, port ) + ); try { await waitForBoot( baseUrl, server, options.fetchImplementation ); return await inspect( baseUrl ); diff --git a/.github/scripts/docs-playground-preview/test/validate.test.mjs b/.github/scripts/docs-playground-preview/test/validate.test.mjs index 26735746d4c3b..e108716d85fa4 100644 --- a/.github/scripts/docs-playground-preview/test/validate.test.mjs +++ b/.github/scripts/docs-playground-preview/test/validate.test.mjs @@ -3,6 +3,7 @@ import { test } from 'node:test'; import { createValidationBlueprint, + createValidationServerArguments, inspectSnapshotBehavior, validateSnapshot, } from '../lib/validate.mjs'; @@ -119,6 +120,23 @@ test( 'validation Blueprint boots the exact snapshot without login or networking ] ); } ); +test( 'validation server uses the pinned Playground worker default', () => { + const args = createValidationServerArguments( + inputs(), + '/tmp/validation-blueprint.json', + 'http://127.0.0.1:9400', + 9400 + ); + assert.equal( args.includes( '--workers' ), false ); + assert.deepEqual( args.slice( 0, 5 ), [ + 'server', + '--php', + '8.4', + '--wp', + '7.2-beta1', + ] ); +} ); + test( 'behavioral validation covers health, routes, search, and banner', async () => { const result = await inspectSnapshotBehavior( inputs(), { baseUrl: 'http://127.0.0.1:9400', From 3d62889ab4b82efaebe301b080e1df07649d505b Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Sun, 9 Aug 2026 22:04:14 +0400 Subject: [PATCH 03/11] Build/Test Tools: Use six Playground snapshot workers GitHub exposes four CPUs, so Playground selected three workers and exported a malformed SQLite database in both staging builds. Invoke the pinned programmatic API with its recommended six workers and validate with the same count. If this is wrong, every reference route dies with a database error. --- .../docs-playground-preview/lib/base.mjs | 24 +++++-------- .../docs-playground-preview/lib/final.mjs | 36 ++++++++----------- .../lib/playground.mjs | 21 +++++++++++ .../docs-playground-preview/lib/validate.mjs | 4 +++ .../test/final.test.mjs | 19 +++++----- .../test/playground.test.mjs | 28 +++++++++++++++ .../test/validate.test.mjs | 4 +-- 7 files changed, 89 insertions(+), 47 deletions(-) create mode 100644 .github/scripts/docs-playground-preview/lib/playground.mjs create mode 100644 .github/scripts/docs-playground-preview/test/playground.test.mjs diff --git a/.github/scripts/docs-playground-preview/lib/base.mjs b/.github/scripts/docs-playground-preview/lib/base.mjs index 88bfab55e9db6..b21ee0f7f517f 100644 --- a/.github/scripts/docs-playground-preview/lib/base.mjs +++ b/.github/scripts/docs-playground-preview/lib/base.mjs @@ -4,6 +4,7 @@ import path from 'node:path'; import { copyDirectory, downloadFile, zipDirectory } from './archive.mjs'; import { acquireRepositories, exists } from './files.mjs'; +import { buildSnapshot } from './playground.mjs'; import { run } from './process.mjs'; const LIBRARY_ROOT = path.dirname( fileURLToPath( import.meta.url ) ); @@ -279,23 +280,16 @@ async function buildInvariantBase( inputs, options ) { 2 ) }\n` ); - await runImplementation( + await ( options.buildSnapshotImplementation || buildSnapshot )( options.playgroundCli || executable( 'wp-playground-cli' ), - [ - 'build-snapshot', - '--php', - inputs.dependencies.playground.phpVersion, - '--wp', - inputs.wordpress.version, - '--blueprint', + { + php: inputs.dependencies.playground.phpVersion, + wp: inputs.wordpress.version, blueprint, - '--blueprint-may-read-adjacent-files', - '--outfile', - path.join( inputs.cacheDirectory, 'base.zip' ), - '--verbosity', - 'normal', - ], - { label: 'build invariant Playground base' } + 'blueprint-may-read-adjacent-files': true, + outfile: path.join( inputs.cacheDirectory, 'base.zip' ), + verbosity: 'normal', + } ); await copyDirectory( roots.phpdocParser, diff --git a/.github/scripts/docs-playground-preview/lib/final.mjs b/.github/scripts/docs-playground-preview/lib/final.mjs index cffa6a8d145dd..a9816b8e5314c 100644 --- a/.github/scripts/docs-playground-preview/lib/final.mjs +++ b/.github/scripts/docs-playground-preview/lib/final.mjs @@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url'; import path from 'node:path'; import { sha256File } from './files.mjs'; -import { run } from './process.mjs'; +import { buildSnapshot } from './playground.mjs'; import { renderRuntimePlugin } from './runtime.mjs'; const LIBRARY_ROOT = path.dirname( fileURLToPath( import.meta.url ) ); @@ -92,7 +92,6 @@ export function createFinalBlueprint( inputs ) { } export async function packageFinalSnapshot( inputs, options ) { - const runImplementation = options.runImplementation || run; const work = path.resolve( options.workDirectory ); const output = path.resolve( options.output ); await rm( work, { recursive: true, force: true } ); @@ -123,27 +122,22 @@ export async function packageFinalSnapshot( inputs, options ) { blueprint, `${ JSON.stringify( createFinalBlueprint( inputs ), null, 2 ) }\n` ); - await runImplementation( + await ( options.buildSnapshotImplementation || buildSnapshot )( options.playgroundCli, - [ - 'build-snapshot', - '--php', - inputs.dependencies.playground.phpVersion, - '--wp', - inputs.wordpress.version, - '--blueprint', + { + php: inputs.dependencies.playground.phpVersion, + wp: inputs.wordpress.version, blueprint, - '--blueprint-may-read-adjacent-files', - '--mount', - `${ path.resolve( - options.stagedSource - ) }:/tmp/docs-preview-source`, - '--outfile', - output, - '--verbosity', - 'normal', - ], - { label: 'build final Code Reference snapshot' } + 'blueprint-may-read-adjacent-files': true, + mount: [ + { + hostPath: path.resolve( options.stagedSource ), + vfsPath: '/tmp/docs-preview-source', + }, + ], + outfile: output, + verbosity: 'normal', + } ); const snapshot = await stat( output ); if ( snapshot.size > inputs.dependencies.limits.snapshotBytes ) { diff --git a/.github/scripts/docs-playground-preview/lib/playground.mjs b/.github/scripts/docs-playground-preview/lib/playground.mjs new file mode 100644 index 0000000000000..a2958e815915f --- /dev/null +++ b/.github/scripts/docs-playground-preview/lib/playground.mjs @@ -0,0 +1,21 @@ +import path from 'node:path'; +import { pathToFileURL } from 'node:url'; + +export const PLAYGROUND_WORKERS = 6; + +export function createSnapshotArguments( options ) { + return { + ...options, + command: 'build-snapshot', + workers: PLAYGROUND_WORKERS, + }; +} + +export async function buildSnapshot( playgroundCli, options ) { + const modulePath = path.resolve( + path.dirname( playgroundCli ), + '../@wp-playground/cli/index.js' + ); + const { runCLI } = await import( pathToFileURL( modulePath ) ); + await runCLI( createSnapshotArguments( options ) ); +} diff --git a/.github/scripts/docs-playground-preview/lib/validate.mjs b/.github/scripts/docs-playground-preview/lib/validate.mjs index 5f99e443a0db8..b46a16bfc21e0 100644 --- a/.github/scripts/docs-playground-preview/lib/validate.mjs +++ b/.github/scripts/docs-playground-preview/lib/validate.mjs @@ -3,6 +3,8 @@ import { copyFile, mkdir, rm, writeFile } from 'node:fs/promises'; import { createServer } from 'node:net'; import path from 'node:path'; +import { PLAYGROUND_WORKERS } from './playground.mjs'; + const BANNER_ID = 'wporg-code-reference-preview-provenance'; function bundled( resourcePath ) { @@ -81,6 +83,8 @@ export function createValidationServerArguments( baseUrl, '--port', String( port ), + '--workers', + String( PLAYGROUND_WORKERS ), '--verbosity', 'normal', ]; diff --git a/.github/scripts/docs-playground-preview/test/final.test.mjs b/.github/scripts/docs-playground-preview/test/final.test.mjs index a18ffa40afb50..c6cead429d0fe 100644 --- a/.github/scripts/docs-playground-preview/test/final.test.mjs +++ b/.github/scripts/docs-playground-preview/test/final.test.mjs @@ -94,8 +94,8 @@ async function fixture( snapshotBytes = 1024 ) { test( 'final packaging returns publisher metadata for a bounded snapshot', async () => { const current = await fixture(); let invocation; - const runImplementation = async ( command, args ) => { - invocation = { command, args }; + const buildSnapshotImplementation = async ( command, options ) => { + invocation = { command, options }; await writeFile( current.output, 'snapshot' ); }; const snapshot = await packageFinalSnapshot( current.resolved, { @@ -110,16 +110,17 @@ test( 'final packaging returns publisher metadata for a bounded snapshot', async generationTimestamp: '2026-08-09T12:34:56.000Z', runUrl: 'https://github.com/example/wordpress-develop/actions/runs/123', }, - runImplementation, + buildSnapshotImplementation, } ); assert.equal( snapshot.filename, 'snapshot.zip' ); assert.equal( snapshot.bytes, 8 ); assert.match( snapshot.sha256, /^[0-9a-f]{64}$/ ); assert.equal( invocation.command, '/tools/wp-playground-cli' ); - assert.equal( - invocation.args[ invocation.args.indexOf( '--mount' ) + 1 ], - '/source:/tmp/docs-preview-source' - ); + assert.deepEqual( invocation.options.mount, [ + { hostPath: '/source', vfsPath: '/tmp/docs-preview-source' }, + ] ); + assert.equal( invocation.options.php, '8.4' ); + assert.equal( invocation.options.wp, '7.2-beta1' ); const blueprint = JSON.parse( await readFile( path.join( current.root, 'work/final-blueprint.json' ), @@ -131,7 +132,7 @@ test( 'final packaging returns publisher metadata for a bounded snapshot', async test( 'the 100 MiB snapshot boundary always fails closed', async () => { const current = await fixture( 8 ); - const runImplementation = async () => { + const buildSnapshotImplementation = async () => { const output = await open( current.output, 'w' ); await output.truncate( 9 ); await output.close(); @@ -149,7 +150,7 @@ test( 'the 100 MiB snapshot boundary always fails closed', async () => { generationTimestamp: '2026-08-09T12:34:56.000Z', runUrl: 'https://github.com/example/wordpress-develop/actions/runs/123', }, - runImplementation, + buildSnapshotImplementation, } ), /exceeds 100 MiB/ ); diff --git a/.github/scripts/docs-playground-preview/test/playground.test.mjs b/.github/scripts/docs-playground-preview/test/playground.test.mjs new file mode 100644 index 0000000000000..72380a7f7afa1 --- /dev/null +++ b/.github/scripts/docs-playground-preview/test/playground.test.mjs @@ -0,0 +1,28 @@ +import assert from 'node:assert/strict'; +import { test } from 'node:test'; + +import { + createSnapshotArguments, + PLAYGROUND_WORKERS, +} from '../lib/playground.mjs'; + +test( 'snapshot builds use six Playground workers', () => { + assert.deepEqual( + createSnapshotArguments( { + php: '8.4', + wp: '7.2-beta1', + blueprint: '/tmp/blueprint.json', + outfile: '/tmp/snapshot.zip', + workers: 2, + command: 'server', + } ), + { + php: '8.4', + wp: '7.2-beta1', + blueprint: '/tmp/blueprint.json', + outfile: '/tmp/snapshot.zip', + workers: PLAYGROUND_WORKERS, + command: 'build-snapshot', + } + ); +} ); diff --git a/.github/scripts/docs-playground-preview/test/validate.test.mjs b/.github/scripts/docs-playground-preview/test/validate.test.mjs index e108716d85fa4..df3836fd09c3c 100644 --- a/.github/scripts/docs-playground-preview/test/validate.test.mjs +++ b/.github/scripts/docs-playground-preview/test/validate.test.mjs @@ -120,14 +120,14 @@ test( 'validation Blueprint boots the exact snapshot without login or networking ] ); } ); -test( 'validation server uses the pinned Playground worker default', () => { +test( 'validation server uses six Playground workers', () => { const args = createValidationServerArguments( inputs(), '/tmp/validation-blueprint.json', 'http://127.0.0.1:9400', 9400 ); - assert.equal( args.includes( '--workers' ), false ); + assert.equal( args[ args.indexOf( '--workers' ) + 1 ], '6' ); assert.deepEqual( args.slice( 0, 5 ), [ 'server', '--php', From af1e19a65f55addd3f08b2ba22e1272357c9738e Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Sun, 9 Aug 2026 22:59:44 +0400 Subject: [PATCH 04/11] Build/Test Tools: Serialize Playground snapshot builds Playground exports a live filesystem after running the Blueprint. Multiple build workers left SQLite corrupt after the full reference import. Build with one worker, then boot the finished snapshot with six. If this regresses, every reference route dies before publication. --- .github/scripts/docs-playground-preview/lib/playground.mjs | 5 +++-- .github/scripts/docs-playground-preview/lib/validate.mjs | 4 ++-- .../docs-playground-preview/test/playground.test.mjs | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/scripts/docs-playground-preview/lib/playground.mjs b/.github/scripts/docs-playground-preview/lib/playground.mjs index a2958e815915f..0fbc15e8231d8 100644 --- a/.github/scripts/docs-playground-preview/lib/playground.mjs +++ b/.github/scripts/docs-playground-preview/lib/playground.mjs @@ -1,13 +1,14 @@ import path from 'node:path'; import { pathToFileURL } from 'node:url'; -export const PLAYGROUND_WORKERS = 6; +export const PLAYGROUND_BUILD_WORKERS = 1; +export const PLAYGROUND_SERVER_WORKERS = 6; export function createSnapshotArguments( options ) { return { ...options, command: 'build-snapshot', - workers: PLAYGROUND_WORKERS, + workers: PLAYGROUND_BUILD_WORKERS, }; } diff --git a/.github/scripts/docs-playground-preview/lib/validate.mjs b/.github/scripts/docs-playground-preview/lib/validate.mjs index b46a16bfc21e0..0e23b74433263 100644 --- a/.github/scripts/docs-playground-preview/lib/validate.mjs +++ b/.github/scripts/docs-playground-preview/lib/validate.mjs @@ -3,7 +3,7 @@ import { copyFile, mkdir, rm, writeFile } from 'node:fs/promises'; import { createServer } from 'node:net'; import path from 'node:path'; -import { PLAYGROUND_WORKERS } from './playground.mjs'; +import { PLAYGROUND_SERVER_WORKERS } from './playground.mjs'; const BANNER_ID = 'wporg-code-reference-preview-provenance'; @@ -84,7 +84,7 @@ export function createValidationServerArguments( '--port', String( port ), '--workers', - String( PLAYGROUND_WORKERS ), + String( PLAYGROUND_SERVER_WORKERS ), '--verbosity', 'normal', ]; diff --git a/.github/scripts/docs-playground-preview/test/playground.test.mjs b/.github/scripts/docs-playground-preview/test/playground.test.mjs index 72380a7f7afa1..ba6e04aa5c206 100644 --- a/.github/scripts/docs-playground-preview/test/playground.test.mjs +++ b/.github/scripts/docs-playground-preview/test/playground.test.mjs @@ -3,10 +3,11 @@ import { test } from 'node:test'; import { createSnapshotArguments, - PLAYGROUND_WORKERS, + PLAYGROUND_BUILD_WORKERS, } from '../lib/playground.mjs'; -test( 'snapshot builds use six Playground workers', () => { +test( 'snapshot builds serialize Playground filesystem access', () => { + assert.equal( PLAYGROUND_BUILD_WORKERS, 1 ); assert.deepEqual( createSnapshotArguments( { php: '8.4', @@ -21,7 +22,7 @@ test( 'snapshot builds use six Playground workers', () => { wp: '7.2-beta1', blueprint: '/tmp/blueprint.json', outfile: '/tmp/snapshot.zip', - workers: PLAYGROUND_WORKERS, + workers: PLAYGROUND_BUILD_WORKERS, command: 'build-snapshot', } ); From 9bc9bf05932fae18c358e093c12412a27277b191 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 10 Aug 2026 00:27:31 +0400 Subject: [PATCH 05/11] Build/Test Tools: Diagnose fork preview eligibility GitHub emits the fork events but skips the build job. Guessing at the compound condition wastes staging runs. Report only the evaluated booleans from an unprivileged temporary job. The diagnostic is removed after the false term is known. --- .../docs-playground-preview-build.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/docs-playground-preview-build.yml b/.github/workflows/docs-playground-preview-build.yml index 5d7a9f1f2cf59..11e1f4b1c49cd 100644 --- a/.github/workflows/docs-playground-preview-build.yml +++ b/.github/workflows/docs-playground-preview-build.yml @@ -13,6 +13,28 @@ on: permissions: {} jobs: + diagnose-staging-eligibility: + name: Diagnose staging eligibility + if: ${{ github.event_name == 'pull_request' }} + runs-on: ubuntu-24.04 + permissions: {} + env: + REPOSITORY_ALLOWED: ${{ github.repository == 'WordPress/wordpress-develop' || github.repository == 'sirreal/wordpress-develop' }} + STAGING_ENABLED: ${{ vars.DOCS_PREVIEW_STAGING == 'true' }} + BASE_IS_TRUNK: ${{ github.event.pull_request.base.ref == 'trunk' }} + PR_IS_OPEN: ${{ github.event.pull_request.state == 'open' }} + LABEL_REQUESTED: ${{ github.event.action == 'labeled' && github.event.label.name == 'docs-preview' }} + SYNCHRONIZE_REQUESTED: ${{ github.event.action == 'synchronize' && contains( github.event.pull_request.labels.*.name, 'docs-preview' ) }} + steps: + - name: Report boolean eligibility terms + run: | + printenv REPOSITORY_ALLOWED + printenv STAGING_ENABLED + printenv BASE_IS_TRUNK + printenv PR_IS_OPEN + printenv LABEL_REQUESTED + printenv SYNCHRONIZE_REQUESTED + build: name: Build Code Reference snapshot if: >- From 5b1e192ed264645fdf0365c58bb2bd57e38c9119 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 10 Aug 2026 00:30:47 +0400 Subject: [PATCH 06/11] Build/Test Tools: Remove fork eligibility diagnostic The diagnostic found the false term: fork pull-request runs resolve repository variables from the fork, not the base repository. Remove the temporary job. Keeping diagnostic workflow code would not fix the activation contract. --- .../docs-playground-preview-build.yml | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/docs-playground-preview-build.yml b/.github/workflows/docs-playground-preview-build.yml index 11e1f4b1c49cd..5d7a9f1f2cf59 100644 --- a/.github/workflows/docs-playground-preview-build.yml +++ b/.github/workflows/docs-playground-preview-build.yml @@ -13,28 +13,6 @@ on: permissions: {} jobs: - diagnose-staging-eligibility: - name: Diagnose staging eligibility - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-24.04 - permissions: {} - env: - REPOSITORY_ALLOWED: ${{ github.repository == 'WordPress/wordpress-develop' || github.repository == 'sirreal/wordpress-develop' }} - STAGING_ENABLED: ${{ vars.DOCS_PREVIEW_STAGING == 'true' }} - BASE_IS_TRUNK: ${{ github.event.pull_request.base.ref == 'trunk' }} - PR_IS_OPEN: ${{ github.event.pull_request.state == 'open' }} - LABEL_REQUESTED: ${{ github.event.action == 'labeled' && github.event.label.name == 'docs-preview' }} - SYNCHRONIZE_REQUESTED: ${{ github.event.action == 'synchronize' && contains( github.event.pull_request.labels.*.name, 'docs-preview' ) }} - steps: - - name: Report boolean eligibility terms - run: | - printenv REPOSITORY_ALLOWED - printenv STAGING_ENABLED - printenv BASE_IS_TRUNK - printenv PR_IS_OPEN - printenv LABEL_REQUESTED - printenv SYNCHRONIZE_REQUESTED - build: name: Build Code Reference snapshot if: >- From d496e52e62c71848d31ed56266fa9c54a279c9e0 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 10 Aug 2026 00:32:45 +0400 Subject: [PATCH 07/11] Build/Test Tools: Probe base variable access Fork pull-request contexts cannot see the base repository variable. Before changing the trigger architecture, test whether the existing read-only token can read that non-secret value through GitHub's API. Report only the status and exact-true result. Remove the probe after the capability is known. --- .../docs-playground-preview-build.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/docs-playground-preview-build.yml b/.github/workflows/docs-playground-preview-build.yml index 5d7a9f1f2cf59..4260b41b8b315 100644 --- a/.github/workflows/docs-playground-preview-build.yml +++ b/.github/workflows/docs-playground-preview-build.yml @@ -13,6 +13,28 @@ on: permissions: {} jobs: + diagnose-base-variable-api: + name: Diagnose base variable API + if: ${{ github.event_name == 'pull_request' }} + runs-on: ubuntu-24.04 + permissions: + contents: read + env: + API_URL: ${{ github.api_url }}/repos/${{ github.event.pull_request.base.repo.full_name }}/actions/variables/DOCS_PREVIEW_STAGING + GITHUB_TOKEN: ${{ github.token }} + steps: + - name: Report read-only variable access + run: | + http_status="$( curl --silent --show-error --output variable.json --write-out '%{http_code}' \ + --header 'Accept: application/vnd.github+json' \ + --header "Authorization: Bearer $GITHUB_TOKEN" \ + --header 'X-GitHub-Api-Version: 2022-11-28' \ + "$API_URL" )" + echo "HTTP $http_status" + if [ "$http_status" = '200' ]; then + jq -r '.value == "true"' variable.json + fi + build: name: Build Code Reference snapshot if: >- From 8c507d74407973ee513342eece81f524e3d0a848 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 10 Aug 2026 00:33:49 +0400 Subject: [PATCH 08/11] Build/Test Tools: Remove base variable probe The read-only fork token receives HTTP 403 from the base repository variable endpoint. The API cannot supply the missing activation signal without more authority. Remove the temporary probe. Keeping it would add noise without a viable gate. --- .../docs-playground-preview-build.yml | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/docs-playground-preview-build.yml b/.github/workflows/docs-playground-preview-build.yml index 4260b41b8b315..5d7a9f1f2cf59 100644 --- a/.github/workflows/docs-playground-preview-build.yml +++ b/.github/workflows/docs-playground-preview-build.yml @@ -13,28 +13,6 @@ on: permissions: {} jobs: - diagnose-base-variable-api: - name: Diagnose base variable API - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-24.04 - permissions: - contents: read - env: - API_URL: ${{ github.api_url }}/repos/${{ github.event.pull_request.base.repo.full_name }}/actions/variables/DOCS_PREVIEW_STAGING - GITHUB_TOKEN: ${{ github.token }} - steps: - - name: Report read-only variable access - run: | - http_status="$( curl --silent --show-error --output variable.json --write-out '%{http_code}' \ - --header 'Accept: application/vnd.github+json' \ - --header "Authorization: Bearer $GITHUB_TOKEN" \ - --header 'X-GitHub-Api-Version: 2022-11-28' \ - "$API_URL" )" - echo "HTTP $http_status" - if [ "$http_status" = '200' ]; then - jq -r '.value == "true"' variable.json - fi - build: name: Build Code Reference snapshot if: >- From 101040ccf39c62e0d5e8f59c048bfd29ac229691 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 10 Aug 2026 07:34:42 +0400 Subject: [PATCH 09/11] Docs: Advance the staging preview fixture The latest-wins test needs a new fork head while the label remains present. Change parser-visible prose without changing executable Core behavior so the obsolete run must yield to the new SHA. --- src/wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 86374fb67e9f6..021a477feffb4 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -3063,7 +3063,7 @@ function wp_get_default_extension_for_mime_type( $mime_type ) { /** * Retrieves the file type from the file name. * - * The MIME array can optionally be supplied when needed. + * A custom MIME array may be supplied when needed. * * @since 2.0.4 * From ca23afabbec6e418df91db40e13e3226905ad103 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 10 Aug 2026 07:45:32 +0400 Subject: [PATCH 10/11] Docs: Break the staging reference route Advisory mode needs a real behavioral failure, not a mocked status. Rename the parsed representative function so import still completes but the required route and search result disappear. --- src/wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 021a477feffb4..20f953876c437 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -5009,7 +5009,7 @@ function smilies_init() { * Default empty array. * @return array Merged user defined values with defaults. */ -function wp_parse_args( $args, $defaults = array() ) { +function wp_parse_args_staging_failure( $args, $defaults = array() ) { if ( is_object( $args ) ) { $parsed_args = get_object_vars( $args ); } elseif ( is_array( $args ) ) { From 48d893896717578b1b05a4b60be88074da2b7075 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 10 Aug 2026 07:46:00 +0400 Subject: [PATCH 11/11] Docs: Restore the staging reference route The validation-failure fixture has one purpose and must not survive the staging test. Restore the representative function name or the next preview cannot prove the required route and local search behavior. --- src/wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 20f953876c437..021a477feffb4 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -5009,7 +5009,7 @@ function smilies_init() { * Default empty array. * @return array Merged user defined values with defaults. */ -function wp_parse_args_staging_failure( $args, $defaults = array() ) { +function wp_parse_args( $args, $defaults = array() ) { if ( is_object( $args ) ) { $parsed_args = get_object_vars( $args ); } elseif ( is_array( $args ) ) {