Skip to content
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

chore: update release scripts #466

Merged
merged 3 commits into from
Sep 23, 2023
Merged

chore: update release scripts #466

merged 3 commits into from
Sep 23, 2023

Conversation

hds
Copy link
Collaborator

@hds hds commented Sep 21, 2023

Improve the commit message added to release commits. It now includes a
complete change log for the release being made.

When the console-api version changes, it also needs to be changed in
the crates that depend on it. The release script now does this via cargo
update-version (from cargo-edit).

Committing the Cargo.lock file after publishing has been moved to
before adding the version tag to ensure that the correct commit is
tagged. The change log is also updated in the amended commit so that the
hash is correct.

The cliff configuration file has also been updated to fix some
incorrectly formatted commits.

@hds hds requested a review from a team as a code owner September 21, 2023 21:23
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some minor nits/questions about the bash script changes. Thanks so much for working on this!

bin/release.sh Show resolved Hide resolved
bin/release.sh Outdated
Comment on lines 121 to 122
tmp_changelog_path="tmp-changelog"
tmp_commit_msg_path="tmp-commit-msg"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, this is a bit unfortunate, since it creates the temporary files in the current working dir, and if the script exits early due to a command failing, the temporary files will be left behind.

we should maybe consider using mktmp to create a temporary dir files in the system's temporary directory (e.g. /tmp), instead. that way, even if we're not able to properly clean up our tempfiles, the system will eventually delete them, and we won't have issues with a pre-existing temp file with the same name.

see here for details on how to use mktemp in a cross platform (linux & BSDs like MacOS) way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

bin/release.sh Outdated
@@ -111,7 +174,7 @@ publish() {
echo "# " "${git_push_tags[@]}"
else
"${git_tag[@]}"
"${git_push_tags[@]}"
#"${git_push_tags[@]}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this commented out? should we delete it? or, do we need to put it back so that the tag is actually pushed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated: I moved the push to a separate step after publish, with it's own confirmation.

cliff.toml Outdated
Comment on lines 71 to 78
# Fixes for specific commit messages that we wish we'd committed differently
{ pattern = """^bump tonic\\/prost dependencies and MSRV to 1.64 \\(#464\\)\\s+
(.+\\s+.+)""", replace = """feat(api): update `tonic` to v0.10 and increase MSRV to 1.64 (#464)

BREAKING CHANGE:
This is a breaking change for users of `console-api` and `console-subscriber`,
as it changes the public `tonic` dependency to a semver-incompatible version.
This breaks compatibility with `tonic` 0.9. and `prost` 0.11.""" },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sigh...this is a good call, but it's unfortunate that we have to do this. maybe at some point we should go back and edit the git history so that that commit isn't screwy...this looks good for now though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed now that you updated the commit.

bin/release.sh Outdated
Comment on lines 11 to 12
--publish-dry-run
Perform a dry run on the publish step only."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very tiny style nit: i would prefer to format this so that it's on the same line, and just go back and indent the other flags slightly more:

Suggested change
--publish-dry-run
Perform a dry run on the publish step only."
--publish-dry-run Perform a dry run on the publish step only."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Improve the commit message added to release commits. It now includes a
complete change log for the release being made.

When the `console-api` version changes, it also needs to be changed in
the crates that depend on it. The release script now does this via cargo
update-version (from cargo-edit).

Committing the `Cargo.lock` file after publishing has been moved to
before adding the version tag to ensure that the correct commit is
tagged. The change log is also updated in the amended commit so that the
hash is correct.

The cliff configuration file has also been updated to fix some
incorrectly formatted commits.
@hds hds force-pushed the hds/release-script-update branch 2 times, most recently from 3e4fb17 to 184b611 Compare September 22, 2023 11:10
cliff.toml Outdated Show resolved Hide resolved
bin/release.sh Show resolved Hide resolved
bin/release.sh Outdated Show resolved Hide resolved
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
@hds hds merged commit 40ffd01 into main Sep 23, 2023
11 checks passed
@hds hds deleted the hds/release-script-update branch September 23, 2023 18:33
hawkw pushed a commit that referenced this pull request Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants