-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add a table to summarize the modes #10067
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
+----------------+-----------------------------------------------------+ | ||
| weak | Not recommended; will probably lead to | | ||
| | a big refactoring. | | ||
+----------------+-----------------------------------------------------+ |
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.
I like this new table! But, which mode should I use in my project? Most projects either:
A) Have deprecations & know about them... and just want to report them at the bottom of their tests (but not cause failures)
B) Do not have deprecations and want to keep it that way. New deprecations should cause the tests to fail.
What should I have for (A)? And is (B) strict
? Or would weak_vendors
be better (i.e. only tell me about my deprecations)?
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.
Right now, weak
is not good for A, because it does not display deprecations, and I couldn't convince people to change this. At work, I observed that people are using weak_vendors
to achieve A, although it's not meant for that. For B, you should use strict
if you can. If you're a library and i turns out not to be realistic, for instance if the build fails on your contributors PRs because of unrelated changes in new minor versions of your dependencies, you might be better off with weak_vendors
, which will let you focus on your deprecations (trigger_error
calls you make in code you should no longer call), and slightly postpone fixing deprecations in your dependencies because of calls you should change.
+----------------+-----------------------------------------------------+ | ||
| <some integer> | Recommended for projects that you cannot | | ||
| | immediately fix but don't want to make worse. | | ||
| | Can be used to transition from one mode to another. | |
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.
Should we have a bit more information about what integers you can use here? ie. What's the min/max? Is a lower number more strict or less strict?
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.
This column shows no description, even for other modes. It only shows a recommendation. That particular mode is already documented above.
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.
Ah fair enough. As long as it's documented somewhere π
Let's use a specific example to try to understand the different modes:
@greg0ire please, fill in the following descriptions:
Thanks! |
Hey @javiereguiluz ! Thanks for your review! I'm going to have a hard time filling the blanks though, for several reasons. For starters, modes rarely change the output a lot, and they will not hide one type of deprecations over the other. The only mode that changes the output a lot is the So, let's take the example of a library
Now let's say the contributor forgets one call to
What's next?symfony/symfony#28048, implemented in symfony/symfony#29211 and documented in #10701 is a big revamp of all this, and will introduce a way for an application to only care about deprecation that can be fixed directly within itself, meaning they will be able to call |
I'm closing this since I deprecated the |
Looks like people have a hard time knowing when to use which mode. Undocumented thing I have witnessed on a real-life project: people will use
weak_vendors
mode even if it makes little sense on a project (as opposed to a library), rather than theweak
mode, becauseweak_vendors
displays the deprecations.