Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
8347bab
Add Common Crawl HTML API fuzz harness
sirreal Jul 15, 2026
ed3aa31
Harden Common Crawl worker supervision
sirreal Jul 15, 2026
7cf6fca
fuzz: don't clobber crash evidence
sirreal Jul 15, 2026
bd64575
fuzz: replay the recorded limits
sirreal Jul 15, 2026
1535bda
fuzz: reject the wrong oracle
sirreal Jul 15, 2026
c379d5b
fuzz: test concurrent corpus writers
sirreal Jul 15, 2026
d27dc0c
fuzz: reap crashed worker groups
sirreal Jul 15, 2026
462a6d8
oracles: add pinned html5ever runner
sirreal Jul 15, 2026
2024490
oracles: add pinned Chrome CDP runner
sirreal Jul 16, 2026
f0e7425
oracles: supervise source adapters
sirreal Jul 16, 2026
91fc6c4
oracles: integrate pinned Chrome adapter
sirreal Jul 16, 2026
ccb5be5
fuzz: verify shared Common Crawl corpus
sirreal Jul 16, 2026
0a4d1d0
docs: record Common Crawl external gate
sirreal Jul 16, 2026
2459eed
Comments: allow the Notes @mention chip markup in comment content.
adamsilverstein Jul 23, 2026
b0e62d8
Docs: Require view config filter callbacks to return the container.
jorgefilipecosta Jul 23, 2026
5fd5a8e
View config: reject shape-mismatched merges, define empty-array seman…
jorgefilipecosta Jul 23, 2026
78e0b51
Code Quality: Preserve `string[]` input type in `wp_parse_list()` ret…
westonruter Jul 23, 2026
4f0a5c7
Code Quality: Document that `sanitize_key()` returns `lowercase-string`.
westonruter Jul 23, 2026
8f7c6bc
Docs: Correct the type for `WP_Screen::$_screen_settings`.
SergeyBiryukov Jul 23, 2026
0029901
Administration: Use post title column as table header in post lists.
joedolson Jul 23, 2026
2d1c511
Administration: Update bulk edit validity checks & CSS.
joedolson Jul 23, 2026
baf6c2b
Media: Accessibility: Fix labels in scale tool.
joedolson Jul 24, 2026
58b28ff
REST API: Enforce multisite upload limits when sideloading media from…
andrewserong Jul 24, 2026
53119d1
Plugins: Remove redundant type casting in `wp_filter_build_unique_id()`.
SergeyBiryukov Jul 24, 2026
d88c95d
Administration: Improve UI when adding or removing tags.
joedolson Jul 24, 2026
5830b7c
Privacy: More accurate admin notices when saving.
joedolson Jul 24, 2026
6d1d03d
Privacy: Delete Privacy Policy setting when page deleted.
joedolson Jul 24, 2026
c6d10e9
Editor: Sync the REST index preload field list with core-data.
adamsilverstein Jul 24, 2026
749e622
Privacy: Fix type inconsistencies in data erasure inline notices.
joedolson Jul 24, 2026
3300b8b
Administration: Make the Events widget no-JS notice translatable.
t-hamano Jul 25, 2026
07b1f8b
Docs: Fix typo in a comment in `wp_dashboard_rss_control()`.
SergeyBiryukov Jul 25, 2026
05d3b3c
KSES: Allow the autofocus attribute on dialog elements.
afercia Jul 26, 2026
17d5f5f
Media: Restore the label of the 'Filter by date' select in the Media …
afercia Jul 26, 2026
ca28cbb
Tests: Improve On This Day dashboard widget tests.
SergeyBiryukov Jul 26, 2026
c213aec
Theme JSON: Level block-level preset class specificity with :where()
ramonjd Jul 27, 2026
227acbc
Filesystem API: Correct permissions comparison in `WP_Filesystem_Dire…
SergeyBiryukov Jul 27, 2026
940e7a3
Build/Test tools: Remove tag triggers for all workflows.
johnbillion Jul 27, 2026
d0a3047
Build/Test Tools: Retry Docker image pulls in PHPUnit workflows.
lancewillett Jul 27, 2026
5174167
Build/Test Tools: Trim the PHPUnit matrix to boundary PHP versions.
lancewillett Jul 27, 2026
d9f0c42
Build/Test Tools: Fetch and verify the Gutenberg build once per run.
lancewillett Jul 27, 2026
764502d
Docs: Document how to run the QUnit test suite.
lancewillett Jul 27, 2026
a331245
Build/Test Tools: Pin Zod to fix the JSDoc lint export error.
lancewillett Jul 27, 2026
80fb78d
Build/Test Tools: Add the missing reusable-prepare-gutenberg.yml work…
lancewillett Jul 27, 2026
0ccf72e
```
ramonjd Jul 28, 2026
3a9e901
Login and Registration: Correct focus color for links.
t-hamano Jul 28, 2026
133c582
Users: Add a user-ID-based `id` to network user rows.
t-hamano Jul 28, 2026
ba8e79e
Bundled Themes: Add missing package details to block themes.
t-hamano Jul 28, 2026
fd04681
Administration: Add aria-label attributes to row headers in more list…
afercia Jul 28, 2026
6e37bf1
Themes: Fix inconsistent navigation to the previous theme in the Them…
afercia Jul 28, 2026
f3e0f6b
Tests: Use null coalescing operator over `isset()` checks.
SergeyBiryukov Jul 28, 2026
7981ab8
Build/Test Tools: Copy local environment configuration synchronously.
lancewillett Jul 28, 2026
d5169cd
Build/Test Tools: Update the WordPress Coding Standards to 3.4.1.
lancewillett Jul 28, 2026
ef7eb03
Administration: Fix focus/hover styles on collapse menu button.
joedolson Jul 28, 2026
5b9b41f
Accessibility: In modal collections use alt plus arrow for navigation.
joedolson Jul 28, 2026
4949ae9
Twenty Twenty One: Only filter untitled posts on the front end.
joedolson Jul 28, 2026
c5690fd
Build/Test Tools: Allow the PHPUnit runner to be set by a repository …
lancewillett Jul 28, 2026
d99627d
Media: Use correct fallback `aria-label` for untitled images.
joedolson Jul 29, 2026
d7de266
Bundled Themes: Fix hook docblocks and filter arguments.
westonruter Jul 29, 2026
2f137d1
HTTP API: Pass the missing URL to the `https_local_ssl_verify` filter.
westonruter Jul 29, 2026
6405113
Code Modernization: Use the null coalescing operator for `isset()` re…
SergeyBiryukov Jul 29, 2026
571c279
General: Bump the pinned hash for Gutenberg to `fd715a6`.
Jul 29, 2026
6a10fe9
Administration: Lower specificity of hover and focus states on disabl…
joedolson Jul 29, 2026
564cce6
WordPress 7.1 Beta 4.
t-hamano Jul 29, 2026
04b55dd
Post WordPress 7.1 Beta 4 version bump.
t-hamano Jul 29, 2026
c47451a
Meta: Add Aki Hamano to the mailmap file.
westonruter Jul 29, 2026
2853d42
Taxonomy: Pass the missing `$args` to several term hooks.
westonruter Jul 29, 2026
6126d6a
Menus: Pass the missing `$menu_data` to the `wp_update_nav_menu` action.
westonruter Jul 29, 2026
2583553
REST API: Pass the missing `$is_update` param to the `wp_creating_aut…
westonruter Jul 29, 2026
0ffd942
Comments, REST API: Drop undocumented args from content filters.
westonruter Jul 29, 2026
54ea90b
Security: Update `composer/ca-bundle` to version `1.5.13`.
desrosj Jul 29, 2026
ad63e00
Networks and Sites: Pass the missing `$site_id` to bulk actions.
westonruter Jul 29, 2026
5d9452b
Plugins: Pass the missing `$network_wide` to `activate_{$plugin}`.
westonruter Jul 29, 2026
4c7091d
Plugins: Pass the missing `$paged` to `install_plugins_upload`.
westonruter Jul 29, 2026
709c33b
XML-RPC: Pass the missing args to the `enable_xmlrpc` filters.
westonruter Jul 29, 2026
42fcdc8
Docs: Attach three hook doc comments to their filter calls.
westonruter Jul 29, 2026
f390433
Docs: Correct the type of the `image_editor_output_format` map.
westonruter Jul 29, 2026
de03056
Build/Test Tools: Don't attempt to upload a SARIF file to GitHub Code…
lancewillett Jul 29, 2026
123f966
Build/Test Tools: Add a start period to the MySQL healthcheck.
lancewillett Jul 29, 2026
157c2fc
Build/Test Tools: Wait for the database before running WP-CLI commands.
lancewillett Jul 29, 2026
7404a51
Build/Test Tools: Verify hook docblocks statically.
westonruter Jul 30, 2026
109f43b
Media: Fix focus style and first added item dotted outline in the Med…
afercia Jul 30, 2026
9689942
Editor: Fix template `date` and `modified` REST API values for file-b…
ntsekouras Jul 30, 2026
c2a8f06
Administration: Improve consistency of the focus style across the admin.
afercia Jul 30, 2026
b64c2ac
Administration: Fix the alignment of the 'Update to' button in the 'A…
afercia Jul 30, 2026
9d33f69
Interactivity API: Fix a fatal error when binding a non-scalar value.
westonruter Jul 30, 2026
4eaba0e
Code Modernization: Use null coalescing operator instead of ternaries.
SergeyBiryukov Jul 30, 2026
9f69d0e
Media: Align date filters to left when type filters not present.
joedolson Jul 30, 2026
ce2eb54
Build/Test Tools: Forward multisite settings in the fork test matrix.
lancewillett Jul 30, 2026
593166d
REST API: Restore the global post after preparing a revision.
westonruter Jul 31, 2026
5313494
Toolbar: Serve the site icon over HTTPS on SSL admin requests.
tyxla Jul 31, 2026
e4cb98d
Administration: Add no-JS fallbacks to route-based pages.
t-hamano Jul 31, 2026
0fa1497
Media: Fix media modal positioning and spacing on mobile with infinit…
tyxla Jul 31, 2026
d82f45c
Coding Standards: Use `array_last()` to get the last array element.
SergeyBiryukov Jul 31, 2026
d98ad95
Tests: Correct `@param` tags in various test methods.
t-hamano Jul 31, 2026
084583d
Administration: Fix list table mobile viewports.
joedolson Jul 31, 2026
91138e1
Media: Fix Media grid toolbar height and 'button-link' styling when B…
afercia Jul 31, 2026
ca64484
HTML API: Respect enqueued updates in `get_attribute_names_with_prefi…
dmsnell Jul 31, 2026
d7a06bd
Accessibility: Fix labels in discussion and reading settings.
joedolson Jul 31, 2026
455fb3f
Media: Restore selection previews in the Media dialog bottom toolbar.
afercia Aug 1, 2026
1606cb0
Media: Fix a jQuery Migrate warning for disabled buttons.
t-hamano Aug 1, 2026
f408760
HTML API: Use `str_contains()` instead of `strpos()` in `WP_HTML_Tag_…
SergeyBiryukov Aug 1, 2026
47a5084
Build/Test Tools: Improve the constants defined for PHPStan.
westonruter Aug 2, 2026
29fe42e
Docs: Improve block asset registration docblocks.
westonruter Aug 2, 2026
89685c5
Users: Show/hide password button icon misaligned.
joedolson Aug 2, 2026
d1c6be6
Widgets: Show post excerpts in On This Day widget if no title.
joedolson Aug 2, 2026
a379d09
Tests: Use `assertTrue()`/`assertFalse()` instead of `assertSame()` w…
SergeyBiryukov Aug 2, 2026
07220f2
View config filters: lowercase dynamic filter names.
oandregal Aug 3, 2026
3d9a592
Docs: Restore the `@return` tag for `WP_Duotone::is_preset()`.
t-hamano Aug 3, 2026
be1c69c
Administration: Fix install button icon alignment in theme preview.
t-hamano Aug 3, 2026
5bc2c62
View config REST Endpoint: remove `search` and `page`.
oandregal Aug 3, 2026
dcf58dc
Build/Test Tools: Make runner override variable more general.
desrosj Aug 3, 2026
878af1b
External Libraries: Upgrade PHPMailer to version 7.1.1.
SergeyBiryukov Aug 3, 2026
aea966d
Media: Equalize padding for filter bar between list and grid views.
joedolson Aug 3, 2026
6693ea1
Widgets: Always render the On This Day widget.
joedolson Aug 3, 2026
5c45958
Media: Normalize non-numeric attachment `filesize` metadata.
westonruter Aug 3, 2026
4af02ef
Widgets: Revert On This Day dashboard widget.
peterwilsoncc Aug 4, 2026
c0155cd
Media: Normalize unusable `sizes` attachment metadata.
westonruter Aug 4, 2026
275a37a
Build/Test Tools: Further refine runner override variable name.
desrosj Aug 4, 2026
8c3c976
Build/Test Tools: Expand suggested extensions in `composer.json`.
westonruter Aug 4, 2026
0040ded
Build/Test Tools: Add `@phpstan-assert` on `assertIXRError` and `asse…
westonruter Aug 4, 2026
1ef9d70
XML-RPC: Validate the attachment data in `mw_newMediaObject()`.
westonruter Aug 4, 2026
03b7c8a
Media: Register the `wp-media-utils` style handle.
t-hamano Aug 4, 2026
815b17e
Networks and Sites: Correct capitalization in Upgrade Network admin n…
SergeyBiryukov Aug 4, 2026
c60dba3
Toolbar: Improve the focus style indication.
afercia Aug 4, 2026
71a2a03
Privacy: Fix checkbox alignment and highlight color.
joedolson Aug 4, 2026
a105958
Privacy: Fix checkbox alignment in request form.
joedolson Aug 4, 2026
439615d
Comments: Notify users mentioned in a note.
adamsilverstein Aug 4, 2026
5bb4b68
Media: Correct the HEIC upload error message.
adamsilverstein Aug 4, 2026
7e5d241
Media: Skip server-side image scaling during client-side media proces…
adamsilverstein Aug 4, 2026
5f5d96b
REST API: Bound the size of media sideloaded from a URL.
adamsilverstein Aug 4, 2026
7f81cb2
Networks and Sites: Improve user autocomplete search term handling.
westonruter Aug 5, 2026
3a20e59
Media: Normalize the order property in media models.
adamsilverstein Aug 5, 2026
6904e89
REST API: Always register the media creation arguments.
adamsilverstein Aug 5, 2026
e9e0be1
Build/Test Tools: Raise the PHPStan rule level to 1.
westonruter Aug 5, 2026
d8871f3
Build/Test Tools: Raise the PHPStan rule level to 2.
westonruter Aug 5, 2026
8eda2df
Build/Test Tools: Raise the PHPStan rule level to 3.
westonruter Aug 5, 2026
194916f
Build/Test Tools: Add missing baselines from PHPStan level 3 bump.
westonruter Aug 5, 2026
79d902a
Build/Test Tools: Raise the PHPStan rule level to 4.
westonruter Aug 5, 2026
b00336a
Build/Test Tools: Raise the PHPStan rule level to 5.
westonruter Aug 5, 2026
7d6fa3a
Tests: Add unit tests for `wp_privacy_exports_dir()`.
t-hamano Aug 5, 2026
08993c3
General: Bump the pinned hash for Gutenberg to `f05e40`.
t-hamano Aug 5, 2026
312b034
Coding Standards: Correct alignment of assignment operators.
SergeyBiryukov Aug 5, 2026
2768106
Tests: Add unit tests for `wp_privacy_exports_url()`.
t-hamano Aug 5, 2026
462a050
Media: Fix positioning of active spinner.
joedolson Aug 5, 2026
b9de765
I18N: Move trailing spaces out of translatable strings.
SergeyBiryukov Aug 5, 2026
884f515
Upgrade/Install: Add removed icon files to `$_old_files`.
desrosj Aug 5, 2026
2d97c2e
Upgrade/Install: Correct `$_old_files` ordering for accuracy.
desrosj Aug 5, 2026
d5b4589
WordPress 7.1 RC 1.
t-hamano Aug 5, 2026
7b887ba
Post WordPress 7.1 RC 1 version bump.
t-hamano Aug 5, 2026
83898f3
Merge remote-tracking branch 'upstream/trunk' into html-api-commoncrawl
sirreal Aug 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ on:
- trunk
- '3.[89]'
- '[4-9].[0-9]'
tags:
- '3.[89]'
- '3.[89].[0-9]+'
- '[4-9].[0-9]'
- '[4-9].[0-9].[0-9]+'
pull_request:
branches:
- trunk
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
- trunk
- '5.[3-9]'
- '[6-9].[0-9]'
tags:
- '5.[3-9]'
- '5.[3-9].[0-9]+'
- '[6-9]+.[0-9]'
- '[6-9]+.[0-9].[0-9]+'
pull_request:
branches:
- trunk
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
- trunk
- '3.[89]'
- '[4-9].[0-9]'
tags:
- '3.[89]'
- '3.[89].[0-9]+'
- '[4-9].[0-9]'
- '[4-9].[0-9].[0-9]+'
pull_request:
branches:
- trunk
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/javascript-type-checking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
branches:
- trunk
- '[7-9].[0-9]'
tags:
- '[7-9].[0-9]'
- '[7-9]+.[0-9].[0-9]+'
pull_request:
branches:
- trunk
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
- trunk
- '6.[2-9]'
- '[7-9].[0-9]'
tags:
- '6.[2-9]'
- '6.[2-9].[0-9]+'
- '[7-9].[0-9]'
- '[7-9].[0-9].[0-9]+'
pull_request:
branches:
- trunk
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/php-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
- trunk
- '5.[5-9]'
- '[6-9].[0-9]'
tags:
- '5.[5-9]'
- '5.[5-9].[0-9]+'
- '[6-9].[0-9]'
- '[6-9].[0-9].[0-9]+'
pull_request:
branches:
- trunk
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/phpstan-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
branches:
- trunk
- '[7-9].[0-9]'
tags:
- '[7-9].[0-9]'
- '[7-9]+.[0-9].[0-9]+'
pull_request:
branches:
- trunk
Expand All @@ -21,7 +18,7 @@ on:
# These files configure PHPStan. Changes could affect the outcome.
- 'phpstan.neon.dist'
- 'tests/phpstan/base.neon'
- 'tests/phpstan/baseline.php'
- 'tests/phpstan/baselines/**'
# Confirm any changes to relevant workflow files.
- '.github/workflows/phpstan-static-analysis.yml'
- '.github/workflows/reusable-phpstan-static-analysis-v1.yml'
Expand Down
46 changes: 39 additions & 7 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
- trunk
- '3.[7-9]'
- '[4-9].[0-9]'
tags:
- '[0-9]+.[0-9]'
- '[0-9]+.[0-9].[0-9]+'
pull_request:
branches:
- trunk
Expand Down Expand Up @@ -37,6 +34,7 @@ on:
# Confirm any changes to relevant workflow files.
- '.github/workflows/phpunit-tests.yml'
- '.github/workflows/reusable-phpunit-tests-*.yml'
- '.github/workflows/reusable-prepare-gutenberg.yml'
workflow_dispatch:
# Once weekly On Sundays at 00:00 UTC.
schedule:
Expand All @@ -54,6 +52,20 @@ concurrency:
permissions: {}

jobs:
# Downloads and verifies the Gutenberg build once for all PHPUnit jobs.
#
# This condition is the union of the conditions on the jobs that need it, reduced.
# The org matrices require `WordPress/wordpress-develop` or a pull request, and the
# fork matrix requires a pull request, so `wordpress-develop` or a pull request
# covers every case. Keep it in step with those jobs: a narrower condition orphans
# them, because a job that needs a skipped job is skipped too, and a broader one
# downloads a build that nothing consumes.
prepare-gutenberg:
uses: ./.github/workflows/reusable-prepare-gutenberg.yml
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}

#
# Creates a PHPUnit test job for each PHP/MySQL combination.
#
Expand All @@ -64,6 +76,7 @@ jobs:
test-with-mysql:
name: PHP ${{ matrix.php }}
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
needs: prepare-gutenberg
permissions:
contents: read
secrets:
Expand All @@ -74,7 +87,8 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-24.04 ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
# The scheduled run tests every supported PHP version. Other events test the highest and lowest of each major.
php: ${{ github.event_name == 'schedule' && fromJSON('["7.4","8.0","8.1","8.2","8.3","8.4","8.5"]') || fromJSON('["7.4","8.0","8.5"]') }}
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0', '8.4', '9.7' ]
tests-domain: [ 'example.org' ]
Expand Down Expand Up @@ -130,6 +144,8 @@ jobs:
phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
tests-domain: ${{ matrix.tests-domain }}
report: ${{ matrix.report || false }}
gutenberg-artifact: gutenberg-build
gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }}

#
# Creates a PHPUnit test job for each PHP/MariaDB combination.
Expand All @@ -143,6 +159,7 @@ jobs:
test-with-mariadb:
name: PHP ${{ matrix.php }}
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
needs: prepare-gutenberg
permissions:
contents: read
secrets:
Expand All @@ -153,7 +170,8 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-24.04 ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
# The scheduled run tests every supported PHP version. Other events test the highest and lowest of each major.
php: ${{ github.event_name == 'schedule' && fromJSON('["7.4","8.0","8.1","8.2","8.3","8.4","8.5"]') || fromJSON('["7.4","8.0","8.5"]') }}
db-type: [ 'mariadb' ]
db-version: [ '5.5', '10.3', '10.5', '10.6', '10.11', '11.4', '11.8' ]
multisite: [ false, true ]
Expand Down Expand Up @@ -182,6 +200,8 @@ jobs:
memcached: ${{ matrix.memcached }}
phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
report: false
gutenberg-artifact: gutenberg-build
gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }}

#
# Creates PHPUnit test jobs to test MariaDB and MySQL innovation releases.
Expand All @@ -197,6 +217,7 @@ jobs:
test-innovation-releases:
name: PHP ${{ matrix.php }}
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
needs: prepare-gutenberg
permissions:
contents: read
secrets:
Expand All @@ -207,7 +228,8 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-24.04 ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
# The scheduled run tests every supported PHP version. Other events test the highest and lowest of each major.
php: ${{ github.event_name == 'schedule' && fromJSON('["7.4","8.0","8.1","8.2","8.3","8.4","8.5"]') || fromJSON('["7.4","8.0","8.5"]') }}
db-type: [ 'mysql', 'mariadb' ]
db-version: [ '12.1' ]
multisite: [ false, true ]
Expand All @@ -228,6 +250,8 @@ jobs:
memcached: ${{ matrix.memcached }}
phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
report: false
gutenberg-artifact: gutenberg-build
gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }}

#
# Runs the HTML API test group.
Expand All @@ -240,6 +264,7 @@ jobs:
html-api-test-groups:
name: ${{ matrix.label }}
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
needs: prepare-gutenberg
permissions:
contents: read
secrets:
Expand All @@ -260,6 +285,8 @@ jobs:
db-type: ${{ matrix.db-type }}
db-version: ${{ matrix.db-version }}
phpunit-test-groups: ${{ matrix.phpunit-test-groups }}
gutenberg-artifact: gutenberg-build
gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }}

#
# Runs unit tests for forks.
Expand All @@ -271,6 +298,7 @@ jobs:
limited-matrix-for-forks:
name: PHP ${{ matrix.php }}
uses: ./.github/workflows/reusable-phpunit-tests-v3.yml
needs: prepare-gutenberg
permissions:
contents: read
secrets:
Expand Down Expand Up @@ -318,16 +346,20 @@ jobs:
php: ${{ matrix.php }}
db-version: ${{ matrix.db-version }}
db-type: ${{ matrix.db-type }}
multisite: ${{ matrix.multisite }}
memcached: ${{ matrix.memcached || false }}
phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
phpunit-test-groups: ${{ matrix.phpunit-test-groups || '' }}
gutenberg-artifact: gutenberg-build
gutenberg-sha: ${{ needs.prepare-gutenberg.outputs.gutenberg-sha }}

slack-notifications:
name: Slack Notifications
uses: ./.github/workflows/slack-notifications.yml
permissions:
actions: read
contents: read
needs: [ test-with-mysql, test-with-mariadb, test-innovation-releases, html-api-test-groups, limited-matrix-for-forks ]
needs: [ prepare-gutenberg, test-with-mysql, test-with-mariadb, test-innovation-releases, html-api-test-groups, limited-matrix-for-forks ]
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
with:
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
Expand Down
95 changes: 94 additions & 1 deletion .github/workflows/reusable-phpstan-static-analysis-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
# - Builds WordPress.
# - Configures caching for PHPStan static analysis scans.
# - Runs PHPStan static analysis (with Pull Request annotations).
# - Checks whether the baselines need regenerating.
# - Saves the PHPStan result cache.
# - Ensures version-controlled files are not modified or deleted.
phpstan:
Expand Down Expand Up @@ -93,7 +94,99 @@ jobs:

- name: Run PHP static analysis tests
id: phpstan
run: composer run phpstan -- -vvv --error-format=checkstyle | cs2pr --errors-as-warnings --graceful-warnings
run: |
# The report is written to a file as well as piped to cs2pr, so that the step below
# can look at it.
#
# cs2pr exits successfully so that reported errors annotate the pull request without
# failing the run. A pipeline reports only the status of its last command, so that
# also discards the status of the analysis itself. Recover it from PIPESTATUS.
composer run phpstan -- -vvv --error-format=checkstyle | tee "${RUNNER_TEMP}/phpstan-report.xml" | cs2pr --errors-as-warnings --graceful-warnings
status="${PIPESTATUS[0]}"

