Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@greg0ire
Copy link
Contributor

@greg0iregreg0ire commentedApr 22, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
LicenseMIT
Doc PRI don't think it warrants one

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.

tarlepp, egircys, Korbeil, mbabker, rimvislt, kisphp, and ronfroy reacted with thumbs up emoji
@greg0iregreg0ireforce-pushed thealways_segregate_vendors_and_non_vendor_deprecations branch from2f59a4a tocaf8e6bCompareApril 22, 2018 17:18
@javiereguiluz
Copy link
Member

javiereguiluz commentedApr 22, 2018
edited
Loading

@greg0ire is this related to#26972 or could help us implement that idea? Thanks!

@greg0ire
Copy link
ContributorAuthor

greg0ire commentedApr 22, 2018
edited
Loading

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.

@greg0ire
Copy link
ContributorAuthor

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.

@nicolas-grekasnicolas-grekas changed the titleAlways segregate vendor and non vendor deprecations[PhpUnitBridge] Always segregate vendor and non vendor deprecationsApr 22, 2018
@nicolas-grekasnicolas-grekas added this to thenext milestoneApr 24, 2018

// store failing status
$isFailing =DeprecationErrorHandler::MODE_WEAK !==$mode &&$mode <$deprecations['unsilencedCount'] +$deprecations['remainingCount'] +$deprecations['otherCount'];
$passesBeforeShutdown =!$isPassing($mode,$deprecations);
Copy link
Contributor

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 returnstrue here and in the shutdown function below.$passesBeforeShutdown will befalse, which causes theif on line 275 to evaluate totrue and exit with a non-zero exit code.

Copy link
ContributorAuthor

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 👍

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedJul 23, 2018
edited
Loading

I don't think this segregation makes sense: your code is always the root of any calls made to vendors.
Take e.g. Yaml deprecations:you write the yaml config or call the parser, andthe Yaml component calls the code that triggers deprecations, leading to false-negatives.
I'm 👎 with this reasoning.

jvasseur reacted with thumbs up emoji

@greg0ire
Copy link
ContributorAuthor

greg0ire commentedJul 23, 2018
edited
Loading

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

@nicolas-grekas
Copy link
Member

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.

greg0ire reacted with thumbs up emoji

@greg0ire
Copy link
ContributorAuthor

This is not a segregation between direct and indirect, it's a segregation betweensrc -> src and (src -> vendor orvendor -> vendor), or, as you'd call it, between internal and (direct or indirect, but vendor)

@nicolas-grekas
Copy link
Member

According to#28048, it could make sense to group deprecations in 3 groups (in this order):

  • in app (=triggered in src/)
  • calling vendors (=direct deprecations when src/ calls something in vendors/)
  • remaining (=indirect deprecations, e.g. related to config/)

Maybe also implement the thresholds discussed in#28048 here?
A screenshot would help btw at some point :)

@greg0ire
Copy link
ContributorAuthor

I can do all this, but to be clear, the segregation already exists, it is just that it is restricted to theweak_vendors mode only, and this PR lifts that restriction.

Here is how it looks right now:

segregation

@stof
Copy link
Member

fewer tests for the weak vendors mode, which I plan to replace with different exit codes

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 theweak_vendor mode by a wrapper command checking the return type to make it 0 in some cases would be bad DX.

@greg0ire
Copy link
ContributorAuthor

greg0ire commentedJul 25, 2018
edited
Loading

Another idea could be to produce a report in an easy-to-parse format and let people act on it if they wish to.

@nicolas-grekas
Copy link
Member

Unless someone needs that IRL and is willing to implement, that possible, but we're not looking for more code to maintainà priori. :)

@greg0iregreg0ireforce-pushed thealways_segregate_vendors_and_non_vendor_deprecations branch from18acc34 to66ee0ffCompareJuly 26, 2018 06:46
@greg0ire
Copy link
ContributorAuthor

Rebased without the comment about exit codes

@fabpot
Copy link
Member

@greg0ire@nicolas-grekas How do we move forward on this one?

@greg0ire
Copy link
ContributorAuthor

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.

@greg0iregreg0ireforce-pushed thealways_segregate_vendors_and_non_vendor_deprecations branch fromf0c680a tof183d99CompareOctober 10, 2018 11:57
Even if it does not make the exit code change, this is valuableinformation. Besides, not doing this reduces the complexity (fewer testsfor the weak vendors mode).I introduced a new closure for computing whether the build is failing ornot, named using positive logic so that things are easier to understand.
@greg0iregreg0ireforce-pushed thealways_segregate_vendors_and_non_vendor_deprecations branch fromf183d99 to85c4243CompareOctober 10, 2018 11:59
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedOct 10, 2018
edited
Loading

I'd suggest borrowing this PR is your work.
It cannot be merged as is to me.

@greg0ire
Copy link
ContributorAuthor

Ok

@greg0iregreg0ire deleted the always_segregate_vendors_and_non_vendor_deprecations branchOctober 10, 2018 12:02
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@alcaeusalcaeusalcaeus requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

8 participants

@greg0ire@javiereguiluz@nicolas-grekas@stof@fabpot@alcaeus@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp