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

feat: add autobump script #1335

Merged
merged 1 commit into from
Mar 26, 2020
Merged

Conversation

MrArnoldPalmer
Copy link
Contributor

Changes all version numbers in package.json to 0.0.0. to centralize current version to a single location in lerna.json. This removes noise from release PRs.

Adds scripts for aligning package versions to the current version. Changes content of scripts/bump.sh to only bump

Note:
Changing to using standard-version for bumping and changelog from lerna means that all changes are documented in the root CHANGELOG.md instead of within individual package folders.

It is possible to continue to use lerna to bump versions, however a couple of issues come up with that.

  1. running lerna publish or lerna version requires you to be attached to a branch. Most CI environments check out an individual commit and are are in a detached state. This means we would have to re-attach somehow.

  2. bumping with lerna replaces all of the "version": "0.0.0" fields in package's package.json files with the newly bumped version. So release PRs still have the version noise.

In summay, if we want to have changelogs in package dirs, we probably can't have "v0.0.0" in source code. If we want "v0.0.0" in source code, we should go this way and have a central changelog. Central version = central changelog.

Example Release PR


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

@MrArnoldPalmer MrArnoldPalmer requested review from RomainMuller, rix0rrr, eladb and a team March 15, 2020 23:46
@mergify
Copy link
Contributor

mergify bot commented Mar 15, 2020

The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged.
[Conventional Commits]: https://www.conventionalcommits.org

4 similar comments
@mergify
Copy link
Contributor

mergify bot commented Mar 15, 2020

The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged.
[Conventional Commits]: https://www.conventionalcommits.org

@mergify
Copy link
Contributor

mergify bot commented Mar 15, 2020

The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged.
[Conventional Commits]: https://www.conventionalcommits.org

@mergify
Copy link
Contributor

mergify bot commented Mar 15, 2020

The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged.
[Conventional Commits]: https://www.conventionalcommits.org

@mergify
Copy link
Contributor

mergify bot commented Mar 15, 2020

The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged.
[Conventional Commits]: https://www.conventionalcommits.org

@mergify mergify bot added contribution/core This is a PR that came from AWS. labels Mar 15, 2020
@MrArnoldPalmer MrArnoldPalmer changed the title feature: add autobump script feat: add autobump script Mar 15, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 971da5d
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 48a9c8a
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@MrArnoldPalmer MrArnoldPalmer force-pushed the chore/v0.0.0 branch 2 times, most recently from efd4cde to 9cedf03 Compare March 16, 2020 00:43
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: efd4cde
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 9cedf03
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

I am fine with a central CHANGELOG. If we wanted, we could just copy this CHANGELOG file to all modules, but that's an overkill

@@ -0,0 +1,38 @@
#!/usr/bin/env node
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we extract this from CDK into a stupid little node module instead of copying and pasting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm cool with it. Cute name ideas?

@@ -0,0 +1,20 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

same


# Generate CHANGELOG and create a commit (see .versionrc.json)
npx standard-version --release-as ${version}
Copy link
Contributor

Choose a reason for hiding this comment

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

I am totally fine with moving to standard-version here

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 59f0619
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 5a3bda7
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: ea65fcb
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@eladb
Copy link
Contributor

eladb commented Mar 26, 2020

@MrArnoldPalmer shall we get this merged?

@MrArnoldPalmer
Copy link
Contributor Author

Yeah I'm fixing the tests here to remove version #s instead of aligning before tests. Will do this now.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 80f812a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@MrArnoldPalmer MrArnoldPalmer added the pr/do-not-merge This PR should not be merged at this time. label Mar 26, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 8fe4771
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: f83740e
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@@ -150,6 +150,6 @@
"name": "IBaseInterface"
}
},
"version": "1.1.0",
"fingerprint": "piaiqNxSj1XkycnXHPRG4697t6DpKGgkya6effAlXKI="
"version": "0.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh cool we no longer need to update tests in version bumps!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, this does add some complexity to how we build though.

Since tests rely on version numbers not changing, we have to build+test before we run align-version in our build pipeline. Then after running align-version, I'm wary of running package.sh without running build again because if for some reason we changed how align-version works or otherwise do something that could affect the build, then I'd like to know about that failure.

Because of this I actually changed buildspec.yml to do build+test+align-version+build+pack. This seems to be the safest thing for now? @eladb am I being irrational by worrying about this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that sounds like what I would do. Not ideal but will work I believe until we figure out some other way...

@MrArnoldPalmer MrArnoldPalmer removed the pr/do-not-merge This PR should not be merged at this time. label Mar 26, 2020
@MrArnoldPalmer MrArnoldPalmer merged commit bdda569 into aws:master Mar 26, 2020
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