-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PHPUnitBridge] fail only for "new" deprecations / "baseline" feature #34496
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
Comments
Generating a baseline could be a nice idea - setting some option in the SYMFONY_DEPRECATIONS_HELPER to record it, and use it later. |
I really like how PHPStan does this. Especially since it will error again if you ignore an error that is not triggered, urging you to update your ignored error list. This is something I really mis right now. In my project I have one external dependency that triggers a |
…ecation testing (alexpott) This PR was submitted for the master branch but it was squashed and merged into the 5.x branch instead. Discussion ---------- [PhpUnitBridge] Add ability to set a baseline for deprecation testing | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #37715, #34496 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> This PR allows you set new options for `SYMFONY_DEPRECATIONS_HELPER` env var: * `generateBaseline` - if this is set to TRUE any deprecations that occur will be written to the file defined in the `baselineFile` option * `baselineFile` a path to a file that contains a json encoded array of deprecations that will be skipped. ### Questions * If you set `generateBaseline` without also setting `baselineFile` an exception is thrown. We could use a default filename if one is not provided (like PHPStan). * How much error checking should we do around the `baselineFile` variable - should we check if it is readable or should we rely on `file_get_contents`()? ### Still @todo Add proper end-to-end testing using a .phpt test Commits ------- 483236f [PhpUnitBridge] Add ability to set a baseline for deprecation testing
Description
On a big work project (that started with Symfony 2.1 and is now on 4.3) we recently introduced the PHPUnitBridge to keep track of deprecations.
Unfortunately it currently reports a variety (> 2000) of deprecations trigged in our own code-base. We are slowly fixing those but this will take some time.
While we are still fixing those deprecations unfortunately whenever new code is merged it might introduce more/new deprecations again 😢
I was thinking it would be really nice to be able to make our CI build fail only for new deprecations reported by the bridge.
This is similar to the phpstan baseline feature maybe: https://medium.com/@ondrejmirtes/phpstans-baseline-feature-lets-you-hold-new-code-to-a-higher-standard-e77d815a5dff
WDYT? Is this something that might be interesting and not too complex to implement?
The text was updated successfully, but these errors were encountered: