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): consistent durations and error codes #33287

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Feb 4, 2025

Issue #33255

Closes #33255

Reason for this change

Introducing consistent duration messages.

Description of changes

  • A new helper to end a timer with a message
  • Attempted to bring a system into message codes, this deliberately breaks some existing codes (better now than later)
  • changed payload prop time to duration on timings/duration messages.

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

@github-actions github-actions bot added the p1 label Feb 4, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team February 4, 2025 12:37
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 4, 2025
const stacks = assembly.selectStacksV2(options.stacks);
await this.validateStacksMetadata(stacks, ioHost);
const synthTime = timer.end();
await ioHost.notify(info(`\n✨ Synthesis time: ${synthTime.asSec}s\n`, 'CDK_TOOLKIT_I5001', {
Copy link
Contributor Author

@mrgrain mrgrain Feb 4, 2025

Choose a reason for hiding this comment

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

This changes the code to CDK_TOOLKIT_I1000 which is the universal code for synth time.

@mrgrain mrgrain force-pushed the mrgrain/chore/toolkit/emit-more-times branch from 562d794 to 842fbf9 Compare February 4, 2025 12:43
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.80%. Comparing base (5e35788) to head (1bed8ce).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33287   +/-   ##
=======================================
  Coverage   80.80%   80.80%           
=======================================
  Files         236      236           
  Lines       14235    14235           
  Branches     2487     2487           
=======================================
  Hits        11503    11503           
  Misses       2448     2448           
  Partials      284      284           
Flag Coverage Δ
suite.unit 80.80% <ø> (ø)

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

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

@mrgrain mrgrain force-pushed the mrgrain/chore/toolkit/emit-more-times branch from 842fbf9 to c50edfe Compare February 4, 2025 14:21
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)

@aws-cdk-automation aws-cdk-automation dismissed their stale review February 4, 2025 16:52

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

Comment on lines +4 to +7
// Synth
CDK_TOOLKIT_I1000: 'Provides synthesis times',
CDK_TOOLKIT_I1901: 'Provides stack data',
CDK_TOOLKIT_I1902: 'Successfully deployed stacks',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to codify these rules, i.e. that Synth messages must start with 1XXX, better than the honor system we're employing right 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.

I don't really know how to unfortunately.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair. I thought about it some and I couldn't think of anything reasonable without supplying additional information into the record set similar to how lambda runtimes work. i.e. static readonly CDK_TOOLKIT_I1000 = new Code('synth', 'Provides synthesis times')

But i think its not worth investigating further so i'm approving.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

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

mergify bot commented Feb 4, 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 20d8427 into main Feb 4, 2025
30 checks passed
@mergify mergify bot deleted the mrgrain/chore/toolkit/emit-more-times branch February 4, 2025 18:13
Copy link

github-actions bot commented Feb 4, 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 4, 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 4, 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. p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emit more timing data
3 participants