-
Notifications
You must be signed in to change notification settings - Fork 74
feat(toolkit-lib): deploy prompt prints security diff and returns template diff #437
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
Changes from 1 commit
c55a2d1
5afa163
daa4888
331ea85
2411795
4c5fe60
fd724f8
438f098
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -512,13 +512,19 @@ export class Toolkit extends CloudAssemblySourceBuilder { | |
| }); | ||
|
|
||
| const securityDiff = formatter.formatSecurityDiff(); | ||
| const permissionChangeType = securityDiff.permissionChangeType; | ||
|
|
||
| console.log('diffs', JSON.stringify(formatter.diffs)); | ||
|
|
||
| // Send a request response with the formatted security diff as part of the message, | ||
| // and the template diff as data | ||
| // (IoHost decides whether to print depending on permissionChangeType) | ||
| const deployMotivation = '"--require-approval" is enabled and stack includes security-sensitive updates.'; | ||
| const deployQuestion = `${deployMotivation}\nDo you wish to deploy these changes`; | ||
| const deployQuestion = `${securityDiff.formattedDiff}\n\n${deployMotivation}\nDo you wish to deploy these changes`; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't have a good way of testing this because formatted diff has a bunch of bold/underlined/colored words so it's hard to unit test
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. run |
||
| const deployConfirmed = await ioHelper.requestResponse(IO.CDK_TOOLKIT_I5060.req(deployQuestion, { | ||
| motivation: deployMotivation, | ||
| concurrency, | ||
| permissionChangeType, | ||
| permissionChangeType: securityDiff.permissionChangeType, | ||
| templateDiffs: formatter.diffs, | ||
| })); | ||
| if (!deployConfirmed) { | ||
| throw new ToolkitError('Aborted by user'); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.