-
Notifications
You must be signed in to change notification settings - Fork 4k
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(core): resolve tokens before publishing tree.json #4984
Conversation
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
}); | ||
} catch (e) { | ||
// Prevent errors here to fail synthesis, until this module stays @experimental. | ||
this.node.addWarning(`tree.json could not be generated - ${e}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means that if any visit
fails, the entire tree will not be synthed, which seems harsh. Wouldn't it make more sense to only surround the user code (call to visit
) with this all-encompassing catch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather provide no tree.json (which the consumer, an IDE for instance, can interpret as an error) rather than one that has missing information (and no indication that it is missing information).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because of the extensible nature of this, I don't think it makes sense to fail the entire thing. Say you imported some 3rd party construct library that throw an exception in inspect
. Suddenly, you can't see anything.
Maybe we can synthesize an "error" node or something if a node fails "visit", but I'd argue that failing the entire tree is not the right granularity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. We could even collect and throw all the errors into the cloud manifest under the 'tree' metadata, which the consumer can collect and display.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think .addWarning
should do the trick
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…nto 4295-windows-ecs-support * '4295-windows-ecs-support' of github.com:arhea/aws-cdk: chore(deps-dev): bump @types/lodash from 4.14.146 to 4.14.147 (aws#5021) Revert "fix(assets): support exceptions to exclude patterns (aws#4473)" (aws#5022) chore(deps): bump jsii-pacmak from 0.20.3 to 0.20.5 (aws#5003) chore(deps): bump codemaker from 0.20.3 to 0.20.5 (aws#5007) chore(deps-dev): bump @types/jest from 24.0.22 to 24.0.23 (aws#4993) chore(deps): bump jsii from 0.20.3 to 0.20.5 (aws#5006) chore(deps-dev): bump jsii-diff from 0.20.3 to 0.20.5 (aws#5005) chore(deps): bump jsii-spec from 0.20.3 to 0.20.5 (aws#5008) chore(core): resolve tokens before publishing tree.json (aws#4984) feat(cli): adding new option to `cdk deploy` to indicate whether ChangeSet should be executed (aws#4852) chore: move semantic.yaml to .github/ fix(core): unable to find stack by name using the cli in legacy mode (aws#4998) fix(ecs-patterns): Fix issue related to protocol being passed to target group (aws#4988)
Resolve tokens before publishing tree.json
Add a try-catch block around the construct tree metadata generation to
prevent failure of synthesis. Construct tree metadata is not a critical
step.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license