-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Build: Generate plugin version and make the build script plugin agnostic #72707
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in 88b6f5a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18866198976
|
| /** | ||
| * Generate PHP file for version constant. | ||
| */ | ||
| async function generateVersionPhp() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of duplication between this and generateScriptRegistrationPhp. Maybe we should generalize a function for writing a file from a template with a given set of variables? (maybe some default variables)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed :) I'm planning to do some kind of cleanup PR to make things more digestible in the build tool.
|
|
||
| $git_commit = trim( shell_exec( 'git rev-parse HEAD' ) ); | ||
|
|
||
| echo "define( 'GUTENBERG_GIT_COMMIT', '$git_commit' );\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to preserve this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see it used anywhere.
Related #72032
What
I noticed that the scripts auto-registration relied on a plugin version that is gutenberg specific. The build tool itself is meant to be plugin agnostic so this PR injects the version during build time. I also noticed that we already had a build tool that we only run during plugin release that did the same, so I removed that one and consolidated in the default build tool.
Testing Instructions
E2E tests should pass (scripts are used everywhere)