-
Notifications
You must be signed in to change notification settings - Fork 28
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
Preserve paths can fail if misconfigured #42
Comments
I can't make a good reproduction case as it seems Composer 2 extracts asynchronously in background, so you have this issue where sometimes it extracts in time before the preserve checks for the path and thus backup again, but then you can have scenario where it doesn't extract before the next package begins processing and so the preserve-paths doesn't detect it and everything then works fine |
With the following in the path location:
This reproduces it. Create a module folder in Workaround is to preserve |
It's easy to misconfigure preserve paths.
If you preserve a path that, perhaps, receives a single file like a .gitkeep (for Drupal 7 for example the sites/all/themes folder would receive this), then you can hit issues where you lose the data.
I think part of the issue is metapackages, as those cause a preserved path to be encountered twice. So packages like date_api, migrate_ui, and field_object can all cause secondary backups if the backup path overlaps.
Other part of the issue is the overlapping configuration - if you do have a preserve path which has its folder or some contents existing in some packages, even if you don't want them and did want to just overwrite it, then all it takes is a metapackage and it will mess up.
Perhaps the fix is metapackage exclusion, but I worry there is some cases still where paths overlap (drupal/drupal for example overlaps everything - there's nothing to say there would be a drupal/parent-module package that installs to modules/contrib/parent and then a drupal/parent-module-child-module package that installs to modules/contrib/parent/modules/child... and this would also cause the issue above if you configured an overlapping path such as modules/contrib/parent/modules)
Perhaps also need to count the number of times preserve is hit on a path and only preserve once, and then at the end once all packages affecting it are installed it is only then restored?
The text was updated successfully, but these errors were encountered: