-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(toolkit): bootstrap action #33453
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter fails with the following errors:
❌ Features must contain a change to an integration test file and the resulting snapshot.
If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed, add Clarification Request
to a comment.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33453 +/- ##
=======================================
Coverage 81.00% 81.00%
=======================================
Files 238 238
Lines 14271 14271
Branches 2492 2492
=======================================
Hits 11560 11560
Misses 2425 2425
Partials 286 286
Flags with carried forward coverage won't be shown. Click here to find out more.
|
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*/ | |
*/ |
await ioHost.notify({ | ||
time: new Date(), | ||
level: 'error', | ||
code: 'CDK_TOOLKIT_E9900' as IoMessageCode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to typecast this to IoMessageCode
?
* Bootstraps the CDK Toolkit stack in the environments used by the specified stack(s). | ||
*/ | ||
|
||
public async bootstrap(cx: ICloudAssemblySource, options: BootstrapEnvironmentOptions = {}): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should copy over and expose only what makes sense for BootstrapEnvironmentOptions
. Take a look at what we've brought in thats slightly different than what the CDK CLI offers. It lives in lib/actions/destroy/index.ts
and all the other actions we currently have
// APIs | ||
export { formatSdkLoggerContent, SdkProvider } from '../../../../aws-cdk/lib/api/aws-auth'; | ||
export { Mode } from '../../../../aws-cdk/lib/api/plugin'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are we using Mode
?
@@ -17,10 +20,11 @@ export { HotswapMode } from '../../../../aws-cdk/lib/api/hotswap/common'; | |||
export { StackActivityProgress } from '../../../../aws-cdk/lib/api/util/cloudformation/stack-activity-monitor'; | |||
export { RWLock, type ILock } from '../../../../aws-cdk/lib/api/util/rwlock'; | |||
export { formatTime } from '../../../../aws-cdk/lib/api/util/string-manipulation'; | |||
export { rootDir } from '../../../../aws-cdk/lib/util/directories'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are we using rootDir
?
|
||
// @todo Not yet API probably should be | ||
export { formatErrorMessage } from '../../../../aws-cdk/lib/util/error'; | ||
export { obscureTemplate, serializeStructure } from '../../../../aws-cdk/lib/serialize'; | ||
export { loadStructuredFile, obscureTemplate, serializeStructure } from '../../../../aws-cdk/lib/serialize'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are we using loadStructuredFile
?
import * as path from 'node:path'; | ||
import * as cxapi from '@aws-cdk/cx-api'; | ||
import * as fs from 'fs-extra'; | ||
import { BootstrapEnvironmentOptions, SdkProvider, Bootstrapper, StringWithoutPlaceholders } from '../../lib/api/aws-cdk'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the imports here, if needed, should be imported into https://github.com/aws/aws-cdk/blob/main/packages/@aws-cdk/toolkit/test/util/aws-cdk.ts and used from there. that is because you are currently importing things you want to use in tests but it will get bundled into the released toolkit as well.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Comments on closed issues and PRs are hard for our team to see. |
Issue #33180.
Closes #33180.
Reason for this change
Programmatic toolkit bootstrap action.
Description of changes
Added the bootstrap action and tests.
Describe any new or updated permissions being added
No permissions changes.
Description of how you validated changes
Added unit tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license