Skip to content

Run plain-permalinks login test against the shared integration server#1411

Merged
crazytonyli merged 1 commit into
jkmassel/issue-1366from
pr-1369-test
Jun 26, 2026
Merged

Run plain-permalinks login test against the shared integration server#1411
crazytonyli merged 1 commit into
jkmassel/issue-1366from
pr-1369-test

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

Implements this suggestion: #1369 (comment)

Replace the dedicated plain-permalinks WordPress instance with a serial
test that flips the shared test server to plain permalinks via wp-cli,
runs API discovery, and restores the original permalink structure as its
last step. This removes the extra docker-compose stack, setup script,
Makefile targets, and Buildkite step in favor of the existing mutable
test harness.
@crazytonyli crazytonyli requested a review from jkmassel June 25, 2026 23:35
@wpmobilebot

Copy link
Copy Markdown
Collaborator

⚠️ CHANGELOG.md was not updated in this PR.

Every PR should add an entry under the ## [Unreleased] section of CHANGELOG.md describing the change for our users. The format follows Keep a Changelog 1.0.0 — use one of:

  • ### Added — for new features
  • ### Changed — for changes in existing functionality (prefix **BREAKING:** if breaking)
  • ### Deprecated — for soon-to-be-removed features
  • ### Removed — for now-removed features
  • ### Fixed — for any bug fixes
  • ### Security — for vulnerability fixes

If the change genuinely has no user-visible impact (e.g. CI-only tweaks, internal refactors), add a short entry under ### Changed noting that.

@wpmobilebot

Copy link
Copy Markdown
Collaborator

XCFramework Build

This PR's XCFramework is available for testing. Add to your Package.swift:

.package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1411")

Built from 59449eb

@crazytonyli crazytonyli merged commit 964623d into jkmassel/issue-1366 Jun 26, 2026
30 of 34 checks passed
@crazytonyli crazytonyli deleted the pr-1369-test branch June 26, 2026 00:32
crazytonyli added a commit that referenced this pull request Jul 6, 2026
* Support plain-permalink REST API root on self-hosted sites

On plain-permalink sites, WordPress advertises the REST API root as
`…/index.php?rest_route=/` rather than `…/wp-json`. Discovery accepted
that URL, but `WpOrgSiteApiUrlResolver` then path-extended it to build
endpoint URLs — producing `…/index.php/wp/v2/users/me?rest_route=/`,
which WordPress routes to the API index. Every endpoint silently
collapsed, breaking self-hosted login (#1366).

Detect the query-parameter form on the discovered `api_root_url` and
append into the `rest_route` value instead of the path. The URL itself
carries the form information, so no callers or constructors change.

Includes a dedicated Docker setup (`docker-compose.plain-permalinks.yml`
+ `make start-plain-permalinks-test-server`) and a regression test that
runs against a real plain-permalinks WordPress instance.

Fixes #1366

* wp_rs_cli: acknowledge ?rest_route= API root form

The CLI's `--api-root` flag never actually enforced a `/wp-json` suffix
in code — only the help text and error message claimed it did. Now that
the resolver handles plain-permalink sites, update the help text and
README example to document both forms and drop the misleading error
message.

* ci: run plain-permalinks integration test in Buildkite

Adds a step in the e2e group that brings up the dedicated WordPress
instance and runs the regression test from #1366. Rust is installed on
the agent (matching the pattern used by the Kotlin step), then cargo
test runs on the host against the docker-mapped port 8081.

* Add CHANGELOG entry for #1366

Documents the plain-permalink REST API root fix under [Unreleased] →
Fixed, per the project's changelog convention.

* ci: run plain-permalinks test inside the WordPress container

The first CI attempt ran `cargo test` directly on the Buildkite agent,
which has no OpenSSL dev libraries — `openssl-sys` failed to build. It
only passed locally because the dev Mac has openssl.

Run cargo *inside* the dedicated WordPress container instead, matching
the main `test-rust-integration` flow. The container image already
provides the Rust toolchain and `libssl-dev`. Inside the container the
site is reachable at `http://localhost` (port 80), so `wp core install`
now configures that URL rather than the host-mapped `:8081` (which the
compose file still exposes for local debugging).

* Run plain-permalinks login test against the shared integration server (#1411)

Replace the dedicated plain-permalinks WordPress instance with a serial
test that flips the shared test server to plain permalinks via wp-cli,
runs API discovery, and restores the original permalink structure as its
last step. This removes the extra docker-compose stack, setup script,
Makefile targets, and Buildkite step in favor of the existing mutable
test harness.

---------

Co-authored-by: Tony Li <tony.li@automattic.com>
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.

3 participants