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

Always load remote package info for path repositoriy packages #9751

Closed
naderman opened this issue Mar 4, 2021 · 6 comments · Fixed by #9765
Closed

Always load remote package info for path repositoriy packages #9751

naderman opened this issue Mar 4, 2021 · 6 comments · Fixed by #9765
Labels
Milestone

Comments

@naderman
Copy link
Member

naderman commented Mar 4, 2021

To improve working with path repositories any composer update command should always read the composer.json info from the remote path, rather than using data stored in the local lock file. As the path repo contents update with the remote directory it's easy to forget that you need to still actually run an update of the dependency in a path repo to get its dependencies updated properly. So this should just happen automatically anytime you update anything.

@stof
Copy link
Contributor

stof commented Mar 4, 2021

so this would mean that packages present in path repositories would always be automatically whitelisted ?

@naderman
Copy link
Member Author

naderman commented Mar 4, 2021

@stof I guess so? Maybe that's a terrible idea?

@stof
Copy link
Contributor

stof commented Mar 4, 2021

I would find this quite confusing actually, if a partial update is implicitly whitelisting more stuff.

Note that this only applies to partial updates anyway. A full composer update is already using the remote package info as the package is not locked in such case.

@naderman
Copy link
Member Author

naderman commented Mar 4, 2021

Well it's also somwhat confusing that, if you do a partial update for some other package, then you still already have the code of a newer version of the path repo package, which works fine with that newer dependency, but the path repo package's dependencies are still suck on the old versions.

I guess in some ways though this is similar to how we automatically update checked out branches without resolving their dependencies though.

@Seldaek
Copy link
Member

Seldaek commented Mar 9, 2021

Yeah I am also not so sure about this. On one side it seems like a good idea and I definitely have had cases where I forgot to update the path repo too, but usually it's pretty clear anyway when you get a conflict because you forgot to do it. On the other hand it may trigger unexpected things, I am not sure. It does seem like the more intuitive thing to do though at least when the code is symlinked that you'd get the latest deps always. If the code is not symlinked though I'd tend to see it the other way.

Maybe worth a try to see how it behaves for a while in 2.1 snapshots if it's easy enough to implement, then worst case we revert before a release, or put it behind a config option if needed.

@Seldaek Seldaek added this to the 2.1 milestone Mar 9, 2021
Seldaek added a commit to Seldaek/composer that referenced this issue Mar 10, 2021
…dates to make sure they always reflect the current state on disk, fixes composer#9751
Seldaek added a commit to Seldaek/composer that referenced this issue Mar 10, 2021
…dates to make sure they always reflect the current state on disk, fixes composer#9751
@Seldaek Seldaek modified the milestones: 2.1, 2.2 May 24, 2021
@sveneld
Copy link
Contributor

sveneld commented Jan 24, 2022

@Seldaek when many developers works with same package which is configured as 'path' they get a conflict during merging their branches due to the change of reference for path package in composer.lock. Is it possible to add an config option for path packages?
#10482

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