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(core): new annotations api #9563

Merged
merged 7 commits into from
Aug 10, 2020
Merged

feat(core): new annotations api #9563

merged 7 commits into from
Aug 10, 2020

Conversation

eladb
Copy link
Contributor

@eladb eladb commented Aug 10, 2020

In CDK 2.0 the node.addWarning(), node.addError() and node.addInfo() APIs will be removed in favor of a "trait" pattern:

Annotations.of(construct).addWarning(message)

The existing APIs are still supported but marked as @deprecated.

Related: aws/aws-cdk-rfcs#192, See Design.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

In [CDK 2.0] the `node.addWarning()`, `node.addError()` and `node.addInfo()` APIs will be removed in favor of a "trait" pattern:

    Logging.of(construct).addWarning(message)

The existing APIs are still supported but marked as @deprecated.

Related: aws/aws-cdk-rfcs#192
Design: https://github.com/aws/aws-cdk-rfcs/blob/master/text/0192-remove-constructs-compat.md#09-logging
@eladb eladb requested a review from a team August 10, 2020 12:05
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 10, 2020
@eladb eladb requested a review from nija-at August 10, 2020 12:05
@eladb eladb added the pr-linter/exempt-readme The PR linter will not require README changes label Aug 10, 2020
@eladb eladb requested a review from rix0rrr August 10, 2020 12:46
@mergify
Copy link
Contributor

mergify bot commented Aug 10, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@rix0rrr rix0rrr added the pr/do-not-merge This PR should not be merged at this time. label Aug 10, 2020
Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

I wonder if Logging is not going to give people the wrong impression. It's not so much a sequence of "this happens/that happens" (which is what most people will expect if you use the word "logging"), it's more of an annotation to a construct instead.

How about Annotations instead?

That terminology also cleanly explains why you cannot "log" without a construct to attach the message to, which otherwise will trip people up.

Just a suggestion that I request you spend a couple of minutes evaluating. Otherwise, a fine change.

I suppose the replacements across the AWSCL are forthcoming?

@eladb
Copy link
Contributor Author

eladb commented Aug 10, 2020

I wonder if Logging is not going to give people the wrong impression. It's not so much a sequence of "this happens/that happens" (which is what most people will expect if you use the word "logging"), it's more of an annotation to a construct instead.

How about Annotations instead?

That terminology also cleanly explains why you cannot "log" without a construct to attach the message to, which otherwise will trip people up.

Just a suggestion that I request you spend a couple of minutes evaluating. Otherwise, a fine change.

I suppose the replacements across the AWSCL are forthcoming?

I like Annotations. It will also be a nice place to add additional types of annotations in the future.

@eladb eladb changed the title feat(core): new logging API feat(core): new annotations api Aug 10, 2020
@eladb eladb requested review from rix0rrr and njlynch August 10, 2020 13:22
Copy link
Contributor

@njlynch njlynch left a comment

Choose a reason for hiding this comment

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

I do like Annotations much better; good suggestion @rix0rrr !

eladb pushed a commit to aws/aws-cdk-rfcs that referenced this pull request Aug 10, 2020
@eladb eladb removed the pr/do-not-merge This PR should not be merged at this time. label Aug 10, 2020
@mergify
Copy link
Contributor

mergify bot commented Aug 10, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 6aca993
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify
Copy link
Contributor

mergify bot commented Aug 10, 2020

Thank you for contributing! Your pull request will be updated from master 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 ae9ed62 into master Aug 10, 2020
@mergify mergify bot deleted the benisrae/new-logging-api branch August 10, 2020 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. pr-linter/exempt-readme The PR linter will not require README changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants