Guidance on breaking changes - #912
Conversation
Clarify guidelines on renaming declarations and deprecations.
grunweg
left a comment
There was a problem hiding this comment.
Thanks for proposing this. I think it's good to document this, and start a discussion. I'm not sure, though, if this has been discussed before. Can you point me to a discussion that I missed, or start a brief one on Zulip?
| This is especially important for new contributors as it prevents wasted effort. | ||
|
|
||
| * Avoid making *breaking* changes, i.e. PRs that make downstream code go from _working_ to _giving an error_. | ||
| However, this kind of change is sometimes necessary for the growth of mathlib, but should be carefully considered. |
There was a problem hiding this comment.
I'm not sure what exactly this sentence is contrasting. To me, the sentence reads fine without it.
| However, this kind of change is sometimes necessary for the growth of mathlib, but should be carefully considered. | |
| This kind of change is sometimes necessary for the growth of mathlib, but should be carefully considered. |
There was a problem hiding this comment.
The intended message here is "You should avoid doing this unless you really have to, but sometimes you truly do have to". I'm happy with alternate wording which conveys this!
|
|
||
| * Avoid making *breaking* changes, i.e. PRs that make downstream code go from _working_ to _giving an error_. | ||
| However, this kind of change is sometimes necessary for the growth of mathlib, but should be carefully considered. | ||
| In these situations, the change must be mentioned in the PR description, and a mitigation or fix provided there also. |
There was a problem hiding this comment.
To me, it's not 100% clear what this means. Do you have an example in mind? (Do you think we have been following this, or would this also be a proposed new policy?)
There was a problem hiding this comment.
I think this is followed in general, but not consistently. For example:
- [Merged by Bors] - chore(Topology/MetricSpace/Closeds): rename lemmas about
MetricSpace (NonemptyCompacts α)mathlib4#42774 - [Merged by Bors] - feat(Topology/InfiniteSum): applying the sum of functions mathlib4#42829
- [Merged by Bors] - refactor(Order): make CompletePartialOrder extend OrderBot mathlib4#34477
- [Merged by Bors] - chore(Algebra/Order/Monoid/Unbundled/Basic): golfing + formatting mathlib4#38227
Apologies, I accidentally made the PR before remembering to add the motivation. I have added motivation and some links to previous discussion in the description. |
|
Thanks for the explanation; that is very helpful. I find this idea reasonable, but also think it's good to draw wider attention to this. I've started a thread on Zulip: https://leanprover.zulipchat.com/#narrow/channel/345428-mathlib-reviewers/topic/Breaking.20change.20policy/with/622851226 |
The motivation here is that:
The spirit of this policy already exists in mathlib writings in various guises:
simps because they make it more likely that a new[simp]can produce a breaking change (and more generally the flexible linter)Previous discussion on related points: