aws / aws/aws-cdk

core: `Validations` class cannot suppress warnings issued by `Annotations` class

Open
#37,764 2 comments 0 reactions 2 assignees Claimed by @iankhou View on GitHub
bug effort/small p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

### Describe the bug

```ts
// stores the ID without qualifier
Annotations.of(bucket).addWarningV2('@aws-cdk/aws-s3:bucketNotEncrypted', ...)

// qualifies with 'annotation::' before calling acknowledgeWarning
Validations.of(bucket).acknowledge({ id: '@aws-cdk/aws-s3:bucketNotEncrypted' })
```

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Last Known Working CDK Library Version

_No response_

### Expected Behavior

`Validations` class can acknowledge warnings written via `Validations.addWarning()`, but not `Annotations.addWarningV2()`. It would be better UX if it could cover both

### Current Behavior

`Validations` class cannot acknoweldge warnings written via `Annotaitons` class

### Reproduction Steps

n/a

### Possible Solution

`Validations` can:

- also `acknowledge` the ID without a qualifier
- provide a way of indicating that the acknowledgement comes from `Annotations`

### Additional Information/Context

_No response_

### AWS CDK Library version (aws-cdk-lib)

latest

### AWS CDK CLI version

latest

### Node.js Version

n/a

### OS

n/a

### Language

TypeScript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.