Skip to content
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

Document the weak_vendors value #7453

Merged
merged 1 commit into from
Mar 13, 2017
Merged

Conversation

greg0ire
Copy link
Contributor

@greg0ire greg0ire commented Feb 7, 2017

@greg0ire
Copy link
Contributor Author

greg0ire commented Feb 7, 2017

Code PR: symfony/symfony#21539

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be more descriptive imho

@@ -119,7 +119,25 @@ an arbitrary value (ex: ``320``) will make the tests fails only if a higher
number of deprecation notices is reached (``0`` is the default value). You can
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of is undefined to the reader, it doesn't help one understand if that applies to its use cases or not

Copy link
Contributor Author

@greg0ire greg0ire Feb 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess one dependency with many deprecations is enough indeed.

@@ -119,7 +119,25 @@ an arbitrary value (ex: ``320``) will make the tests fails only if a higher
number of deprecation notices is reached (``0`` is the default value). You can
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
can create a sudden backlog of deprecations to fix that would otherwise prevent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for sudden imho

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ellipses suggest the reader understood, which might be not true yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced the ellipsis with described below so that the reader doesn't feel like they missed something.

@nicolas-grekas
Copy link
Member

(but not longer ;) )

@greg0ire
Copy link
Contributor Author

greg0ire commented Feb 7, 2017

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not render as a bullet list because of missing new line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops, I think I amended a very old commit and force pushed it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed again

@javiereguiluz javiereguiluz changed the title Document the weak_vendors value [WCM] Document the weak_vendors value Feb 12, 2017
fabpot added a commit to symfony/symfony that referenced this pull request Feb 28, 2017
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
@greg0ire
Copy link
Contributor Author

Please remove the [WCM] tag and review this

@javiereguiluz javiereguiluz changed the title [WCM] Document the weak_vendors value Document the weak_vendors value Feb 28, 2017
Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Really well explained! Thanks @greg0ire

@greg0ire
Copy link
Contributor Author

Glad you like it @javiereguiluz !

@xabbuh xabbuh added this to the 3.3 milestone Mar 6, 2017
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would revert the changes to this paragraph.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? What's wrong with trying to make a smooth transition like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After more thinking, maybe you're right, I'm kind of explaining the same thing twice here.

@xabbuh
Copy link
Member

xabbuh commented Mar 13, 2017

Thank you @greg0ire.

@xabbuh xabbuh merged commit abe88c6 into symfony:master Mar 13, 2017
xabbuh added a commit that referenced this pull request Mar 13, 2017
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
@greg0ire greg0ire deleted the weak_vendors branch March 13, 2017 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants