-
-
Notifications
You must be signed in to change notification settings - Fork 631
Create tools/release.go to automate release tagging #6731
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
Conversation
|
For posterity, I think you can do `// #nosec G204`
https://stackoverflow.com/a/75063194
|
|
That works when you're running gosec directly, but not as part of golangci-lint. No, I have no idea why it's different, but I've tripped over it multiple times. |
e4cd4ca
|
You've got a failing gomod vendor test. |
|
I've merged main and made several improvements that were obvious with fresh eyes. I've added sample output to the PR description above. Please take a look! |
|
Example release tag: https://github.com/aarongable/boulder/tree/v0.20250618.0 |
jsha
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I noticed this in the sample output:
Running: /usr/bin/git tag -s -m Release v0.20250618.0 v0.20250618.0 origin/main
That's a little confusing, because "Release v0.20250618.0" is a single arg, but there's no indication in the output. Of course, cmd.String() says:
String returns a human-readable description of c. It is intended only for debugging. In particular, it is not suitable for use as input to a shell. The output of String may vary across Go releases.
It's probably not worth investing in fancier quoting for this one place where we include a space in an arg.
The trick of embedding error in cmdError is interesting. I took a long moment looking for func (c cmdError) Error() string before realizing that's just part of the error interface. I'll note that since there's no Unwrap, you can't unwrap to the inner err. Which you don't make use of here, but might be slightly surprising under future modifications.
beautifulentropy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I think the tool looks great. I've just got a couple of comments and suggestions.
8d49423 to
de42bde
Compare
de42bde to
f5e096e
Compare
Create tools/release/tag and tools/release/branch, a pair of small Go scripts which automates the creation of release tags and hotfix branches. It also updates our release documentation to provide instructions on how to use these new tools.
//tools/release/tag/main.go:
In its primary mode, this script creates a new release tag pointing at the current tip of
main. It assumes that you have "github.com/letsencrypt/boulder" (i.e. this repo) set as your "origin" remote. The new tag is always of the format "v0.YYYYMMDD.0", so that the major version does not make any backwards-compatibility guarantees, the minor version continues our tradition of date-stamping our version numbers, and the patch version can be incremented by hotfix releases. It only pushes the newly-created tag if passed the "-push" flag; otherwise it just creates the new tag locally and exits, allowing the user to inspect it and push it themselves.This tag naming system is superior to our current "release-YYYY-MM-DD[a]" system for a few reasons. First, by virtue of being a Semver, we get access to tools (like pkg.go.dev) which understand semver. It shortens our tags, making them easier to read in horizontally-constrained environments like github's tag dropdowns and releases sidebar. And it provides a dedicated place (the patch version) for us to indicate hotfix tags, rather than our ad-hoc letter-based suffix system.
Eventually, it will also support a mode where you supply a hotfix release branch name, and it tags the tip of that branch instead of the tip of main. This mode does not yet exist, to ensure that we can land the this MVP.
Sample output:
//tools/release/branch/main.go:
This script tags an existing tag name as input, and produces a new release branch starting at that tag. The new branch has the name "release-branch-foo", where "foo" is the major and minor of the base tag's semantic version number. The intention is that commits will then be merged to that release branch using the standard pull-request workflow, and then the as-yet-unimplemented code path of the tagging tool (see above) will be used to tag the hotfix release itself.
Sample output:
Fixes #5726