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

[SITE-3292] add @maybe-add-symlinks to post-update-cmd #175

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

jazzsequence
Copy link
Contributor

Add the symlinks if they don't already exist.

When applying the upstream updates from 1.32.4, it was discovered that the symlinks to wp-* files (and the index.php file creation) is not run leaving the site in an empty state. When cache expires, the site will be broken with the files missing. (Perhaps this was the issue all along?)

This uses the existing ComposerScripts class and preUpdate hook (hooked to the composer pre-update-cmd) to update the composer.json to add @maybe-install-symlinks if that's not already part of the post-update-cmd. The post-update-cmd is also created by this script (if it did not exist already), so this change checks for the existance of the script we're adding and adds it if it's not there, which is then run after the composer update is executed.

add the symlinks if they don't already exist
@jazzsequence jazzsequence requested a review from a team as a code owner February 10, 2025 18:58
@jazzsequence jazzsequence self-assigned this Feb 10, 2025
This update applies the same check to create symlinks to files in the `web/` directory that is run on `composer install` commands to `composer update` as well. This ensures that symlinks are created with upstream updates are applied (`composer update`) as well as when new commits to a site repository are pushed (`composer install`).

For more information, see https://docs.pantheon.io/release-notes/2025/02/wordpress-composer-managed-1-32-5
@jazzsequence jazzsequence force-pushed the site-3578-post-update-cmd branch from e84ffff to 6a719df Compare February 10, 2025 20:36
@jazzsequence jazzsequence merged commit 7a298e8 into default Feb 10, 2025
11 checks passed
@jazzsequence jazzsequence deleted the site-3578-post-update-cmd branch February 10, 2025 21:19
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