From d82f2143048cf3e8629319649c7b06c80e4717f7 Mon Sep 17 00:00:00 2001 From: Grace Luo <54298030+gracelu0@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:03:09 -0800 Subject: [PATCH] chore(cx-api): only include v1 feature flags in the `Flags with a different default in v2` section (#32766) ### Issue # (if applicable) Closes #. ### 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* --- packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md | 5 +---- packages/aws-cdk-lib/cx-api/build-tools/flag-report.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index af60cf74ac326..de5aece1f4e59 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -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 } } ``` diff --git a/packages/aws-cdk-lib/cx-api/build-tools/flag-report.ts b/packages/aws-cdk-lib/cx-api/build-tools/flag-report.ts index c777b6fc9701f..4987193d082a2 100644 --- a/packages/aws-cdk-lib/cx-api/build-tools/flag-report.ts +++ b/packages/aws-cdk-lib/cx-api/build-tools/flag-report.ts @@ -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]));