-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Adopt better SemVer practices #7563
Comments
@chrisdavidmills @Elchi3 @vinyldarkscratch this issue might be of interest. Thanks for your help! |
First let me say that the fear of increasing the major version is something I'm very much guilty of bringing into this project. 😅 I also think SemVer should be applied correctly and we should agree on and publish rules for this process, so that it is clear to everyone when we release which update. The rules you outline make sense to me in principal. I think I have one open question: I think "Removing an existing feature" happens quite a lot given we are identifying a few ghost features and irrelevant features regularly. I don't have a lot of experience with releasing software, so I think my worry was and is that people would be a bit tone deaf if we make new major version increases all the time because some obscure BCD feature entry was removed. Editorial: I was a bit confused by "Adding a support statement" and "Removing a support statement", I think "Updating support statements" summarizes it better?
Probably, but this is a great start and I think if we make this a "release guidelines" doc then we can expand it as time goes by. Much like we do with the data guidelines doc. |
Thanks, @Elchi3. You've given me some helpful things to think on. Removing an existing feature
I was thinking about this too. I've got a lot of thoughts on it, apparently: The better acquainted I've become with npm packages, the more I think developers must be accustomed to packages shipping "breaking" changes which don't represent particularly dramatic departures from previous releases (e.g., working on stumptown, I saw a number of breaking releases from our dependencies where the "breaking" change was a Typescript definition, only impacting TS users). I suspect shipping these nuisance releases is preferable to something like the surprise of #7535, at very least. In some ways though, we've created this routine breakage situation for ourselves. We've designed our API (minimal as it is) this way. If we say, if you access We could probably get clever about this to reduce the likelihood of breaking changes. For instance, we could provide something like Updating support
|
This is on point. I think the question now is whether we want to enhance our API design to account for this or if we want to communicate better when we break endpoints in the current API. When we break things, there are definitely a few different levels of breakage.
So, I don't know, but do the 3 scenarios above map to major, minor and patch in semver? I guess the case that is on the fence is the second, where we could be lax and say it is minor or we are more conservative and announce it as a major change because it can effectively lead to breakage for some people that happen to consume the 30 features out of the 10k or so that we have.
I think we should have a look at what is in queue. Is it the nodejs initial version stuff that is hard to categorize with no semver policies right now? Maybe we merge the UC and QQ browser removal (seems ready to me) and then we have a breaking release anyway? |
I think this example gave me some clarity about this. The whole idea of SemVer to is communicate expectations. If a consumers sees a major version change, they should probably read the release notes to find out if they need to make any changes. Most of our users won't be affected by any given change, but it does seem kind to warn about that sort of thing.
Yeah, this is a good point. It at least buys time to write something formal. 👍 |
@Elchi3 and I talked more about this today. We brainstormed on this problem a bit and here's what we came up with: We should document SemVer-protected names, rather than guaranteeing backwards compatibility for all feature access. Some examples of namespaces we had in mind:
The idea here is to avoid triggering a major release on routine data maintenance (e.g., dropping an irrelevant feature, correcting incorrect capitalization, etc.) while still alerting consumers to large-scale changes (i.e., the problem of #7535, where many features were relocated in a patch release). I'm going to open in a PR soon (ideally in the next 24 hours), which will document this approach, so we can include it in this week's release. |
As the author of 7535, I think this is on the right track. The protected names idea seems a reasonable compromise. Too few major releases would break my es-compat tool/linter (or any consumer), while too many would mean its users wouldn't benefit from data completeness/quality improvements until I update the dependency version of the tool and release it. I did look at the schema documentation (as I expect most serious consumers would need to) when building the tool, so if this list of protected names was unmissable while doing that I would have found it. |
There were three recent patch releases containing breaking changes, as accommodated by the fixes I had to make here: robatwilliams/es-compat#60 This is fine by the stated semantic versioning policy:
This is quite inconvenient, and unless I lock down a specific version (thus opting out of data updates), breaks es-compat for users. |
Apologies that an update has broken your package, @robatwilliams, it's never our intention to break a downstream package. Unfortunately, however, we add and remove features from BCD all the time, to the point where literally every release has at least one feature added or removed. If we were to consider individual features documented in BCD as covered by SemVer's feature addition/removal policies, then almost every new release of BCD would have a major version bump. As we work to refine the data, we've found that certain features were never supported (or haven't been supported in two years and can be considered irrelevant), and other times we've found that the organization of features is not great so we have moved them around to better organize them. The best recommendation I can make is, in fact, to use a specific patch version, and then use something like Dependabot to automatically update BCD if the unittests pass. |
No worries, thanks for the insight. I'll consider dependabot and other approaches on the es-compat side to deal with this - robatwilliams/es-compat#61 I wonder what it would look like for the BCD SemVer scope to include all the features, thus eliminating the problem that consumers currently have to deal with. This would also align the "public API" part of the policy with what I expect is the reality of what consumers are using. I see there is now the build-time mirroring feature for related browser families. Perhaps something like that could be used to mirror moved features back to their previous path, and then remove these mirror links in the next major version. |
For "routine" data updates, we usually release as patch versions (i.e., 2.0.z), even if those versions add or remove features. We should probably quit doing this, based on consumer feedback in #7535. But there's more to Semantic Versioning than breaking changes.
I propose we adopt a closer adherence to SemVer practices at the level of features (and above) or browsers (and above). In other words, changes to
__compat
objects and the immediate children ofbrowsers
should be reflected in our release versions. In other words, we’d adopt SemVer for the parts of BCD which aren’t directly described by the schema specifications, plus changes to the schemata themselves.What does this actually mean?
Here’s some example scenarios:
Things that would trigger a SemVer MAJOR release (e.g., 3.0.0)
__compat
object)Things that would trigger a SemVer MINOR release (e.g., 2.1.0)
__compat
object)Things that would trigger a SemVer PATCH release (e.g., 2.0.8)
description
status
How would our process change?
All this means we’d probably issue more "breaking" releases than we have in the past (though I expect few changes will represent hardships for BCD consumers).
It also means we’d have to do a bit more bookkeeping around releases. More PRs would need to be flagged for release notes and more release notes text would need to be written. This would probably give us the impetus to adopt better practices around release notes. For example keeping BCD’s release notes in the repository (rather than GitHub’s proprietary releases tool) or incrementing BCD’s version number via pull requests rather than commits pushed straight to the default branch.
We would also need to document this for consumers. We should indicate in consumer documentation what’s protected by backwards compatibility and what’s not.
Feedback wanted
What am I missing here? I feel like there may be some other issues presented by this which I haven’t considered yet. I was preparing the release today and kinda got a bit paralyzed by the prospect of changing our release practices unilaterally. I'd love to have your help to make sure we're doing this intentionally.
The text was updated successfully, but these errors were encountered: