Replies: 17 comments 11 replies
-
We have a similar use case. A single internal package that maintains a common set of composer dependencies that is shared by many projects. Being able to lock dependency versions and apply specific patches in a shared package, provides consistency across a fleet of websites. Having to reproduce and maintain this list individually for every website would be painful. The current state is very clean with a set of patches that are applied globally to all websites, and then any additional site specific patches in their own individual composer.json file. |
Beta Was this translation helpful? Give feedback.
-
Noted! Thank you for the feedback. My theory is that this functionality isn't something that the majority of composer patches users need, so I'd rather take it out of the core plugin. That said, the plugin is very extensible now. I've made it possible for other Composer plugins to extend this one via Capabilities. Essentially, any plugin can provide a method of resolving, downloading, or applying patches. If there's enough interest, I may write another plugin that provides the dependency patch resolver. We'll see what happens this week :) |
Beta Was this translation helpful? Give feedback.
-
Just wanted to add Open Social to the list of projects that rely on this behaviour. |
Beta Was this translation helpful? Give feedback.
-
+1 Our projects also leverage this feature for a similar use case that was described in the conversation starter. Even if I do not like this approach, it is still better than forking projects and maintaining forks... BUT, how about replacing enable-patching with something that is more secure?
(Source: #354 (comment))
There are plenty public results already that proves this feature is widely used: https://github.com/search?l=&q=%22enable-patching%22+filename%3Acomposer.json&type=code |
Beta Was this translation helpful? Give feedback.
-
YMCA Website Services ( former Open Y ) rely on this functionality |
Beta Was this translation helpful? Give feedback.
-
For me this feature caused several problems. I am not familiar with all the features of version 2.x, but it would be useful to see a list of patches defined in the dependencies. Based on that list I could decide if I want to "cherry-pick" a patch definition into the root project or not. |
Beta Was this translation helpful? Give feedback.
-
To all have that weighed in here, thank you. I am considering other options and will update when I have more information. |
Beta Was this translation helpful? Give feedback.
-
CiviCRM has patches that are applied, and then we pull in CiviCRM Core to a website's codebase. We need those patches to apply, and we also sometimes have our own additional patches in the root composer.json A change in behavior would cause many sites friction |
Beta Was this translation helpful? Give feedback.
-
We have a private, internal install profile that helps run 10+ websites on my current client, and we list mostly bugfix patches in our composer.json to help distribute the same patches to everyone since we don't control everyone's root composer.json files. This would leave us in a pretty bad spot if this went away. |
Beta Was this translation helpful? Give feedback.
-
Pantheon custom upstreams use path repositories to allow the upstream to define dependencies in a subproject that lives inside the upstream repository. This allows individual sites to control the top-level composer.json file, and keeps the dependencies provided by the upstream separate. The Pantheon upstream update process is based on git merge, so the separation of files (especially .json files) is important to avoid merge conflicts. Upstreams frequently need to add patches. This use case is similar to the install profile / distribution use case mentioned above. Having the continuing capability to patch from dependencies in composer-patches core would be useful. |
Beta Was this translation helpful? Give feedback.
-
@cweagans Do you have any update that you can share about the future plans? A couple of days passed, I wonder what alternative solutions you have in your mind for replacing this feature. Of course, if you need more time, no problem, I've just wanted to ask... |
Beta Was this translation helpful? Give feedback.
-
Hi all, thank you for your patience. I've made the decision to not include this functionality in 2.0.0. I know this is not the decision that any of you wanted and I'm sorry for the hassle it's going to cause. I wrote down some of my reasoning here: https://www.cweagans.net/2023/07/dependency-patch-resolution/ I gave some consideration to making the dependency patch resolution functionality a paid plugin somehow (either through distribution with keygen.sh or paid repo access via Github Sponsors or something along those lines), but the logistics of doing so would cause more problems than it was worth -- not to mention all of the headaches that come with maintaining that functionality in the first place. I'll leave this discussion open for a bit in case there are any follow up questions/concerns/etc. |
Beta Was this translation helpful? Give feedback.
-
I can understand that this needs some sort of control by the root composer.json Would it be possible to include an explicit, manual, safe-listing in the root somehow similar to
Would it be feasible to create something similar for patches?
The root would be implicitly allowed, but all other dependencies need to be in the safelist. This way it would be controlled by the user of the root. |
Beta Was this translation helpful? Give feedback.
-
For folks who have been following this thread and continue to have the need to define patches in packages (dependencies) outside the Composer project
|
Beta Was this translation helpful? Give feedback.
-
Hi all, thank you again for all the feedback here. I've been thinking about this a lot and it seems like this is really the biggest thing that is holding people up from switching to 2.x. I had an idea on this front that might make it possible to support resolving patches from dependencies without making my life difficult. Issue can be found here: #546 I don't know when I'm going to have time to work on it, but feedback on the approach would be appreciated. |
Beta Was this translation helpful? Give feedback.
-
I have extended 2.x version and created separate plugin rajeshreeputra/composer-dynamic-patching which provide an ability to apply version based patching, please review and provide your feedback. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Welp. I started building the import command and it turns out that most of what that command would be doing is already done by the resolver functionality already in the plugin. Instead of doing that thing I just said...well.. |
Beta Was this translation helpful? Give feedback.
-
We have number of websites build on top of Sector distribution. Sector provides patches for know issues in the Drupal core and contributed modules.
We also maintain our own internal package that holds number of shared dependencies and patches for them.
So, removal of this functionality, would be quite devastating for us.
Beta Was this translation helpful? Give feedback.
All reactions