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

Roll-out ValidationError to all modules #32569

Open
Tracked by #32324
mrgrain opened this issue Dec 18, 2024 · 0 comments
Open
Tracked by #32324

Roll-out ValidationError to all modules #32569

mrgrain opened this issue Dec 18, 2024 · 0 comments
Assignees

Comments

@mrgrain
Copy link
Contributor

mrgrain commented Dec 18, 2024

We have introduced a new error type ValidationError into aws-cdk-lib, seeerrors.ts.

This error type now needs to be rolled-out everywhere in aws-cdk-lib.
This will be a huge effort and significant grunt work. See tips below for how to make this easier.

Here is the plan:

  • As a team, split up the work between aws-cdk-lib and all alpha modules.
  • Raise small PRs, containing changes for roughly 3-5 modules
  • Do NOT make any other changes. If something isn't a straightforward update, park it for now.
  • If something isn't a ValidationError, check with @sumupitchayan to raise a separate PR to introduce a new error type and use that in a few places to illustrate its value. See Additional ConstructError types as needed (errors that are not ValidationErrors) #32570.
  • If you are completing an alpha module (not aws-cdk-lib) make sure to add the no-throw-default-error eslint rule to its local config so we can enforce future compliance.

Once everything is done, we should enabke the no-throw-default-error eslint rule for aws-cdk-lib as well.
We might have to ignore it in a few places that are still unclear.

Tips:

  • Enforce using typed errors by locally! configuring the no-throw-default-error rule from cdklabs/eslint-rules for the aws-cdk-lib and or respective package. Don't commit this just yet.
  • Once you have done that, eslint and VSCode should flag up all rule violations and changing errors will be semi-automatic and super easy.
  • Consider using Amazon Q as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants