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

chore(toolkit): capture all output from an app #33259

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Jan 31, 2025

Issue #32997

Relates to #32997

Reason for this change

When a CDK app is invoked by a sub-shell, we need to capture all output by lines and send it to the IoHost.

Description of changes

Adds an EventPublisher interface to the execInChildProcess helper. This is getting passed in a publisher that uses the IoHost.
Inspired from the ShellEventPublisher in cdk-assets.

Describe any new or updated permissions being added

n/a

Description of how you validated changes

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 January 31, 2025 18:53
@aws-cdk-automation aws-cdk-automation requested a review from a team January 31, 2025 18:54
@github-actions github-actions bot added the p2 label Jan 31, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jan 31, 2025
Comment on lines -4 to -16
// Default codes -- all 0000 codes
CDK_TOOLKIT_I0000: 'Default toolkit info code',
CDK_TOOLKIT_E0000: 'Default toolkit error code',
CDK_TOOLKIT_W0000: 'Default toolkit warning code',
CDK_SDK_I0000: 'Default sdk info code',
CDK_SDK_E0000: 'Default sdk error code',
CDK_SDK_WOOOO: 'Default sdk warning code',
CDK_ASSETS_I0000: 'Default assets info code',
CDK_ASSETS_E0000: 'Default assets error code',
CDK_ASSETS_W0000: 'Default assets warning code',
CDK_ASSEMBLY_I0000: 'Default assembly info code',
CDK_ASSEMBLY_E0000: 'Default assembly error code',
CDK_ASSEMBLY_W0000: 'Default assembly warning code',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to allow explicitly using this code for now. When generating the docs page we can probably inject the description differently.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought this would break the place where we generate 0000 codes

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 does not apparently!

return {
ioHost: this.ioHost,
ioHost: withAction(this.ioHost, 'assembly'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Messages previously came through without an action.

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.

(This review is outdated)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No app should do that, but you never know...

@mrgrain mrgrain added the pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested label Jan 31, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 31, 2025 18:59

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.84%. Comparing base (c346e82) to head (13eaeac).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33259   +/-   ##
=======================================
  Coverage   80.84%   80.84%           
=======================================
  Files         232      232           
  Lines       14135    14135           
  Branches     2460     2460           
=======================================
  Hits        11428    11428           
  Misses       2427     2427           
  Partials      280      280           
Flag Coverage Δ
suite.unit 80.84% <ø> (ø)

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

Components Coverage Δ
packages/aws-cdk 79.64% <ø> (ø)
packages/aws-cdk-lib/core 82.17% <ø> (ø)

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 31, 2025
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Feb 3, 2025
Copy link
Contributor

mergify bot commented Feb 3, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Copy link
Contributor

mergify bot commented Feb 3, 2025

This pull request has been removed from the queue for the following reason: checks failed.

The merge conditions cannot be satisfied due to failing checks:

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Copy link
Contributor

mergify bot commented Feb 3, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mrgrain
Copy link
Contributor Author

mrgrain commented Feb 3, 2025

@Mergifyio requeue

Copy link
Contributor

mergify bot commented Feb 3, 2025

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

@mrgrain
Copy link
Contributor Author

mrgrain commented Feb 3, 2025

force-merging since codecov build is broken
@kaizencc is investigating.

@mrgrain mrgrain merged commit c83d4ca into main Feb 3, 2025
12 of 15 checks passed
@mrgrain mrgrain deleted the mrgrain/toolkit/capture-app-output branch February 3, 2025 17:03
Copy link

github-actions bot commented Feb 3, 2025

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 3, 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-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