-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PhpUnitBridge] Always segregate vendor and non vendor deprecations #27006
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
[PhpUnitBridge] Always segregate vendor and non vendor deprecations #27006
Conversation
2f59a4a
to
caf8e6b
Compare
It is slightly related, and it is a step towards a second attempt at doing #24867, which is deeply related, and might help you implement that idea. |
To sum things up, there is vendor code code and your code. This PR makes the distinction between your code calling your deprecated code , and your code calling deprecated vendor code. #24867 is about a third category: vendor code calling deprecated vendor code. |
|
||
// store failing status | ||
$isFailing = DeprecationErrorHandler::MODE_WEAK !== $mode && $mode < $deprecations['unsilencedCount'] + $deprecations['remainingCount'] + $deprecations['otherCount']; | ||
$passesBeforeShutdown = !$isPassing($mode, $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.
I believe the negation is incorrect: let's assume $isPassing
returns true
here and in the shutdown function below. $passesBeforeShutdown
will be false
, which causes the if
on line 275 to evaluate to true
and exit with a non-zero exit code.
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.
Oh right! Probably something I forgot to change when I decided to avoid negative logic 👍
caf8e6b
to
18acc34
Compare
I don't think this segregation makes sense: your code is always the root of any calls made to vendors. |
It very much is, but you can get deprecations without any calls made to your vendors, and if you do, that's probably the deprecations that should be fixed in priority, especially when you are a library, because it means you are calling your own code in a deprecated way |
Maybe it's a matter of vocabulary: vendor vs not-vendor means little to me as I explained, but direct vs indirect makes more sense to me. |
This is not a segregation between direct and indirect, it's a segregation between |
According to #28048, it could make sense to group deprecations in 3 groups (in this order):
Maybe also implement the thresholds discussed in #28048 here? |
you cannot replace the mode by something switching the exit code. any non-0 exit code is a failure, and CI would break on them. Having to replace the |
Another idea could be to produce a report in an easy-to-parse format and let people act on it if they wish to. |
Unless someone needs that IRL and is willing to implement, that possible, but we're not looking for more code to maintain à priori. :) |
18acc34
to
66ee0ff
Compare
Rebased without the comment about exit codes |
@greg0ire @nicolas-grekas How do we move forward on this one? |
I'm currently working on an implementation of #28048 , and it would make my life easier if this got merge, so I'm going to rebase this again, and hope you accept to merge it. |
f0c680a
to
f183d99
Compare
Even if it does not make the exit code change, this is valuable information. Besides, not doing this reduces the complexity (fewer tests for the weak vendors mode). I introduced a new closure for computing whether the build is failing or not, named using positive logic so that things are easier to understand.
f183d99
to
85c4243
Compare
I'd suggest borrowing this PR is your work. |
Ok |
Even if it does not make the exit code change, this is valuable
information. Besides, not doing this reduces the complexity (fewer tests
for the weak vendors mode).
I introduced a new closure for computing whether the build is failing or
not, named using positive logic so that things are easier to understand.