Skip to content

refactor(cli): use IoHelper in internal APIs #209

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 1 commit into from
Mar 7, 2025

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Mar 7, 2025

This PR is a lot. There is no good way of reviewing it, so thanks for taking the time.

The main change here is the usage of the IoHelper in all internal APIs. Previously we would pass an IoHost and an action around as pair, but separate value. Instead we now use the IoHelper which knows how to send messages with an action.

I also decided to rename all properties and params respectively. This is partly what makes the PR so large. Note that all changes are to private APIs.


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

@github-actions github-actions bot added the p2 label Mar 7, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team March 7, 2025 19:01
@mrgrain mrgrain force-pushed the mrgrain/refactor/no-more-actions branch from c3ff921 to b49dfc4 Compare March 7, 2025 19:05
@@ -107,7 +108,7 @@ export async function exec(args: string[], synthesizer?: Synthesizer): Promise<n
proxyAddress: argv.proxy,
caBundlePath: argv['ca-bundle-path'],
},
logger: new SdkToCliLogger(ioHost),
logger: new SdkToCliLogger(asIoHelper(ioHost, ioHost.currentAction as any)),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ioHost.currentAction is extending ToolkitAction with additional values. This is fine.
Same again in L189

@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 85.11327% with 46 lines in your changes missing coverage. Please review.

Project coverage is 85.26%. Comparing base (da515f4) to head (c6d756a).

Files with missing lines Patch % Lines
...ages/aws-cdk/lib/api/deployments/cloudformation.ts 67.85% 9 Missing ⚠️
...ckages/aws-cdk/lib/api/resource-import/importer.ts 57.14% 6 Missing ⚠️
...ckages/aws-cdk/lib/api/deployments/deploy-stack.ts 90.19% 5 Missing ⚠️
...s-cdk/lib/api/environment/environment-resources.ts 63.63% 4 Missing ⚠️
...dk/lib/api/garbage-collection/garbage-collector.ts 89.74% 4 Missing ⚠️
...ckages/aws-cdk/lib/api/resource-import/migrator.ts 55.55% 4 Missing ⚠️
packages/aws-cdk/lib/api/deployments/assets.ts 66.66% 3 Missing ⚠️
...ackages/aws-cdk/lib/api/deployments/deployments.ts 85.00% 3 Missing ⚠️
packages/aws-cdk/lib/cli/cdk-toolkit.ts 75.00% 3 Missing ⚠️
...cdk/lib/api/stack-events/stack-activity-monitor.ts 80.00% 2 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #209      +/-   ##
==========================================
+ Coverage   85.04%   85.26%   +0.22%     
==========================================
  Files         208      208              
  Lines       35786    35710      -76     
  Branches     4633     4652      +19     
==========================================
+ Hits        30435    30449      +14     
+ Misses       5200     5111      -89     
+ Partials      151      150       -1     
Flag Coverage Δ
suite.unit 85.26% <85.11%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -391,35 +393,6 @@ test('reuse previous parameters if requested', async () => {
} as CreateChangeSetCommandInput);
});

describe('ci=true', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted since this test was just testing that the CI dependent stream selection works.

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

seems like a big refactor, but there are no additional things you're sliding in and if the tests pass, i trust you...

@mrgrain mrgrain added the pr/exempt-integ-test Skips the integ test steps if set. label Mar 7, 2025
@mrgrain mrgrain closed this Mar 7, 2025
auto-merge was automatically disabled March 7, 2025 23:11

Pull request was closed

@mrgrain mrgrain reopened this Mar 7, 2025
@mrgrain
Copy link
Contributor Author

mrgrain commented Mar 7, 2025

Added pr/exempt-integ-test because both failing integ tests are external issues.

@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Mar 7, 2025
Merged via the queue into main with commit c71caf0 Mar 7, 2025
36 of 39 checks passed
@aws-cdk-automation aws-cdk-automation deleted the mrgrain/refactor/no-more-actions branch March 7, 2025 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2 pr/exempt-integ-test Skips the integ test steps if set.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants