Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): remove colon to ensure compatibility with Windows users (under feature flag) #33014

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down Expand Up @@ -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, {
Expand Down
12 changes: 12 additions & 0 deletions packages/aws-cdk-lib/cx-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
```
11 changes: 11 additions & 0 deletions packages/aws-cdk-lib/cx-api/lib/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, FlagInfo> = {
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1371,6 +1372,16 @@ export const FLAGS: Record<string, FlagInfo> = {
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';
Expand Down
Loading