In order for Mautic to continue to be relevant and use up to date technologies, we often need to retire parts of our code or features in the product.
This policy outlines what can be deprecated, the timelines and processes for deprecating, and how we do it both in the code and in communication with Mautic users.
We aim to provide at least one minor release cycle where the deprecation is marked as such and the community has been alerted through communications, before removing it in the next major release.
This generally means that any expected deprecations in a major release should be marked as deprecated from the x.2 release predating it - for example being marked as deprecated in 4.2 to be removed in 5.0.
The above is required by the semantic versioning specification which Mautic follows - read more: https://semver.org/#how-should-i-handle-deprecating-functionality
If the deprecation is likely to have a wide impact we aim to provide notice at least two minor release cycles in advance - for example being deprecated in the x.1 release and removed in the next major release.
A deprecation consists of three parts:
A @deprecated
PHPdoc tag that indicates when the code was deprecated, when it will be removed, and what to use instead, and where appropriate, an @see link to the upgrade.md file for the relevant version in which it is being deprecated.
Here’s an example of how this would look in Mautic:
A @trigger\_error(‘...’, E\_USER\_DEPRECATED)
at runtime to notify developers that deprecated code is being used. The @ suppression should be used in most cases so that we can customize the error handling and avoid flooding logs on production. In some cases we will omit the @ if it is important to notify developers of a behavior or BC break (e.g. for a critical issue)
Here’s an example of how this would look in Mautic:
In the event of a user-facing deprecation (for example the removal of a feature or function in the front-end) a notice will be displayed when that feature or function is being used, explaining the deprecation and pointing to the user-friendly explanation section of the change record
Here’s an example of how this would look in Mautic:
_@deprecated in %deprecation-version% and is removed from %removal-version%. %extra-info%._
_@see %cr-link%_
When the trigger_error() call is associated with a matching @deprecated doc tag, the format of the text is the same as the @deprecated tag:
_%thing% is deprecated in %deprecation-version% and is removed from %removal-version%. %extra-info%. See %cr-link%_
Where there is no associated @deprecated doc tag, the format is more relaxed to allow flexibility in wording:
_%thing% is deprecated in %deprecation-version% (free text describing what will happen) %removal-version%. %extra-info%(optional). See %cr-link%_
_%thing% is currently deprecated since %deprecation-version% and will be removed in %removal-version%. %extra-info%(optional). See %cr-link% for more information._
What is being deprecated - for example, the class name, method name, function name, service name or the use or optional status of a parameter
The version string representing when the change occurred.
For Mautic core and other projects that use semantic versioning, the version string is:
project:major.minor.patch-modifier
The version string representing when the deprecated code path will be removed.
This is free text. Useful things to include are what version the code will break in, hints on how to correct the code, or what replacement to use, etc.
The link to the change record - usually the upgrade.md for the relevant version.
Doctrine
https://www.doctrine-project.org/policies/deprecation.html
Drupal
https://www.drupal.org/about/core/policies/core-change-policies/drupal-deprecation-policy
Pip
https://pip.pypa.io/en/stable/development/release-process/#deprecation-policy
Found errors? Think you can improve this documentation? edit this page