-
-
Notifications
You must be signed in to change notification settings - Fork 195
Add a dedicated file deletion for unconfigure recipes #706
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
Conversation
Outdated and should be resolve in #845 |
@maxhelias up to rebase this for 2.x? |
@nicolas-grekas Yes, of course, I think I'll have to work on it again after all this time 😅 |
afbeaaa
to
b2e4615
Compare
@nicolas-grekas Everything looks good to me. To be fair, the solution isn’t entirely mine — it actually comes from a conversation we had about five years ago 😅 #615 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cool thanks!
I don't know if this a real-world concern but the change on the signature of the configurator's constructors is a BC break.
This would break anyone adding their own configurator, if any.
Maybe we can update the code with this concern in mind just to be on the safe side?
It'd mean we could wrap the FilesManager in the Options class possibly? (that'd easy reintroduce the shouldWriteFile method + OptionsTest, which could be marked deprecated / legacy respectively?)
An alternative would be to add a setter on AbstractConfigurator.
WDYT?
Yes, it's a BC for custom configurators. These cases should be very limited, though, as the list of configurators is hard-coded and not extensible within the Encapsulating the And the alternative, add a setter on AbstractConfigurator. That would preserve separation of concerns, but it would also make configurators mutable. Even though we control the instantiation flow, I'm a bit hesitant about introducing that mutability. |
I agree, let's go with the first option. 🙏 |
I'm going to take over the PR if you don't, apply my own review comments and a few more things I found while giving it a try. Also because we'd like this to be ready early next week. |
691c878
to
0404948
Compare
@nicolas-grekas If you want it for the beginning of the week, please take it, I won't have time for that. I pushed what I'd started at the end of the week as it was. |
I'm going to open a new PR, the current one is too far from the target, I had to rewrite almost everything :) |
Don't hesitate to ping me for a review if needed 😉 |
…pes (nicolas-grekas) This PR was merged into the 2.x branch. Discussion ---------- Don't remove still-referenced files when unconfiguring recipes Instead of #706 Fixes broken logic added in #451, which didn't account for folders. The new logic uses only the symfony.lock file and not the recipe anymore to decide which files to remove. Commits ------- 6443e31 Don't remove still-referenced files when unconfiguring recipes
Re-open #667
In this way, we correct the deletion of the same file imported by 2 recipes.
Factoring in this way would allow us to remove the $lock parameter passing in the
unconfigure
method and with a little more work in theconfigure
.WDYT about this way ? Can I continue in this direction?