Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Feb 14, 2025

Reason for this change

Make bootstrap and deployment api code use the new IoHost interface.
This will be required so we can accurately track the action for each log.

Description of changes

Change a lot of logging to use the IoHost.

There is a temporary annoyance that we also have to pass the action. In future we will likely replace this with an internal IoHost version that is action aware. To make this easier for now, a new temporary interface IoMessaging is introduced. This is also why I'm using restructuring { ioHost, action } in many places. To idea being that removing the action later on will be simpler or at least give cleaner diff.

Describe any new or updated permissions being added

n/a

Description of how you validated changes

existing tests

Checklist


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

@mrgrain mrgrain requested a review from a team as a code owner February 14, 2025 15:31
@aws-cdk-automation aws-cdk-automation requested a review from a team February 14, 2025 15:31
@github-actions github-actions bot added the p2 label Feb 14, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 14, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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:

❌ CodeCov is indicating a drop in code coverage

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.

@mrgrain mrgrain force-pushed the mrgrain/chore/cli/deployments-io-host branch from 59eea4d to 3668ceb Compare February 14, 2025 19:55
@mrgrain mrgrain force-pushed the mrgrain/chore/cli/deployments-io-host branch from 3668ceb to f8a379b Compare February 14, 2025 20:41
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.

at its core the payout of this PR should be a 1-1 mapping of the existing logging functions in bootstrap & deployments to ioHost.notify() right?

are there any particular parts of this PR that warrant additional scrutiny? i might miss it given the large diff of passing { ioHost, action } everywhere.

return new Deployments({
sdkProvider: await this.sdkProvider(action),
toolkitStackName: this.toolkitStackName,
ioHost: this.ioHost as any, // @todo temporary while we have to separate IIoHost interfaces
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we have separate IIoHost interfaces?

Copy link
Contributor Author

@mrgrain mrgrain Feb 14, 2025

Choose a reason for hiding this comment

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

Because currently the toolkit depends on the CLI package (and therefore the CLI cannot depend on the toolkit). Once the repo split is complete, we will introduce a new private intermediate package that both toolkit and CLI can depend on.

}

export async function cleanupOldChangeset(changeSetName: string, stackName: string, cfn: ICloudFormationClient) {
async function cleanupOldChangeset(
Copy link
Contributor

Choose a reason for hiding this comment

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

does cleanupOldChangeset not get exposed to users of aws-cdk? asking if you've checked that it's safe to unexport this function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's only use is inside this file. We have previously compiled a list of symbols that are "externally used" and this is not part of it.

@mrgrain
Copy link
Contributor Author

mrgrain commented Feb 14, 2025

at its core the payout of this PR should be a 1-1 mapping of the existing logging functions in bootstrap & deployments to ioHost.notify() right?

are there any particular parts of this PR that warrant additional scrutiny? i might miss it given the large diff of passing { ioHost, action } everywhere.

That's correct. asset-publishing.ts and deployments.ts at the bottom have a logger class changing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kaizencc special attention

Comment on lines +754 to +763
class ParallelSafeAssetProgress extends BasePublishProgressListener {
private readonly prefix: string;

constructor(prefix: string, { ioHost, action }: IoMessaging) {
super({ ioHost, action });
this.prefix = prefix;
}

protected getMessage(type: cdk_assets.EventType, event: cdk_assets.IPublishProgress): string {
return `${this.prefix}${type}: ${event.message}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kaizencc special attention

@codecov
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 81.25000% with 30 lines in your changes missing coverage. Please review.

Project coverage is 81.01%. Comparing base (523e0f0) to head (4f74068).
Report is 13 commits behind head on main.

❌ Your patch status has failed because the patch coverage (81.25%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #33451      +/-   ##
==========================================
+ Coverage   81.00%   81.01%   +0.01%     
==========================================
  Files         238      238              
  Lines       14271    14290      +19     
  Branches     2492     2494       +2     
==========================================
+ Hits        11560    11577      +17     
- Misses       2425     2426       +1     
- Partials      286      287       +1     
Flag Coverage Δ
suite.unit 81.01% <81.25%> (+0.01%) ⬆️

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

Components Coverage Δ
packages/aws-cdk 79.95% <81.25%> (+0.02%) ⬆️
packages/aws-cdk-lib/core 82.16% <ø> (ø)

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 4f74068
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

➡️ PR build request submitted to test-main-pipeline ⬅️

A maintainer must now check the pipeline and add the pr-linter/cli-integ-tested label once the pipeline succeeds.

@mrgrain mrgrain added pr/do-not-merge This PR should not be merged at this time. pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested labels Feb 17, 2025
@mrgrain mrgrain closed this Feb 17, 2025
@mrgrain
Copy link
Contributor Author

mrgrain commented Feb 17, 2025

Closed in favor of aws/aws-cdk-cli#40

@github-actions
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2025
@mrgrain mrgrain deleted the mrgrain/chore/cli/deployments-io-host branch May 12, 2025 16:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

contribution/core This is a PR that came from AWS. p2 pr/do-not-merge This PR should not be merged at this time. pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants