Skip to content

Multi step plugin archive #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Mar 22, 2024
Merged

Multi step plugin archive #117

merged 24 commits into from
Mar 22, 2024

Conversation

Biont
Copy link
Member

@Biont Biont commented Mar 19, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Refactoring

What is the current behavior? (You can also link to an open issue here)
build-plugin-archive.yml uses a single php version for bundling dependencies and executing build tools.
WP's committment to supporting php down to 7.0 makes it increasingly cumbersome to support "one" php platform requirement for production AND development/building.

We have been accepting this limitation in order to streamline our packaging across most of our projects - and it's been a very solid base. But the fact remains that the php ecosystem is moving on while the php7 support requirement for WP packages is not going anywhere. Since this gap is only getting wider, we need to find a better approach

What is the new behavior (if this is a feature change)?
The logic of the workflow has been split into 3 parts:

  1. Production dependencies - checkout the repo and composer install using the ancient PHP version
  2. Build steps - execute all relevant build tools using a much more modern php version. We also no longer expect these to be present in dev dependencies: If we find a config, we install the tool globally.
  3. Archive creation - add final touches and create the resulting archive

Note: There is no strict technical requirement for step 3 to be in a separate job. It adds a little overhead, but I think at this point, it adds a nice separation of concerns in that it keeps a few environment variables and data handling out of the other steps.

The individual jobs each produce their own "interim" artifact which is then picked up by the next one. This makes it easy to spot and debug where something went wrong:

screenshot_2024-03-20-120520


This change frees us from having to use EOL versions of common tools and also paves the way for modernization of our own tools, for example dropping PHP 7 in Composer Asset Compiler. It also allows us to introduce third-party tools like php-scoper with ease since we are no longer subject to the php version constraints of individual projects.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No

Other information:

@Biont Biont requested review from Chrico and tyrann0us March 19, 2024 15:31
@Biont Biont marked this pull request as ready for review March 20, 2024 10:59
Copy link
Member

@tyrann0us tyrann0us left a comment

Choose a reason for hiding this comment

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

Thanks for incorporating the changes so quickly. LGTM. Left a minor comment that doesn't stop me from approving. 💪🏽

Co-authored-by: Philipp Bammes <[email protected]>
Signed-off-by: Moritz Meißelbach <[email protected]>
@tyrann0us tyrann0us merged commit ce900b7 into main Mar 22, 2024
@tyrann0us tyrann0us deleted the feature/multi-step-plugin-archive branch March 22, 2024 08:04
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.

2 participants