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

fix(cli): sdk logging is always present even when not turned on #33324

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Feb 6, 2025

Issue #33320

Closes #33320

Reason for this change

In #33273 we introduced a bug that causes SDK logs to always be printed.

Description of changes

Set the correct log level for SDK logs.

Describe any new or updated permissions being added

n/a

Description of how you validated changes

Manual test and updated unit test

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 6, 2025 19:03
@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p1 labels Feb 6, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team February 6, 2025 19:03
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 6, 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.

(This review is outdated)

@mrgrain mrgrain force-pushed the mrgrain/fix/cli/sdk-logging-always-present branch from 61f1ffc to daeea3a Compare February 6, 2025 19:07
@mrgrain mrgrain added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Feb 6, 2025
@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.

@@ -87,7 +87,7 @@ export class SdkToCliLogger implements Logger {
* ```
*/
public error(...content: any[]) {
this.notify('info', ...content);
this.notify('error', ...content);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was also wrong!

expect(ioHost.notify).toHaveBeenCalled();
logger[method]('SDK Logger test message');
expect(ioHost.notify).toHaveBeenCalledWith(expect.objectContaining({
level: 'trace',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

explicitly expect the the level to be trace

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.83%. Comparing base (80217f1) to head (daeea3a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33324   +/-   ##
=======================================
  Coverage   80.83%   80.83%           
=======================================
  Files         236      236           
  Lines       14253    14253           
  Branches     2490     2490           
=======================================
  Hits        11522    11522           
  Misses       2446     2446           
  Partials      285      285           
Flag Coverage Δ
suite.unit 80.83% <100.00%> (ø)

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

Components Coverage Δ
packages/aws-cdk 79.57% <100.00%> (ø)
packages/aws-cdk-lib/core 82.20% <ø> (ø)

@mrgrain mrgrain added the pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested label Feb 6, 2025
@mrgrain
Copy link
Contributor Author

mrgrain commented Feb 6, 2025

Skipping cli-integ-tested to speed up the release of this fix.

@aws-cdk-automation aws-cdk-automation dismissed their stale review February 6, 2025 19:24

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: daeea3a
  • 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 6, 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 mrgrain added the priority-pr push the PR to priority squash queue label Feb 6, 2025
Copy link
Contributor

mergify bot commented Feb 6, 2025

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

Pull request #33324 has been dequeued, merge conditions unmatch:

  • -label~=(blocked|do-not-merge|no-squash|priority-pr)
  • status-success=validate-pr
  • any of [🛡 GitHub branch protection]:
    • check-neutral = validate-pr
    • check-skipped = validate-pr
    • check-success = validate-pr
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #approved-reviews-by>=1
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by=0
  • -approved-reviews-by~=author
  • -closed
  • -merged
  • -title~=(WIP|wip)
  • base!=release
  • status-success~=AWS CodeBuild us-east-1
  • any of [🛡 GitHub branch protection]:
    • check-success = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
    • check-neutral = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
    • check-skipped = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
  • any of [🛡 GitHub branch protection]:
    • check-success = collect
    • check-neutral = collect
    • check-skipped = collect

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

@mrgrain
Copy link
Contributor Author

mrgrain commented Feb 6, 2025

@mergify refresh

Copy link
Contributor

mergify bot commented Feb 6, 2025

refresh

✅ Pull request refreshed

Copy link
Contributor

mergify bot commented Feb 6, 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 6, 2025

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

Pull request #33324 has been dequeued, merge conditions unmatch:

  • -label~=(blocked|do-not-merge|no-squash|priority-pr)
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #approved-reviews-by>=1
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by=0
  • -approved-reviews-by~=author
  • -closed
  • -merged
  • -title~=(WIP|wip)
  • base!=release
  • status-success=validate-pr
  • status-success~=AWS CodeBuild us-east-1
  • any of [🛡 GitHub branch protection]:
    • check-success = validate-pr
    • check-neutral = validate-pr
    • check-skipped = validate-pr
  • any of [🛡 GitHub branch protection]:
    • check-success = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
    • check-neutral = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
    • check-skipped = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
  • any of [🛡 GitHub branch protection]:
    • check-success = collect
    • check-neutral = collect
    • check-skipped = collect

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

@mrgrain
Copy link
Contributor Author

mrgrain commented Feb 6, 2025

@Mergifyio queue priority-squash

Copy link
Contributor

mergify bot commented Feb 6, 2025

queue priority-squash

🛑 The pull request has been removed from the queue priority-squash

Pull request #33324 has been dequeued, merge conditions unmatch:

  • -label~=(blocked|do-not-merge|no-squash|priority-pr)
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #approved-reviews-by>=1
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by=0
  • -approved-reviews-by~=author
  • -closed
  • -merged
  • -title~=(WIP|wip)
  • base!=release
  • status-success=validate-pr
  • status-success~=AWS CodeBuild us-east-1
  • any of [🛡 GitHub branch protection]:
    • check-success = validate-pr
    • check-neutral = validate-pr
    • check-skipped = validate-pr
  • any of [🛡 GitHub branch protection]:
    • check-success = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
    • check-neutral = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
    • check-skipped = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
  • any of [🛡 GitHub branch protection]:
    • check-success = collect
    • check-neutral = collect
    • check-skipped = collect.

You can take a look at Queue: Embarked in merge queue check runs for more details.

In case of a failure due to a flaky test, you should first retrigger the CI.
Then, re-embark the pull request into the merge queue by posting the comment
@mergifyio refresh on the pull request.

@mrgrain mrgrain removed the priority-pr push the PR to priority squash queue label Feb 6, 2025
@mrgrain
Copy link
Contributor Author

mrgrain commented Feb 6, 2025

@Mergifyio requeue

Copy link
Contributor

mergify bot commented Feb 6, 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 6, 2025

@Mergifyio refresh

Copy link
Contributor

mergify bot commented Feb 6, 2025

refresh

✅ Pull request refreshed

Copy link
Contributor

mergify bot commented Feb 6, 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).

@mergify mergify bot merged commit 29a9a6d into main Feb 6, 2025
46 checks passed
@mergify mergify bot deleted the mrgrain/fix/cli/sdk-logging-always-present branch February 6, 2025 19:52
Copy link

github-actions bot commented Feb 6, 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 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/medium Medium work item – several days of effort p1 pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

‼️ Notice: (cli) sdk logging present even though verbose logging is not turned on
3 participants