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

Packages (targeted by patches) reinstalled on fresh install #71

Open
allanpaiste opened this issue Feb 24, 2021 · 1 comment
Open

Packages (targeted by patches) reinstalled on fresh install #71

allanpaiste opened this issue Feb 24, 2021 · 1 comment
Labels

Comments

@allanpaiste
Copy link
Contributor

allanpaiste commented Feb 24, 2021

The current logic has been built so that when there are patches that have not yet been applied, the packages that they target are re-installed beforehand - even when there are no patches applied previously that would call such a re-install.

Pre-requisites

  1. Have a project that uses the plugin
  2. Have patches defined that target some package
  3. Have no vendor folder (clean install)
  4. Have composer.lock (just makes the repetition faster)

To Reproduce

Steps to reproduce the behaviour:

  1. composer install -vvv

Expected

  1. packages are installed
  2. log contains information about patches being collected
  3. patches are applied

Actual

  1. packages are installed
  2. log contains information about patches being collected
  3. patched packages are again re-installed (note: unzipped from cache, not re-downloaded, but still)
  4. patches are applied

Notes

This has always been the way the plugin works, but can give extra speed boost when avoided if possible.

Unfortunately I can't recall what exactly caused this to be the way it got implemented, but I do remember being more frugal about resets to cause some edge-case issues when using bundled patches. The test-coverage in terms of scenarios has to be greatly improved before this can be properly tightened up.

@allanpaiste allanpaiste changed the title Packages (targeted by patches) reinstalled even when no patches applied Packages (targeted by patches) reinstalled on fresh install Feb 24, 2021
@allanpaiste
Copy link
Contributor Author

Most fool-proof solution:

Start tracking the - are patches applied or not based on comparing if the file-tree has changes - to see if the actual code has changes or not (rather than relying on information at installed.json).

If nothing has changed for a specific package (or the check can even be done against specific files), skip the planned reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant