-
Notifications
You must be signed in to change notification settings - Fork 833
[scripts] Introduce a script that will create release/prerelease #6954
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
base: master
Are you sure you want to change the base?
Conversation
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.
(in progress and still thinking things through, submitted too soon by accident, sorry!)
other vague feelings, to use however you feel like:
- tbh I don't see the point in checking build / etc. we shouldn't be tagging things that aren't already reviewed and available remotely, in which case the local state is almost completely meaningless.
- same with tidying, the PR process covers that. or if we're actually checking for safety we should probably do a full
make pr
andmake test
but that's a bajillion times slower. - main branch as a limitation too: this would mean we wouldn't be able to make a hotfix branch and tag it. warning seems like a good idea, but enforcing doesn't seem beneficial.
- removing that would cut out like 1/3 of the code here.
- same with tidying, the PR process covers that. or if we're actually checking for safety we should probably do a full
- dir-walking to find modules feels kinda excessive... but the only alternative I can think of is
go list -m github.com/uber/cadence/...
which needs to download stuff and might be listing remote versions rather than local... which is weird but I can't find a way around it.- if we want to force "has zsh" then
ls **/go.mod
maybe, but that's not really any simpler withexec
boilerplate so probably not. - this is not really a comment about the code, more "it feels strange that go list doesn't have a trivial option for this".
- arguably reading
go.work
would be a good choice? it's the list of modules we want to release.
- if we want to force "has zsh" then
- dry-run mode figures out versions, but doesn't help you figure out what to do if non-dry-run fails, and if it does fail then
CheckVersionExists
will just leave you with an incomplete process that you can't resume. - no
exec.CommandContext
means... can this be interrupted? or does urfave just kill the process (which would hide error output if killed while a command was busy)
tbh I kinda feel like this whole thing could be reduced to:
- find modules (likely what you're already doing)
- find versions (same)
- increment (same) or set
- warn about already-existing (definitely useful!) but don't stop
- just print out the tagging and pushing commands to run by hand.
then there would be no need for dry run vs not, it'd be like half the code or less, hanging operations (like internal git auth) would be visible rather than simply hang forever, and working around any of the infinite variety of git errors is trivial because you don't have to fix the tool to do so.
and the tool could essentially be just a few keywords. I'd even skip urfave tbh.
# increments prerelease
> ./release
most-recent versions:
v1.2.3-prerelease01
.../gcloud v1.2.2 # helps find when out of sync
to tag:
git tag v1.2.3-prerelease02
git tag common/archiver/gcloud/v1.2.3-prerelease02
to release:
git push origin v1.2.3-prerelease02
git push origin common/archiver/gcloud/v1.2.3-prerelease02
# increment minor and make it a prerelease
> ./release minor
... v1.3.0-prerelease01 output
# drop prerelease
> ./release release
... v1.2.3 output
# choose a version if the arg passes semver parsing, with some simple issues
> ./release v1.2.3
warning: you are not on master
continue? [y/N]: y
warning: these tags already exist
v1.2.3 GITSHAHERE
continue? [y/N]: y
to tag:
git tag v1.2.3
git tag common/archiver/gcloud/v1.2.3
to release:
git push origin v1.2.3
git push origin common/archiver/gcloud/v1.2.3
case "minor": | ||
newVersion = currentVersion.IncMinor() | ||
case "patch": | ||
newVersion = currentVersion.IncPatch() |
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.
ah, nice, these do the right thing around prerelease / zeroing lower fields / etc. thanks, mastermind!
What changed?
New script that helps to ensure prereleases/releases for all modular components
Example output:
Addition information that pushed to usage for help:
Status overview
Why?
To simplify the release process and ensure that nothing is missed.
How did you test it?
Running local on my repo.
Potential risks
Invalid release tags
Release notes
Documentation Changes