# PHPStan exits 1 when it has errors to report, which is the expected case here and
# is what the annotations are for. Anything higher means it did not finish at all,
# which would otherwise pass silently, since the discarded status was the only sign.
if [ "${status}" -gt 1 ]; then
echo "::error title=PHPStan did not complete::The analysis exited with status ${status}, so the code was not fully checked. This is a failure of the run itself rather than a problem found in the code."
exit "${status}"
fi

# An ignored error that no longer occurs, or occurs a different number of times, is
# reported under an `ignore.*` identifier. That is not something to fix in the code: the
# usual cause is that the error *was* fixed, leaving a baseline describing a state that
# no longer exists. PHPStan does not allow those reports to be ignored or baselined.
#
# The analysis above is reported as warnings, so this would otherwise surface as a
# passing run carrying an annotation that reads like a complaint about a fix. Call it
# out on its own, and say what to do about it.
#
# Detection is on the identifier rather than the message, which is prose and may be
# reworded in any release. The checkstyle format carries it in the `source` attribute.
- name: Check whether the baselines need regenerating
if: ${{ !cancelled() }}
env:
BASELINES_URL: ${{ github.server_url }}/${{ github.repository }}/tree/${{ github.sha }}/tests/phpstan/baselines
README_URL: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/tests/phpstan/README.md
run: |
# This step runs even when the analysis above it failed, in which case the report may
# never have been written. That failure is reported there, so there is nothing to add
# here beyond staying quiet about a file that was never going to exist.
if [ ! -f "${RUNNER_TEMP}/phpstan-report.xml" ]; then
exit 0
fi

# Leave the run alone unless PHPStan reported an ignore error, because everything
# below concerns an ignore configuration that no longer describes the code, and
# nothing else. Those errors are `ignore.unmatched`, where a pattern matched nothing
# at all, and `ignore.count`, where it matched a different number of times than the
# entry records. The `ignore.` prefix is matched rather than those two names so that
# any later addition to the group is caught as well.
if ! grep -q 'source="ignore\.' "${RUNNER_TEMP}/phpstan-report.xml"; then
exit 0
fi

# The summary is Markdown, and its code spans and fences are written literally, so the
# heredoc is quoted to keep the backticks out of the shell's hands. The links are
# written in reference style for the same reason: the URLs are the only part needing
# a variable, so defining them afterwards keeps the whole of the prose in here.
#
# A newline renders as a line break rather than a space, so each paragraph is one
# line however long that makes it, and the rendered summary wraps to its own width.
cat >> "${GITHUB_STEP_SUMMARY}" <<'SUMMARY'
## PHPStan baselines are out of date

An ignored error no longer occurs, or occurs a different number of times, so PHPStan reported it under an `ignore.unmatched` or `ignore.count` identifier.

**If you fixed the error, this is expected.** Each baseline entry records an exact count for a specific file, so that a new occurrence of an already baselined error is reported rather than absorbed. That same exactness means fixing one leaves the baseline describing a state that no longer exists. There is nothing to fix in the code; the baselines just need to catch up.

Regenerate them and commit the result:

```bash
npm run typecheck:php:baselines
```

or, outside the Docker environment:

```bash
composer phpstan:baselines
```

That rewrites the files under [`tests/phpstan/baselines`][baselines], deletes any whose errors are now all fixed, and updates the list of them in `phpstan.neon.dist`.

Where the report names an `@phpstan-ignore` annotation in the code rather than a baseline entry, remove that annotation instead; regenerating will not clear it.

See [`tests/phpstan/README.md`][readme] for details.

SUMMARY

{
echo "[baselines]: ${BASELINES_URL}"
echo "[readme]: ${README_URL}"
} >> "${GITHUB_STEP_SUMMARY}"

echo "::error title=PHPStan baselines are out of date::An ignored error no longer occurs, or occurs a different number of times. If you fixed it, that is expected: run \`npm run typecheck:php:baselines\` or \`composer phpstan:baselines\` and commit the updated baselines. See ${README_URL}"
exit 1

- name: "Save result cache"
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
Expand Down
Loading
Loading