feat(cli): support for matching notices with arbitrary module names#19088
feat(cli): support for matching notices with arbitrary module names#19088mergify[bot] merged 32 commits intomasterfrom
Conversation
Type of main updated; Refresh doesn't force a cache update
# Conflicts: # packages/aws-cdk/README.md # packages/aws-cdk/lib/notices.ts # packages/aws-cdk/test/notices.test.ts
rix0rrr
left a comment
There was a problem hiding this comment.
Approved modulo small changes
packages/aws-cdk/lib/notices.ts
Outdated
| return false; | ||
| } | ||
|
|
||
| const components = flatMap(notice.components, component => { |
There was a problem hiding this comment.
This could do with a comment
packages/aws-cdk/lib/notices.ts
Outdated
| * A node in the construct tree. | ||
| * @internal | ||
| */ | ||
| interface Node { |
There was a problem hiding this comment.
Node is very minimal, given that we could have a lot of trees going on. ConstructTreeInfoNode or something?
packages/aws-cdk/lib/notices.ts
Outdated
| function match(query: Component[], tree: Node): boolean { | ||
| return some(tree, node => { | ||
| return query.some(component => | ||
| node.constructInfo?.fqn.startsWith(component.name) && |
There was a problem hiding this comment.
Yes, but we should also check that the component.name is followed by either . or the end of the string.
We don't want:
{ name: '@aws-cdk/aws-events' }
To match
@aws-cdk/aws-events-targets
|
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 CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
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). |
This change allows us to publish notices to match any arbitrary module or
construct. For example, a notice that targets the component
{ "name": "@aws-cdk/aws-apigatewayv2-alpha", "version": ">=2.10.0" }will be displayed to the user if they have in their cloud assembly a resource of
type
@aws-cdk/aws-apigatewayv2-alpha.HttpStageor@aws-cdk/aws-apigatewayv2-alpha.HttpApior any other construct from theapigatewayv2module, as long as it was built using some version of themodule above or equal to 2.10.0.
We can also target a specific construct, instead:
{ "name": "@aws-cdk/aws-apigatewayv2-alpha.HttpStage", "version": ">=2.10.0" }By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license