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(contributors): use 0.0.0 as a version marker #6463

Merged
merged 8 commits into from
Feb 26, 2020
Merged

Conversation

eladb
Copy link
Contributor

@eladb eladb commented Feb 26, 2020

Please see updates in CONTRIBUTING for details on new versioning schema in this repository.

Replace 999.0.0 with 0.0.0 to reduce the risk in accidental publishing. If, by accident, we will publish a module with the version 999.0.0, it will semantically always be the latest version, and that’s catastrophic. By using 0.0.0 we reduce this risk. Worse case we will have a 0.0.0 module published, which is not a huge problem.

Codify this in scripts/get-version-marker and reuse everywhere, including pkglint.

We also improved the pack.sh script in the following ways:

  • Use get-version.js to obtain the version for build.json (instead of reading from lerna.json)
  • Fail if the version does not start with “1.” to protect against publishing a different major version
  • Adds an additional check to verifies that none of the file names under dist/ uses the “0.0.0” marker.

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

Replace `999.0.0` with `0.0.0` to reduce the risk in accidental publishing. If, by accident, we will publish a module with the version `999.0.0`, it will semantically always be the latest version, and that’s catastrophic. By using `0.0.0` we reduce this risk. Worse case we will have a `0.0.0` module published, which is not a huge problem.

Codify this in `scripts/get-version-marker` and reuse everywhere.

We also improved the `pack.sh` script in the following ways:
- Use `get-version.js` to obtain the version for build.json (instead of reading from lerna.json)
- Fail if the version does not start with “1.” to protect against publishing a different major version
- Adds an additional check to verifies that none of the file names under `dist/` uses the “0.0.0” marker.
@eladb eladb added the pr/do-not-merge This PR should not be merged at this time. label Feb 26, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 26, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 4877f02
  • 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-qxepHUsryhcu
  • Commit ID: cecb7e9
  • Result: FAILED
  • Build Logs (available for 30 days)

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

Copy link
Contributor

@RomainMuller RomainMuller left a comment

Choose a reason for hiding this comment

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

I very much prefer 0.0.0.

I also wonder if we should add provisions on cdk --version and error messages that include the chain's version (CX protocol mismatch, ...) so they actually display something other than 0.0.0, for example HEAD or local development build, something like that... That's not essential, but I feel like it may save some confusion to contributors who don't expect this (it should also be mentioned in CONTRIBUTING.md that non-release builds will always consistently use version 0.0.0 internally).

scripts/get-version-marker.js Show resolved Hide resolved
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@eladb eladb changed the title chore: use 0.0.0 as version marker & additional protection in pack.sh feat(contributors): use 0.0.0 as a version marker Feb 26, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 0dbbb02
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@eladb eladb marked this pull request as ready for review February 26, 2020 09:54
@eladb eladb removed the pr/do-not-merge This PR should not be merged at this time. label Feb 26, 2020
pack.sh Show resolved Hide resolved
tools/pkglint/lib/rules.ts Outdated Show resolved Hide resolved
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: cea81a3
  • 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-qxepHUsryhcu
  • Commit ID: 9d4fe58
  • 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-qxepHUsryhcu
  • Commit ID: b356b47
  • 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-qxepHUsryhcu
  • Commit ID: 1c6a08a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@eladb eladb merged commit d5f88c7 into master Feb 26, 2020
@eladb eladb deleted the benisrae/marker-0.0.0 branch February 26, 2020 12:02
jogold added a commit to jogold/aws-cdk that referenced this pull request Feb 26, 2020
Stack-level tags apply to all supported resources in a stack. If they change, a
fast "no-op" deploy should not occur (e.g. a tag with the CDK version or a tag
with the commit hash when running in CI).

Fix the `'deploy not skipped if template changed'` test that was including the
`force` option.

Fix CLI integ tests not working anymore after aws#6463 and the `0.0.0` version.
mergify bot added a commit that referenced this pull request Feb 27, 2020
* fix(cli): fast "no-op" deploys do not consider tags

Stack-level tags apply to all supported resources in a stack. If they change, a
fast "no-op" deploy should not occur (e.g. a tag with the CDK version or a tag
with the commit hash when running in CI).

Fix the `'deploy not skipped if template changed'` test that was including the
`force` option.

Fix CLI integ tests not working anymore after #6463 and the `0.0.0` version.

* else

* compareTags

* README

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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