Skip to content

Commit

Permalink
chore(cx-api): only include v1 feature flags in the `Flags with a dif…
Browse files Browse the repository at this point in the history
…ferent default in v2` section (#32766)

### Issue # (if applicable)

Closes #<issue number here>.

### Reason for this change

The docs listing feature flags in v1 with a different default in v2 currently includes some feature flags that were introduced in v2: https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md#flags-with-a-different-default-in-v2 . 

### Description of changes

Update the filter to check if the feature flag was introduced in v1 to avoid accidentally including v2 feature flags with default 
`true`.

### Describe any new or updated permissions being added

N/A

### Description of how you validated changes

ran `yarn build` to update `FEATURE_FLAGS.md` 

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
gracelu0 authored Jan 9, 2025
1 parent c393481 commit d82f214
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,7 @@ Here is an example of a `cdk.json` file that restores v1 behavior for these flag
"@aws-cdk/aws-rds:lowercaseDbIdentifier": false,
"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": false,
"@aws-cdk/aws-lambda:recognizeVersionProps": false,
"@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": false,
"@aws-cdk/pipelines:reduceAssetRoleTrustScope": false,
"@aws-cdk/aws-stepfunctions-tasks:useNewS3UriParametersForBedrockInvokeModelTask": false,
"@aws-cdk/core:aspectStabilization": false
"@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": false
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/cx-api/build-tools/flag-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function changedFlags() {
}

function migrateJson() {
const changedInV2 = flags(flag => !!flag.defaults?.v2 && !!flag.introducedIn.v2);
const changedInV2 = flags(flag => !!flag.defaults?.v2 && !!flag.introducedIn.v2 && !!flag.introducedIn.v1);

const context = Object.fromEntries(changedInV2.map(([name, _]) => [name, false]));

Expand Down

0 comments on commit d82f214

Please sign in to comment.