Skip to content

docs(cli): improve upgrade message - #18195

Merged
mergify[bot] merged 2 commits into
aws:masterfrom
blimmer:blimmer/improve-upgrade-message
Jan 3, 2022
Merged

mergify[bot] merged 2 commits into
aws:masterfrom
blimmer:blimmer/improve-upgrade-message

Conversation

@blimmer

@blimmer blimmer commented Dec 27, 2021

Copy link
Copy Markdown
Contributor

This PR relates to #18024. It adds information on upgrading between major versions to the upgrade banner.


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

@gitpod-io

gitpod-io Bot commented Dec 27, 2021

Copy link
Copy Markdown

@github-actions github-actions Bot added the package/tools Related to AWS CDK Tools or CLI label Dec 27, 2021

const exec = promisify(_exec);

export async function getLatestVersionFromNpm(): Promise<string> {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

try {
const versionCheckCache = new VersionCheckTTL();
const laterVersion = await latestVersionIfHigher(versionNumber(), versionCheckCache);
const laterVersion = await latestVersionIfHigher(currentVersion, versionCheckCache ?? new VersionCheckTTL());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added the ability to pass a version check file via dependency injection to this method to add additional tests. This ensures that the tests aren't mucking with the global version check file.

process.stdout.isTTY = true;
process.env.CDK_DISABLE_VERSION_CHECK = '1';
sinon.stub(process, 'stdout').value({ ...process.stdout, isTTY: true });
sinon.stub(process, 'env').value({ ...process.env, CDK_DISABLE_VERSION_CHECK: '1' });

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed this test from directly setting these global "process" variables to stubbing them with sinon. This ensures that the values get set back to their original values after the tests run. Before this change, the CDK_DISABLE_VERSION_CHECK environment variable was still set in the environment, causing my new tests below to fail.

@blimmer
blimmer force-pushed the blimmer/improve-upgrade-message branch from 16d2b37 to 2816093 Compare December 27, 2021 23:05
@blimmer blimmer changed the title feat(cli): improve upgrade message docs(cli): improve upgrade message Dec 27, 2021
@blimmer
blimmer marked this pull request as ready for review December 27, 2021 23:06
@blimmer blimmer mentioned this pull request Dec 27, 2021
1 of 2 tasks
@blimmer
blimmer force-pushed the blimmer/improve-upgrade-message branch from 2816093 to ce8a001 Compare December 27, 2021 23:20

@rix0rrr rix0rrr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is great, thanks!

@mergify

mergify Bot commented Jan 3, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: f508b43
  • 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 e1d7efa into aws:master Jan 3, 2022
@mergify

mergify Bot commented Jan 3, 2022

Copy link
Copy Markdown
Contributor

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).

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
This PR relates to aws#18024. It adds information on upgrading between major versions to the upgrade banner.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
ali-n4i pushed a commit to ali-n4i/aws-cdk that referenced this pull request Jul 29, 2026
This PR relates to aws#18024. It adds information on upgrading between major versions to the upgrade banner.

----

*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

package/tools Related to AWS CDK Tools or CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants