-
Notifications
You must be signed in to change notification settings - Fork 4k
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: master version in one place #6410
Conversation
To avoid merge conflicts when merging back a release, update the checked-in repo version number to 999.999.999. Also, use fixed versions across the board (no carets!).
Store the current repo version only in the root pacakge.json in order to avoid the need to specify the version number everywhere in the codebase. In order to achieve that, I changed all package.json files to use a version marker 999.999.999 to indicate it's a local dependency. This marker is better than 0.0.0.0 since it will make sure cache is invalidated for various languages (for example, Maven will only bring in a new version if the local cache has an older version). Then, we needed to change a couple of other things: - The bump script is now very simple. It merely updates the root package.json and creates the CHANGELOG. That's it. - Before running a CI build (buildspec.yml), we run `scripts/set-version.sh` which uses lerna to update the version in all package.json files. This means that build artifacts that are produced in CI builds get the actual repo version, and dev builds all use 999.999.999.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Is this going to mess with local (I mean, the answer is "yes" but the question is how bad?) |
I find the |
Other than that I fully support this change! |
I will change to 999.0.0 I see your point ;-) |
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.
After discussing on Chime that peerDependencies have gotten fixed versions:
peerDependencies should be using carets. That way, the indicate a minimum version required (but not a maximum! Otherwise we're back to the bad old days of "all libraries and the customer must be using the same version of the CDK with no slack", which is not great)
Move configuration from package.json to bump.sh and change the commit title to `chore(release): vX.Y.Z`
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@rix0rrr I looked into changing peer dependencies into carets and it seems like we haven't had that previously (look at the diff), so I prefer not to introduce this change right now. I also think that given our modules declare all their dependencies as fixed, a caret peer would not help to address the use case you describe (will only make it worse actually). The current state of the world when it comes to deps is that consumers must use the same version of the AWS CDK they use for all their deps. |
Okay, not part of this particular change I guess |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This change includes two commits:
Store the current repo version only in the root
package.json
in order to avoid the need to specify the version number everywhere in the codebase.This has two benefits:
In order to achieve that, I changed all package.json files to use a version marker 999.999.999 to indicate it's a local dependency. This marker is better than 0.0.0.0 since it will make sure cache is invalidated for various languages (for example, Maven will only bring in a new version if the local cache has an older version).
This change also modifies all version requirements to use fixed versions instead of caret (
^
) versions.Then, we needed to change a couple of other things:
bump.sh
script is now very simple: it merely updates the rootpackage.json
and creates the CHANGELOG.scripts/set-version.sh
is executed inbuildspec.yml
before the build, and it useslerna version
to update the all package.json files to the actual version. This means that build artifacts that are produced in CI builds get the actual repo version, and dev builds all use 999.999.999.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license