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: new private 'cdk-release' tool for performing releases #15331

Merged
merged 2 commits into from
Jul 6, 2021

Conversation

skinny85
Copy link
Contributor

@skinny85 skinny85 commented Jun 28, 2021

Introduce a new repo-private tool called cdk-release that replaces standard-version in our 'bump' process.
It's responsible for updating the version file with the new version, generating the Changelog based on on the commit history,
and performing the commit that includes the two above files.

It allows us to correctly handle edge cases that we had to work around previously with standard-version:

  • For patch releases, standard-version always generated the main header as H3, while we want H2.
    We always had to correct that manually, and we sometimes forgot.
    This tool does the correct thing for patch releases too.
  • We had to hack around when we wanted to change the heading 'BREAKING CHANGES' to 'BREAKING CHANGES TO EXPERIMENTAL FEATURES'.
    This tool now does it natively, no hacks needed.
  • In V2, standard-version couldn't figure out the tag to compare to, because we have tags for 2 major versions present in the repo.
    This tool handles this without the hacks of locally removing and then re-fetching the tags.
  • Also in V2, we want to strip the changes to experimental packages (as those are not included in aws-cdk-lib).
    With standard-version, we had to grep in the resulting Changelog, which was very fragile
    (for example, in 2.0.0-rc.7, our Changelog includes breaking changes to appmesh, which is an experimental module).
    This tool handles this case natively, by filtering out commits, without the need for fragile Changelog grepping.

To make sure we don't break our release process, allow passing the environment variable LEGACY_BUMP as truthy to fall back on standard-version.
Once we make at least one successful release,
in both major versions, using this new tool,
I'll remove the old standard-version based code in a separate PR.

In a subsequent PR, the tool will be enhanced with the capability to generate separate version bumps and Changelogs for experimental packages in V2.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@skinny85 skinny85 requested a review from rix0rrr June 28, 2021 21:42
@skinny85 skinny85 self-assigned this Jun 28, 2021
@gitpod-io
Copy link

gitpod-io bot commented Jun 28, 2021

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jun 28, 2021
@skinny85 skinny85 force-pushed the changelog-generator branch from 8e1e551 to 040fc48 Compare June 28, 2021 22:17
@rix0rrr rix0rrr requested a review from nija-at June 29, 2021 08:08
@skinny85 skinny85 force-pushed the changelog-generator branch from 040fc48 to 1b71bbe Compare June 29, 2021 23:42
@skinny85 skinny85 requested a review from rix0rrr June 29, 2021 23:42
@skinny85
Copy link
Contributor Author

@rix0rrr incorporated your comments, would appreciate another review!

@rix0rrr rix0rrr added the pr/do-not-merge This PR should not be merged at this time. label Jun 30, 2021
@skinny85 skinny85 force-pushed the changelog-generator branch from 1b71bbe to 1f8aaea Compare June 30, 2021 17:56
@skinny85 skinny85 removed the pr/do-not-merge This PR should not be merged at this time. label Jul 6, 2021
@mergify
Copy link
Contributor

mergify bot commented Jul 6, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: a449436
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit d779be0 into aws:master Jul 6, 2021
@mergify
Copy link
Contributor

mergify bot commented Jul 6, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@skinny85 skinny85 deleted the changelog-generator branch July 6, 2021 20:51
upparekh pushed a commit to upparekh/aws-cdk that referenced this pull request Jul 8, 2021
)

Introduce a new repo-private tool called `cdk-release` that replaces `standard-version` in our 'bump' process.
It's responsible for updating the version file with the new version, generating the Changelog based on on the commit history,
and performing the commit that includes the two above files.

It allows us to correctly handle edge cases that we had to work around previously with `standard-version`:
* For patch releases, `standard-version` always generated the main header as H3, while we want H2.
  We always had to correct that manually, and we sometimes forgot.
  This tool does the correct thing for patch releases too.
* We had to hack around when we wanted to change the heading 'BREAKING CHANGES' to 'BREAKING CHANGES TO EXPERIMENTAL FEATURES'.
  This tool now does it natively, no hacks needed.
* In V2, `standard-version` couldn't figure out the tag to compare to, because we have tags for 2 major versions present in the repo.
  This tool handles this without the hacks of locally removing and then re-fetching the tags.
* Also in V2, we want to strip the changes to experimental packages (as those are not included in `aws-cdk-lib`).
  With `standard-version`, we had to grep in the resulting Changelog, which was very fragile
  (for example, in `2.0.0-rc.7`, our Changelog includes breaking changes to `appmesh`, which is an experimental module).
  This tool handles this case natively, by filtering out commits, without the need for fragile Changelog grepping.

To make sure we don't break our release process, allow passing the environment variable `LEGACY_BUMP` as truthy to fall back on `standard-version`.
Once we make at least one successful release,
in both major versions, using this new tool,
I'll remove the old `standard-version` based code in a separate PR.

In a subsequent PR, the tool will be enhanced with the capability to generate separate version bumps and Changelogs for experimental packages in V2.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
)

Introduce a new repo-private tool called `cdk-release` that replaces `standard-version` in our 'bump' process.
It's responsible for updating the version file with the new version, generating the Changelog based on on the commit history,
and performing the commit that includes the two above files.

It allows us to correctly handle edge cases that we had to work around previously with `standard-version`:
* For patch releases, `standard-version` always generated the main header as H3, while we want H2.
  We always had to correct that manually, and we sometimes forgot.
  This tool does the correct thing for patch releases too.
* We had to hack around when we wanted to change the heading 'BREAKING CHANGES' to 'BREAKING CHANGES TO EXPERIMENTAL FEATURES'.
  This tool now does it natively, no hacks needed.
* In V2, `standard-version` couldn't figure out the tag to compare to, because we have tags for 2 major versions present in the repo.
  This tool handles this without the hacks of locally removing and then re-fetching the tags.
* Also in V2, we want to strip the changes to experimental packages (as those are not included in `aws-cdk-lib`).
  With `standard-version`, we had to grep in the resulting Changelog, which was very fragile
  (for example, in `2.0.0-rc.7`, our Changelog includes breaking changes to `appmesh`, which is an experimental module).
  This tool handles this case natively, by filtering out commits, without the need for fragile Changelog grepping.

To make sure we don't break our release process, allow passing the environment variable `LEGACY_BUMP` as truthy to fall back on `standard-version`.
Once we make at least one successful release,
in both major versions, using this new tool,
I'll remove the old `standard-version` based code in a separate PR.

In a subsequent PR, the tool will be enhanced with the capability to generate separate version bumps and Changelogs for experimental packages in V2.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants