Skip to content

Let a release ship the main plugin file under another name - #58

Merged
ahegyes merged 1 commit into
trunkfrom
feat/archive-entry-file
Oct 29, 2026
Merged

ahegyes merged 1 commit into
trunkfrom
feat/archive-entry-file

Conversation

@ahegyes

@ahegyes ahegyes commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

A release could ship the main plugin file only under the name entry-file gives it. WordPress identifies an active plugin by its folder and file, so a plugin whose earlier releases shipped another main file, such as a 1.x bootstrap.php, could not give its source a new name: the update would remove the file WordPress has active and deactivate the plugin on every site.

  • Input: reusable-release.yml takes an optional archive-entry-file, which must be a PHP file name.
  • Rename: a new build step, "Name the entry file for the archive", runs after every step that reads the source's headers (version, text domain, POT, header floors) and before wp dist-archive. It renames the entry file to archive-entry-file, and refuses a name the project already has.
  • One artifact: the zip that the artifact test, the GitHub release and the wp.org deploy share by digest therefore ships the file under that name. The artifact test activates and reads the plugin by slug, so it exercises the renamed file.
  • Assertion: "Assert required files present" checks the archive name when the input is set.
  • Docs: docs/workflows.md lists the input, the step and its failure, and docs/scripts-contract.md the main file's shipped name.

Workflow +22 −1, tests +84, docs +5 −3 (2 files).

Type of change

  • PHP source (Composer scripts, php-scoper config)
  • Reusable workflow (.github/workflows/reusable-*.yml)
  • PHPCS / PHPStan ruleset (php/quality-assurance/)
  • Node config (eslint, stylelint, playwright, tsconfig)
  • Documentation
  • Other

Checklist

  • Tests added or updated (PHPUnit suites under tests/Unit/):
    • ReleaseWorkflowTest: the input's validation (unset, a root file, a path in a subfolder, a name without .php), the rename, the refusal to replace a project file, and the required-files assertion under the archive name and under the source name;
    • six of the eight rows failed before the change; the two that passed are the valid-by-default validation rows.
  • composer test passes locally:
    • composer quality-check: PHPCS on both profiles, PHPStan and 161 tests;
    • npm run lint:all, actionlint and zizmor pass.
  • If this changes a reusable workflow's inputs/outputs, docs/workflows.md is updated to reflect the new contract: the input's row, the build job's description and its failure list.
  • If this changes a ruleset, downstream consumer behavior is considered (no ruleset changes)

Review points.

  • Source and shipped names differ: with the input set, only the built zip upgrades a site running an earlier release in place; a checkout of the source dropped onto such a site deactivates it.
  • POT references: the POT is regenerated before the rename, so its header references name the source file; translate.wordpress.org builds language packs from SVN.
  • Mutation testing: composer quality-check:all's Infection run hit Composer's 300 s process timeout locally. CI does not run it, and its source directories are untouched.

The release shipped the main plugin file under the name entry-file
gives it. WordPress identifies an active plugin by its folder and file,
so a plugin whose earlier releases shipped another main file, such as a
1.x bootstrap.php, could not give its source a new name: the update
would remove the file WordPress has active and deactivate the plugin on
every site.

The release takes an optional archive-entry-file. After the checks that
read the source's headers, the build renames the entry file to it,
refusing a name the project already uses, so the zip that the artifact
test, the GitHub release and the wp.org deploy share ships the file
under that name, and the required-files assertion checks it. Rows cover
the input's validation, the rename, the refusal and the assertion, and
docs/workflows.md and docs/scripts-contract.md document the input.

Assisted-by: Claude Code:claude-opus-5-5
@ahegyes
ahegyes merged commit f420c38 into trunk Oct 29, 2026
29 checks passed
@ahegyes
ahegyes deleted the feat/archive-entry-file branch October 29, 2026 19:18
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.

1 participant