Document the weak_vendors value - #7453
Conversation
|
Code PR: symfony/symfony#21539 |
nicolas-grekas
left a comment
There was a problem hiding this comment.
Should be more descriptive imho
| also set the value ``"weak"`` which will make the bridge ignore any deprecation | ||
| notices. This is useful to projects that must use deprecated interfaces for | ||
| backward compatibility reasons. | ||
| backward compatibility reasons, or for libraries with lots of vendors that |
There was a problem hiding this comment.
Lots of is undefined to the reader, it doesn't help one understand if that applies to its use cases or not
There was a problem hiding this comment.
I guess one dependency with many deprecations is enough indeed.
| notices. This is useful to projects that must use deprecated interfaces for | ||
| backward compatibility reasons. | ||
| backward compatibility reasons, or for libraries with lots of vendors that | ||
| can create a sudden backlog of deprecations to fix that would otherwise prevent |
There was a problem hiding this comment.
I want to convey the fact that this can happen without any code change in the lib itself, because dependencies are not locked.
| backward compatibility reasons. | ||
| backward compatibility reasons, or for libraries with lots of vendors that | ||
| can create a sudden backlog of deprecations to fix that would otherwise prevent | ||
| unrelated pull requests from being merged… which leads us to ``"weak_vendors"``. |
There was a problem hiding this comment.
Ellipses suggest the reader understood, which might be not true yet
There was a problem hiding this comment.
Replaced the ellipsis with described below so that the reader doesn't feel like they missed something.
|
(but not longer ;) ) |
9b2e565 to
b3b458b
Compare
|
I reworked it a bit. Reviewers, feel free to point me to parts that you feel are too verbose / superfluous. |
| the Composer lock file, which would create another class of issues. Libraries | ||
| will often use ``SYMFONY_DEPRECATIONS_HELPER=weak`` because of this. This has | ||
| the drawback of allowing contributions that introduce deprecations but: | ||
| * forget to fix the deprecated calls if there are any; |
There was a problem hiding this comment.
Does not render as a bullet list because of missing new line.
There was a problem hiding this comment.
The list still doesn't render properly, see https://github.com/greg0ire/symfony-docs/blob/weak_vendors/components/phpunit_bridge.rst#making-tests-fail.
There was a problem hiding this comment.
Woops, I think I amended a very old commit and force pushed it.
b3b458b to
629498f
Compare
This PR was merged into the 3.3-dev branch. Discussion ---------- Introduce weak vendors mode Deprecations coming from the vendors are segregated from other deprecations. A new mode is introduced, in which deprecations coming from the vendors are not taken into account when deciding to exit with an error code. | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT | Doc PR | symfony/symfony-docs#7453 <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Sample output : # Weak vendor mode ## With both vendors and non-vendor errors ``` WARNINGS! Tests: 1068, Assertions: 2714, Warnings: 6, Skipped: 15. Remaining deprecation notices (1) some error: 1x 1x in SonataAdminBundleTest::testBuild from Sonata\AdminBundle\Tests Remaining vendor deprecation notices (4) Legacy deprecation notices (48) ``` Exit code is 1 ## After fixing non-vendor errors ``` WARNINGS! Tests: 1068, Assertions: 2714, Warnings: 6, Skipped: 15. Remaining vendor deprecation notices (4) Legacy deprecation notices (48) ``` Exit code is 0 # TODO - [x] fix colorization issues (vendor deprecation notices are always in red) - [x] make the vendor detection more robust - [x] make the vendor dir configurable - [x] ~figure out how to run tests and~ add more of them - [x] test on non-vendor file - [x] test on vendor file - [x] do not change the output of other modes Commits ------- 61fd043 Introduce weak vendors mode
|
Please remove the [WCM] tag and review this |
javiereguiluz
left a comment
There was a problem hiding this comment.
👍
Really well explained! Thanks @greg0ire
|
Glad you like it @javiereguiluz ! |
| backward compatibility reasons. | ||
| backward compatibility reasons, or for libraries that do not want deprecations | ||
| triggered by their dependencies to prevent unrelated pull requests from being | ||
| merged, which leads us to the ``"weak_vendors"`` value, described below. |
There was a problem hiding this comment.
I would revert the changes to this paragraph.
There was a problem hiding this comment.
Why? What's wrong with trying to make a smooth transition like that?
There was a problem hiding this comment.
After more thinking, maybe you're right, I'm kind of explaining the same thing twice here.
|
Thank you @greg0ire. |
This PR was merged into the master branch. Discussion ---------- Document the weak_vendors value See symfony/symfony#21539 Commits ------- abe88c6 Document the weak_vendors value
See symfony/symfony#21539