From 5eb345b6d9a823e185ac01cf7b480c85781b20d6 Mon Sep 17 00:00:00 2001 From: Mahdi Azarboon <21277296+azarboon@users.noreply.github.com> Date: Sun, 19 Jan 2025 21:55:47 +0800 Subject: [PATCH 1/3] Update features.ts Added flag --- packages/aws-cdk-lib/cx-api/lib/features.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/aws-cdk-lib/cx-api/lib/features.ts b/packages/aws-cdk-lib/cx-api/lib/features.ts index 5991642b93bed..b6bc7ce7527ca 100644 --- a/packages/aws-cdk-lib/cx-api/lib/features.ts +++ b/packages/aws-cdk-lib/cx-api/lib/features.ts @@ -122,6 +122,7 @@ export const Enable_IMDS_Blocking_Deprecated_Feature = '@aws-cdk/aws-ecs:enableI export const Disable_ECS_IMDS_Blocking = '@aws-cdk/aws-ecs:disableEcsImdsBlocking'; export const ALB_DUALSTACK_WITHOUT_PUBLIC_IPV4_SECURITY_GROUP_RULES_DEFAULT = '@aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault'; export const IAM_OIDC_REJECT_UNAUTHORIZED_CONNECTIONS = '@aws-cdk/aws-iam:oidcRejectUnauthorizedConnections'; +export const CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID = '@aws-cdk/aws-codepipeline:removeTheColonFromStackID'; export const FLAGS: Record = { ////////////////////////////////////////////////////////////////////// @@ -1371,6 +1372,16 @@ export const FLAGS: Record = { recommendedValue: true, compatibilityWithOldBehaviorMd: 'Disable the feature flag to allow unsecure OIDC connection.', }, + ////////////////////////////////////////////////////////////////////// + [CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID]: { + type: FlagType.BugFix, + summary: 'When enabled, it removes the colon from the stack ID, making the repository compatible with the Windows file system.', + detailsMd: `The current stack ID uses a colon, which is not supported by the Windows file system and makes the repository incompatible for Windows users. Enable this feature flag to remove the colon, allowing Windows users to clone and contribute to the repository. Disabling the flag poses challenges for Windows-based contributors.`, + introducedIn: { v2: 'V2NEXT' }, + compatibilityWithOldBehaviorMd: '', + defaults: { v2: true }, + recommendedValue: true + }, }; const CURRENT_MV = 'v2'; From d95b45a2a221fd7214db24ad204e09aa36f650c7 Mon Sep 17 00:00:00 2001 From: Mahdi Azarboon <21277296+azarboon@users.noreply.github.com> Date: Sun, 19 Jan 2025 22:09:46 +0800 Subject: [PATCH 2/3] Added the flag to README --- packages/aws-cdk-lib/cx-api/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/aws-cdk-lib/cx-api/README.md b/packages/aws-cdk-lib/cx-api/README.md index 7c9457aec56f2..a548f979f86b8 100644 --- a/packages/aws-cdk-lib/cx-api/README.md +++ b/packages/aws-cdk-lib/cx-api/README.md @@ -594,3 +594,15 @@ _cdk.json_ } } ``` + +* `@aws-cdk/aws-codepipeline:removeTheColonFromStackID` +Some stack IDs include colons in their naming, which are not supported by the Windows file system, rendering the repository incompatible with Windows users. Enabling this feature flag removes the colons, allowing Windows users to clone and contribute to the repository. Disabling the flag may create challenges for Windows-based contributors. +_cdk.json_ + +```json +{ + "context": { + "@aws-cdk/aws-codepipeline:removeTheColonFromStackID": true + } +} +``` From fc82b241a9d63629a74ba7b48b20776466a64695 Mon Sep 17 00:00:00 2001 From: Mahdi Azarboon <21277296+azarboon@users.noreply.github.com> Date: Sun, 19 Jan 2025 22:21:11 +0800 Subject: [PATCH 3/3] Added the feature flag to code --- packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts b/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts index 3a94a026a7f41..41de4bb3ca926 100644 --- a/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts +++ b/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts @@ -38,6 +38,9 @@ import { } from '../../core'; import * as cxapi from '../../cx-api'; +const CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID = { [cxapi.CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID]: true }; + + /** * Allows you to control where to place a new Stage when it's added to the Pipeline. * Note that you can provide only one of the below properties - @@ -823,7 +826,13 @@ export class Pipeline extends PipelineBase { } const app = this.supportScope(); - const supportStackId = `cross-region-stack-${this.reuseCrossRegionSupportStacks ? pipelineAccount : pipelineStack.stackName}:${actionRegion}`; + + + const supportStackId = CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID[cxapi.CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID] + ? `cross-region-stack-${this.reuseCrossRegionSupportStacks ? pipelineAccount : pipelineStack.stackName}-${actionRegion}` + : `cross-region-stack-${this.reuseCrossRegionSupportStacks ? pipelineAccount : pipelineStack.stackName}:${actionRegion}`; + + let supportStack = app.node.tryFindChild(supportStackId) as CrossRegionSupportStack; if (!supportStack) { supportStack = new CrossRegionSupportStack(app, supportStackId, {