Skip to content

chore(ci): adopt new CDK Toolkit Library #3665

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

Merged
merged 10 commits into from
Feb 26, 2025
Merged

chore(ci): adopt new CDK Toolkit Library #3665

merged 10 commits into from
Feb 26, 2025

Conversation

dreamorosi
Copy link
Contributor

Summary

Changes

Please provide a summary of what's being changed

This PR replaces the usage of the @aws-cdk/cli-lib-alpha with the newer @aws-cdk/toolkit-lib that was announced in developer preview earlier today.

This new toolkit is expected to be the way of interacting with CDK programmatically moving forward, so it makes sense for us to adopt it and remove the older @aws-cdk/cli-lib-alpha.

The switch is pretty much a drop-in replacement for us, since we were already abstracting away the CLI from the tests. The bulk of the changes are in the TestStack class in the internal testing package, which now uses the new module.

With this new toolkit we unlocked also two new benefits:

  • since the new package uses the latest dist tag on npmjs.com it can now be picked up by Dependabot update, this was not the case with the @aws-cdk/cli-lib-alpha which was using a pre-release tag.
  • the new module gives more control to how logs are emitted by CDK. Because of this, we can remove a lot of noise from most runs. As part of this PR I implemented a rudimentary log filtering that silences most of the logs except warnings and errors. This happens during regular runs, but when workflows are rerun with debug logging enabled everything is logged. With this change we can keep the output clean, but still have visibility when something breaks.

Finally, while not related to the new toolkit, I also changed the stack generation to include a Service tag to all resources generated as part unit test runs. This was something that I had in the backlog for a while and that will unlock some additional automation down the road. For example, now that things are tagged, we can potentially automate the removal of CloudWatch LogGroup resources, which currently are just piling up. More info on this front in the near future.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #3117


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi self-assigned this Feb 26, 2025
@dreamorosi dreamorosi requested review from a team as code owners February 26, 2025 18:03
@dreamorosi dreamorosi requested a review from am29d February 26, 2025 18:03
@boring-cyborg boring-cyborg bot added automation This item relates to automation dependencies Changes that touch dependencies, e.g. Dependabot, etc. labels Feb 26, 2025
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Feb 26, 2025
@pull-request-size pull-request-size bot added size/M PR between 30-99 LOC and removed size/L PRs between 100-499 LOC labels Feb 26, 2025
Copy link
Contributor

@am29d am29d left a comment

Choose a reason for hiding this comment

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

Great work, and super fast adoption! E2E tests are green locally and in CICD. 🚀

@am29d am29d merged commit ffb16c3 into main Feb 26, 2025
5 checks passed
@am29d am29d deleted the chore/cdk_toolkit branch February 26, 2025 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation This item relates to automation dependencies Changes that touch dependencies, e.g. Dependabot, etc. size/M PR between 30-99 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: manually bump @aws-cdk/cli-lib-alpha
2 participants