add semver checks to CI#277
Merged
Merged
Conversation
Not a big deal, but there are some additional details in the org PR request. Mostly just trying to consolidate on the default, unless there's a reason to duplicate/fork.
Historically, we bump the version number just before release. With this new CI tool, we'd need to switch to the model where the first breaking change in a release bumps the version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CHANGES.mdif knowledge of this change could be valuable to users.I've been personally hit by a few problems which were the result of other dependencies not following semver:
It's worth saying that having semver checks in our libraries won't fix issues with our dependencies avoiding semver, but I figure it's worthwhile implementing ourselves.
For one, it's good to be able to point to a working example of what people can do to improve their situation. As I haven't used these tools historically, this is a learning exercise for me.
Secondly, semver lawyering is complicated and requires a lot of vigalence. If I haven't already run afoul of it, it's probably only a matter of time before I do.
I tend to be a CI minimalist, so this is a bit of an experiment.
The way it will work, is the next time someone opens a PR with breaking changes, they'll be required to bump the version appropriately within their PR before CI will pass. This is different from my historic approach of leaving any "BREAKING" notes along with the CHANGELOG entry, and consulting those notes at release time to determine how to bump the version.
Caveats
It seems like there are some cases that aren't caught by semver-checks1, like changing the return type of an existing method. I haven't looked into why this failure happens. The tool doesn't have to be perfect. We should still review changes with semver breakage in mind, and be ready to manually bump the version when we notice a breaking change.
I'm curious how nicely this will work within a workspace like https://github.com/georust/geo/blob/main/Cargo.toml, which patches local dependencies, e.g. so that the local
geobuild uses the localgeo-typescrate, not the published one. I think it'd be fine? In any case, we don't have to adopt this everywhere all at once.From what I can tell, semver-checks doesn't fail for additive/patch changes, only breaking changes. At publication time, if no "breaking" bump has already occurred, the publisher might need to make a "minor" or "patch" version bump commit before publishing will succeed. As such, it will be important to continue to document "Added" (minor bump) changes in the CHANGELOG.
Footnotes
I did some testing here: https://github.com/michaelkirk/semver_checks_demo/pull/1. In particular, see the "change type" commits which should have failed the semver check. ↩