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

refactor(cli): require approval is a part of the CliIoHost #151

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

kaizencc
Copy link
Contributor

@kaizencc kaizencc commented Feb 25, 2025

CliIoHost now governs when to ask for approval or not. This was previously passed into deploy via deployOptions.

  • deployOptions.requireApproval was deprecated before, and now it is no longer being used (this may have to be pulled into a different change that removes the requireApproval option entirely in a minor version bump of toolkit-lib.
  • CliIoHost has a property, requireApproval that can be set. When the requestResponse API is called, we check to see if the message code is a known requireApproval code and if so, see if the request is necessary or if the default can be used.

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

@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 96.49123% with 2 lines in your changes missing coverage. Please review.

Project coverage is 84.70%. Comparing base (c9c2e20) to head (d7f41b8).

Files with missing lines Patch % Lines
packages/aws-cdk/lib/toolkit/cli-io-host.ts 96.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #151      +/-   ##
==========================================
- Coverage   84.90%   84.70%   -0.21%     
==========================================
  Files         204      204              
  Lines       35647    35703      +56     
  Branches     4630     4614      -16     
==========================================
- Hits        30266    30241      -25     
- Misses       5224     5309      +85     
+ Partials      157      153       -4     
Flag Coverage Δ
suite.unit 84.70% <96.49%> (-0.21%) ⬇️

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.

@kaizencc kaizencc marked this pull request as ready for review February 28, 2025 01:30
@kaizencc kaizencc changed the title feat(cli): require approval is a part of the CliIoHost refactor(cli): require approval is a part of the CliIoHost Feb 28, 2025
@@ -246,8 +246,6 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab

await migrator.tryMigrateResources(stackCollection, options);

const requireApproval = options.requireApproval ?? RequireApproval.NEVER;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this breaks the behavior of the requireApproval option but i don't have a good way or hooking it up to the requireApproval governed by the CliIoHost -- toolkit.ts only has a concept of an IIoHost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants