Skip to content

Use MySQL's default login method in the prepare-mysql action - #286

Open
triple0t wants to merge 3 commits into
trunkfrom
breaking/prepare-mysql-default-auth
Open

triple0t wants to merge 3 commits into
trunkfrom
breaking/prepare-mysql-default-auth

Conversation

@triple0t

@triple0t triple0t commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Changes proposed in this Pull Request:

Breaking change, for the actions-v4.0.0 release.

prepare-mysql now only starts MySQL. It no longer switches the root user to mysql_native_password. Root keeps MySQL's default login method, caching_sha2_password.

Why:

Who is affected: workflows that test PHP 7.3 or older against the runner's MySQL. They can keep only this action on woocommerce/grow/prepare-mysql@actions-v3 (that tag points to 3.0.7, which works on Ubuntu 26.04) and move their other grow actions to v4. Workflows on PHP 7.4 or newer need no change.

Also in this PR, like #238 did for v3:

  • Every action README example now uses @actions-v4.
  • The release-process examples in the package README move to v4.x.

Detailed test instructions:

  1. Check the "GitHub Actions Self-Test" run on this PR. The four prepare-mysql jobs (ubuntu-24.04 and ubuntu-26.04, each with PHP 7.4 and 8.5) should pass.
  2. Open one job. "Verify root uses caching_sha2_password" should print caching_sha2_password.
  3. In the same job, "Verify PHP connects over TCP without TLS and over the socket" should print four "connected" lines (mysqli and PDO, over 127.0.0.1 and localhost), each with an empty TLS cipher. Before each connection the step runs FLUSH PRIVILEGES, so PHP does the full login, not the cached one.
  4. Before this PR: on v3, root uses mysql_native_password on both runners (see the v3 self-test on Support MySQL 8.4 in the prepare-mysql action (Ubuntu 26.04 runners) #284).

I also ran the test build (breaking/prepare-mysql-default-auth-test-build) in two private plugin repos, on both ubuntu-24.04 and ubuntu-26.04. Both connect with localhost, which uses the socket. All jobs passed:

  • AutomateWoo: PHP unit tests on PHP 7.4, 8.0 and 8.5 (8 jobs).
  • AutomateWoo Birthdays: PHP integration tests on PHP 7.4 and 8.5 (4 jobs).

The logs show only systemctl start mysql.service, then Ver 8.4.11-0ubuntu0.26.04.1 on 26.04 and Ver 8.0.46-0ubuntu0.24.04.4 on 24.04.

Additional details:

Release order: actions-v3.0.7 is already released (actions-v3 points to it), so v3 users keep working on Ubuntu 26.04 after this ships.

Breaking change. The action now only starts MySQL. It no longer
switches root to mysql_native_password, which MySQL deprecated, turned
off in 8.4 and removed in 9.0. Root keeps caching_sha2_password, which
PHP 7.4 and newer support.

Workflows that test PHP 7.3 or older against this MySQL should stay on
actions-v3.

The self-test now checks that PHP 7.4 and 8.5 connect with mysqli and
PDO over TCP without TLS and over the socket, on ubuntu-24.04 and
ubuntu-26.04.
Point the usage examples in every action README to actions-v4, and
move the release-process examples in the package README to v4.x.
@triple0t
triple0t requested review from eason9487 and a balanced review from Copilot and removed request for eason9487 November 6, 2026 20:47

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.

🟢 Approval recommended

No active review issues are reported for the v4 update that preserves the runner’s default MySQL authentication.

No open issues 🎉

What changed in this PR

Prepares the GitHub Actions package for v4 by simplifying prepare-mysql to preserve the runner’s default authentication instead of forcing mysql_native_password. Workflows testing PHP 7.3 or older are directed to keep this action on v3.

Changes:

  • Removes MySQL authentication overrides while retaining service startup and version logging.
  • Expands self-tests across Ubuntu 24.04/26.04 and PHP 7.4/8.5, checking authentication and uncached mysqli/PDO connections over TCP and sockets.
  • Updates action usage examples to @actions-v4 and refreshes release-process documentation.
File Description
packages/​github-actions/​README.md Updates MySQL description and release-version examples.
packages/​github-actions/​actions/​update-version-tags/​README.md Updates usage example to v4.
packages/​github-actions/​actions/​stylelint-annotation/​README.md Updates usage example to v4.
packages/​github-actions/​actions/​publish-extension-dev-build/​README.md Updates usage example to v4.
packages/​github-actions/​actions/​prepare-php/​README.md Updates usage examples to v4.
packages/​github-actions/​actions/​prepare-node/​README.md Updates usage examples to v4.
packages/​github-actions/​actions/​prepare-mysql/​README.md Documents default authentication and v3 migration guidance.
packages/​github-actions/​actions/​prepare-mysql/​action.yml Removes authentication overrides; keeps MySQL startup.
packages/​github-actions/​actions/​prepare-extension-release/​README.md Updates usage example to v4.
packages/​github-actions/​actions/​phpcs-diff/​README.md Updates usage examples to v4.
packages/​github-actions/​actions/​merge-trunk-develop-pr/​README.md Updates usage example to v4.
packages/​github-actions/​actions/​hook-documentation/​readme.md Updates usage example to v4.
packages/​github-actions/​actions/​get-release-notes/​README.md Updates usage examples to v4.
packages/​github-actions/​actions/​get-plugin-releases/​README.md Updates usage examples to v4.
packages/​github-actions/​actions/​eslint-annotation/​README.md Updates usage example to v4.
packages/​github-actions/​actions/​coverage-report/​README.md Updates coverage and PHP action examples to v4.
packages/​github-actions/​actions/​branch-label/​README.md Updates usage example to v4.
packages/​github-actions/​actions/​automerge-released-trunk/​README.md Updates usage example to v4.
.github/​workflows/​github-actions-self-test.yml Adds PHP matrix and default-authentication connection checks.

Review effort: Balanced

@costasovo costasovo 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.

Thank you for looking into this! Checked the self-test logs against the test steps and the AutomateWoo and AutomateWoo Birthdays runs against the test build. All pass on both Ubuntu 24.04 and 26.04, and root uses caching_sha2_password. Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants