Skip to content

docs: add a deprecation policy to the contributing guide#4051

Open
maxrjones wants to merge 1 commit into
zarr-developers:mainfrom
maxrjones:docs/deprecation-policy
Open

docs: add a deprecation policy to the contributing guide#4051
maxrjones wants to merge 1 commit into
zarr-developers:mainfrom
maxrjones:docs/deprecation-policy

Conversation

@maxrjones

Copy link
Copy Markdown
Member

Closes #2924.

This PR adds a deprecation policy to the contributing guide, so there's a shared framework all contributors and maintainers can apply rather than re-deriving one for each PR. Making it a public doc also gives users visibility into how we handle breaking changes.

The policy is consistent with our EffVer versioning and covers scope, decision framework, mechanics, minimum period, and exceptions to the policy.

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.md
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

Closes zarr-developers#2924.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread docs/contributing.md
Comment on lines +382 to +390
A deprecation cycle has a real cost: every user of the affected API must eventually migrate, and we carry the deprecated code and its warning until removal. Before starting one, weigh the following factors and record your reasoning in the pull request. The goal is to evaluate every proposed deprecation on the same shared scale, so that disagreements are argued in these terms rather than relitigated from first principles each time.

- **How many users are affected.** Assume that every part of our public API is used by someone, including downstream libraries, and put the burden on the person proposing a removal to show that an API is genuinely niche, rather than on users to show that they depend on it. This asymmetry is deliberate, for two reasons. First, the users of an API are mostly invisible to us: they do not follow our issue tracker, and they typically discover a removal only when their code breaks after upgrading -- too late to have spoken up in advance. Absence of reported usage is therefore not evidence of absence of usage. Second, the cost of guessing wrong is lopsided. If we keep an API that turns out to be unused, we pay a bounded maintenance cost that we, the maintainers, can see and manage. If we remove an API that turns out to be used, we impose an unbounded cost on an unknown number of users, discovered late and eroding trust in the library's stability. When the downside of one error is so much larger than the other, the default should favor the cheaper mistake. "I can't imagine anyone using this" is not evidence that no one does; concrete signals -- code search across downstream projects, documented usage, or download statistics -- are.
- **The cost of migration to users.** Is there a drop-in replacement? Can the migration be performed mechanically, or does it require users to redesign their code? A change with a clear, easy migration path is much cheaper to justify than one without.
- **The cost of keeping the API.** What do we pay by not removing it -- maintenance burden, bug surface, duplicated logic, or a worse design that we can't improve while the old API exists? A high carrying cost strengthens the case for removal.
- **Who benefits.** Distinguish benefit to users from benefit to maintainers. A change that helps only maintainers (for example, deleting code that is inconvenient to keep) is a weak case on its own, because users pay the migration cost and get nothing. A change that *also* gives users something they want is a much stronger case.
- **Whether the goal can be met without removal.** Often a refactor, an alias, or an additive change achieves the same end without breaking anyone. Prefer those. Removing public API is never free; the deprecation cycle is the price, and it is mandatory.

If, after weighing these factors, a removal is not clearly worthwhile, prefer to keep the API. Conversely, do not leave the decision to remove an API indefinitely deferred: a vague intention to "eventually" break something is itself a form of technical debt. Either commit to the deprecation and begin the cycle, or decide to keep the API and design around it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This reads a bit like an effort to discourage developers from wantonly deprecating code they don't like, without regard for how it impacts users. I don't think we have a lot of that in our codebase, so maybe a more neutral tone would work better here. Even better would be just linking to or copying text from the NumPy deprecation guidelines: https://numpy.org/neps/nep-0023-backwards-compatibility.html#general-principles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

define our deprecation policy

2 participants