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(deps): Keep aws-cdk dependencies in integration-test up to date #420

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

akash1810
Copy link
Member

What does this change?

We perform a check at CI time to ensure the version of aws-cdk libraries we're using are within 5 versions of the latest available.

If we're out of date, CI fails with instructions to run ./script/update-aws-cdk. This script uses ncu (npm-check-updates) to update the aws-cdk dependencies.

This change updates the call to ncu to:

  • Configure ncu to update the "aws-cdk" dependency in addition to @aws-cdk/*
  • Add the --deep flag to "Run recursively in current working directory."

Before (only checking cdk/package.json)

./script/update-aws-cdk

> @guardian/[email protected] update-aws-cdk /Users/akash_askoolum/code/cdk
> ncu "/^@aws-cdk/.*$/" --upgrade && npm install

Upgrading /Users/akash_askoolum/code/cdk/package.json
[====================] 15/15 100%

All dependencies match the latest package versions :)

After (checking cdk/package.json, eslint/package.json and integration-test/package.json)

./script/update-aws-cdk

> @guardian/[email protected] update-aws-cdk /Users/akash_askoolum/code/cdk
> ncu "/^@aws-cdk/.*$/", aws-cdk --upgrade --deep && npm install

Upgrading /Users/akash_askoolum/code/cdk/package.json

No dependencies.
Upgrading /Users/akash_askoolum/code/cdk/eslint/package.json

No dependencies.
Upgrading /Users/akash_askoolum/code/cdk/integration-test/package.json
[====================] 1/1 100%

All dependencies match the latest package versions :)

See:

Does this change require changes to existing projects or CDK CLI?

No.

How to test

Run the ./script/update-aws-cdk script?

How can we measure success?

We update all aws-cdk dependencies in one go.

Have we considered potential risks?

n/a

We perform a check at CI time to ensure the version of aws-cdk libraries we're using are within 5 versions of the latest available.

If we're out of date, CI fails with instructions to run `./script/update-aws-cdk`. This script uses ncu (npm-check-updates) to update the aws-cdk dependencies.

This change updates the call to ncu to:
  - Configure ncu to update the "aws-cdk" dependency in addition to @aws-cdk/*
  - Add the --deep flag to "Run recursively in current working directory."

See:
  - https://www.npmjs.com/package/npm-check-updates
  - #192
@akash1810 akash1810 requested a review from a team April 12, 2021 06:54
@akash1810 akash1810 merged commit 31b4a64 into main Apr 12, 2021
@akash1810 akash1810 deleted the aa-integration-test-deps branch April 12, 2021 17:41
@github-actions
Copy link
Contributor

🎉 This PR is included in version 8.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

akash1810 added a commit that referenced this pull request Apr 15, 2021
In #420 we updated the arguments to `ncu` to update the aws-cdk libraries.

Having run the command to try to update to @aws-cdk/* v 1.98.0, it is only updating the library "aws-cdk" rather than "@aws-cdk/*" and "aws-cdk".

This change switches to a regex pattern rather than multiple inputs to `ncu` and things seem much happier.

```console
➜ ./script/update-aws-cdk

> @guardian/[email protected] update-aws-cdk /Users/akash_askoolum/code/cdk
> ncu "/^@?aws-cdk(/.*)?$/" --upgrade --deep && npm install

Upgrading /Users/akash_askoolum/code/cdk/package.json
[====================] 15/15 100%

 @aws-cdk/assert                      1.97.0  →  1.98.0
 @aws-cdk/aws-apigateway              1.97.0  →  1.98.0
 @aws-cdk/aws-autoscaling             1.97.0  →  1.98.0
 @aws-cdk/aws-cloudwatch-actions      1.97.0  →  1.98.0
 @aws-cdk/aws-ec2                     1.97.0  →  1.98.0
 @aws-cdk/aws-elasticloadbalancing    1.97.0  →  1.98.0
 @aws-cdk/aws-elasticloadbalancingv2  1.97.0  →  1.98.0
 @aws-cdk/aws-events-targets          1.97.0  →  1.98.0
 @aws-cdk/aws-iam                     1.97.0  →  1.98.0
 @aws-cdk/aws-kinesis                 1.97.0  →  1.98.0
 @aws-cdk/aws-lambda                  1.97.0  →  1.98.0
 @aws-cdk/aws-lambda-event-sources    1.97.0  →  1.98.0
 @aws-cdk/aws-rds                     1.97.0  →  1.98.0
 @aws-cdk/aws-s3                      1.97.0  →  1.98.0
 @aws-cdk/core                        1.97.0  →  1.98.0

Run npm install to install new versions.

Upgrading /Users/akash_askoolum/code/cdk/eslint/package.json

No dependencies.
Upgrading /Users/akash_askoolum/code/cdk/integration-test/package.json
[====================] 1/1 100%

 aws-cdk  1.97.0  →  1.98.0

Run npm install to install new versions.

> @guardian/[email protected] prepare /Users/akash_askoolum/code/cdk
> tsc

npm WARN @guardian/[email protected] No license field.

updated 24 packages and audited 1807 packages in 17.102s

96 packages are looking for funding
  run `npm fund` for details

found 51 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants