Skip to content
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

Specify a composer autoloader-suffix such that the Composer class names don't change each deploy. #411

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

dd32
Copy link
Member

@dd32 dd32 commented Jun 23, 2023

Due to how composer works, it generates a new autoloader classname on each build, this is generated from a hash of the built configuration - which includes the git hash of the latest git commit to this repo.

This results in changes such as this, without any meaningful changes to the actual composer autoloaders:

-class ComposerStaticInitd304aa995aee3f8f33a4ed8212934834
+class ComposerStaticInitafee523dbfd1bd7f873d099f361b18c0

As there should only ever be a singular instance of wporg-mu-plugins loaded, we can instead specify a static suffix:

-class ComposerStaticInitd304aa995aee3f8f33a4ed8212934834
+class ComposerStaticInit_wporg_mu_plugins

This shouldn't cause any compat issues, and will reduce the changes in build diffs, and avoid situations where the new Class is loaded but the old classname is called, which can happen in a race-condition during WordPress.org deploys.

…es don't change each deploy. This resolves fatals during deploy.
Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@dd32 dd32 merged commit fa41a30 into trunk Jun 23, 2023
2 checks passed
@dd32 dd32 deleted the composer/static_suffix branch June 23, 2023 01:43
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