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

feat(cli): throw typed errors #33005

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Jan 18, 2025

Reason for this change

In #32548 we enabled typed errors for some places in the CLI.
However many places were missed and the eslint rule wasn't enabled to enforce it in future.

Description of changes

Enforce by enabling the respective eslint rule.
Also adds and implements the eslint rule in the toolkit.

This has little functional effect since all new errors are still Errors. The printed output of an error will slightly change.

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

Enforce by enabling the respective eslint rule.
Also adds this rule to the toolkit.
@mrgrain mrgrain force-pushed the mrgrain/feat/cli-toolkit-typed-errors branch from 6f6aba5 to 9be5a2e Compare January 18, 2025 00:49
@mrgrain mrgrain changed the title feat(cli): throw typed errors chore(cli): throw typed errors Jan 18, 2025
@mrgrain mrgrain changed the title chore(cli): throw typed errors feat(cli): throw typed errors Jan 18, 2025
@mrgrain mrgrain added pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-test The PR linter will not require test changes pr-linter/exempt-integ-test The PR linter will not require integ test changes labels Jan 18, 2025
Copy link

codecov bot commented Jan 18, 2025

Codecov Report

Attention: Patch coverage is 54.72973% with 67 lines in your changes missing coverage. Please review.

Project coverage is 81.44%. Comparing base (72e089b) to head (9be5a2e).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #33005      +/-   ##
==========================================
+ Coverage   81.39%   81.44%   +0.04%     
==========================================
  Files         225      225              
  Lines       13714    13750      +36     
  Branches     2411     2412       +1     
==========================================
+ Hits        11162    11198      +36     
  Misses       2277     2277              
  Partials      275      275              
Flag Coverage Δ
suite.unit 81.44% <54.72%> (+0.04%) ⬆️

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

Components Coverage Δ
packages/aws-cdk 80.80% <54.72%> (+0.09%) ⬆️
packages/aws-cdk-lib/core 82.10% <ø> (ø)

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mrgrain mrgrain marked this pull request as ready for review January 18, 2025 15:57
@mrgrain mrgrain requested a review from a team as a code owner January 18, 2025 15:57
@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
Copy link
Contributor Author

mrgrain commented Jan 20, 2025

CLI integ tests passed. Pipeline execution: 657f3b62
Bypassing Codecov patch rule for this mainly PR.

@mrgrain mrgrain merged commit bf81b3c into main Jan 20, 2025
40 of 42 checks passed
@mrgrain mrgrain deleted the mrgrain/feat/cli-toolkit-typed-errors branch January 20, 2025 10:08
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 20, 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/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-test The PR linter will not require test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants