Skip to content

Repair wp/5.1 branch Actions: Use rest_get_server() in the autosaves controller test - #85673

Merged
desrosj merged 1 commit into
fix-actions-5.1/fix-list-test-modifier-helperfrom
fix-actions-5.1/fix-autosaves-test-server
Oct 29, 2026
Merged

desrosj merged 1 commit into
fix-actions-5.1/fix-list-test-modifier-helperfrom
fix-actions-5.1/fix-autosaves-test-server

Conversation

@desrosj

@desrosj desrosj commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Part of #83422.

What?

Changes WP_Test_REST_Autosaves_Controller::test_registered_query_params() in phpunit/class-rest-autosaves-controller-test.php to call rest_get_server()->dispatch() instead of $this->server->dispatch().

Why?

With the environment fixed (#85669), the PHP job runs the tests, and one errors:

1) WP_Test_REST_Autosaves_Controller::test_registered_query_params
Error: Call to a member function dispatch() on null

/app/phpunit/class-rest-autosaves-controller-test.php:156

Tests: 132, Assertions: 2503, Errors: 1, Skipped: 1.

The WordPress 5.1 test suite's REST API test case (tests/phpunit/includes/testcase-rest-api.php) no longer sets a server property. Every other test in this file already calls rest_get_server().

How?

A one-line change that makes the test match the rest of the file, and WordPress 5.1's own copy of this test (tests/phpunit/tests/rest-api/rest-autosaves-controller.php), which calls rest_get_server() on the same line.

trunk never fixed this line: it deleted the whole file in #13408 once the autosaves endpoint was in WordPress 5.0. Porting that would remove the plugin's REST API code from this branch, which is out of scope for a CI repair.

Testing Instructions

The PHP job runs on this pull request.

Use of AI Tools

This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.

🤖 Generated with Claude Code

@desrosj desrosj added the [Type] Build Tooling Issues or PRs related to build tooling label Oct 26, 2026
@desrosj desrosj self-assigned this Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 94276944-a4ed-4369-910e-8be3eb630d7c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 27, 2026 •

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>
Co-authored-by: rejaulalomkhan <rejaulalomkhan@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@desrosj
desrosj force-pushed the fix-actions-5.1/fix-autosaves-test-server branch from 8865823 to 8fb4267 Compare October 27, 2026 21:02

@rejaulalomkhan rejaulalomkhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the clean fix, @desrosj! Calling rest_get_server()->dispatch() accurately aligns with the rest of the test case and resolves the null property access on the wp/5.1 test runner. All PHP test suites pass cleanly. LGTM!

AI Review: Google Antigravity (Gemini 2.5 Flash)

@andrewserong andrewserong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, too!

@desrosj
desrosj force-pushed the fix-actions-5.1/fix-autosaves-test-server branch from 8fb4267 to 6a64aee Compare October 29, 2026 12:48
@desrosj
desrosj removed this pull request from stack #85678 October 29, 2026 17:59
@desrosj
desrosj force-pushed the fix-actions-5.1/fix-autosaves-test-server branch from 6a64aee to 6820762 Compare October 29, 2026 18:00
@desrosj
desrosj added this pull request to stack #85963 October 29, 2026 18:01
@desrosj
desrosj force-pushed the fix-actions-5.1/fix-autosaves-test-server branch from 6820762 to 9950ed4 Compare October 29, 2026 20:21
@desrosj
desrosj merged commit 15b143e into wp/5.1 Oct 29, 2026
6 checks passed
@desrosj
desrosj deleted the fix-actions-5.1/fix-autosaves-test-server branch October 29, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants