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): CliIoHost is more self contained #32993

Merged
merged 4 commits into from
Jan 17, 2025

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Jan 17, 2025

Description of changes

We currently have to maintain a global singleton CliIoHost until we have passed the ioHost through all the layers for logging. Previously the global settings for this IoHost were all over the place using setter functions and global variables. This refactor unifies all these APIs on the CliIoHost, through the global instance.

We also need the ability to register a different IoHost that must be used for reporting. This is the case when a Toolkit integrator provides a custom implemenation.

Describe any new or updated permissions being added

no

Description of how you validated changes

Existing and updated test cases.

Checklist


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 Jan 17, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team January 17, 2025 16:35
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jan 17, 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:

❌ CLI code has changed. A maintainer must run the code through the testing pipeline (git fetch origin pull/32993/head && git push -f origin FETCH_HEAD:test-main-pipeline), then add the 'pr-linter/cli-integ-tested' label when the pipeline succeeds.

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-io-host-levels branch from c10ce7a to 0b7a737 Compare January 17, 2025 17:22
@mrgrain mrgrain marked this pull request as ready for review January 17, 2025 17:28
@mrgrain mrgrain requested a review from a team as a code owner January 17, 2025 17:28
@mrgrain mrgrain changed the title refactor(cli): CliIoHost is more self contained refactor(cli): CliIoHost is more self contained Jan 17, 2025
@mrgrain mrgrain force-pushed the mrgrain/chore/cli-io-host-levels branch from 0b7a737 to 868accd Compare January 17, 2025 17:38
@mrgrain mrgrain force-pushed the mrgrain/chore/cli-io-host-levels branch from ef1b4fb to 0e2b414 Compare January 17, 2025 18:31
@@ -214,21 +216,25 @@ export async function exec(args: string[], synthesizer?: Synthesizer): Promise<n
});

case 'docs':
case 'doc':
Copy link
Contributor

Choose a reason for hiding this comment

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

no way we just didn't honor doc until just now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We did not. Maybe I should leave it out 🙈

@kaizencc kaizencc added the pr/do-not-merge This PR should not be merged at this time. label Jan 17, 2025
@mrgrain mrgrain force-pushed the mrgrain/chore/cli-io-host-levels branch from 0e2b414 to 43e1313 Compare January 17, 2025 21:00
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 75.80645% with 15 lines in your changes missing coverage. Please review.

Project coverage is 81.39%. Comparing base (ebe9580) to head (f5d254c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #32993      +/-   ##
==========================================
- Coverage   81.44%   81.39%   -0.06%     
==========================================
  Files         225      225              
  Lines       13702    13714      +12     
  Branches     2404     2411       +7     
==========================================
+ Hits        11160    11162       +2     
- Misses       2267     2277      +10     
  Partials      275      275              
Flag Coverage Δ
suite.unit 81.39% <75.80%> (-0.06%) ⬇️

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

Components Coverage Δ
packages/aws-cdk 80.70% <75.80%> (-0.12%) ⬇️
packages/aws-cdk-lib/core 82.10% <ø> (ø)

@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.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mrgrain mrgrain merged commit 72e089b into main Jan 17, 2025
17 of 21 checks passed
@mrgrain mrgrain deleted the mrgrain/chore/cli-io-host-levels branch January 17, 2025 23:50
Copy link

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 Jan 17, 2025
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants