-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(pipelines): temporarily disable self-mutation #10466
feat(pipelines): temporarily disable self-mutation #10466
Conversation
I see the use for disabling updatePipeline, but what's your use case for disabling dependent stacks? We need that autoselect feature to deploy support stacks. |
Yeah, that use-case for not updating dependent stacks might not be that strong, I've experienced an issue when I was working on the dependent stack (with no change to the pipeline stack itself), deploying from my laptop, but the pipeline always reverted the stack to the "git" version... I thought that being able to provide Anyways, I still think the ability to disable self-mutation while developing would be really useful. If you agree with that but not happy with this approach, I am happy to implement it differently, for example by exposing a boolean flag, like |
Let's do: /**
* Whether the pipeline will update itself
*
* This needs to be set to `true` to allow the pipeline to reconfigure
* itself when assets or stages are being added to it, and `true` is the
* recommended setting.
*
* You can temporarily set this to `false` while you are iterating
* on the pipeline itself and prefer to deploy changes using `cdk deploy`.
*
* @default true
*/
readonly selfMutating?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provided feedback in a comment, need to hit "Request changes" to remove this from my TODO list :).
e16ef03
to
262e013
Compare
@rix0rrr thanks for the feedback! I've update the PR in accordance with your suggestions, could you please have a look? I've updated the PR title and description too, for context, I am copying the old description below: Currently, the
This PR exposes the Example: const cdkPipeline = new CdkPipeline(this, 'CdkPipeline', {
pipelineName: 'MyPipeline',
cloudAssemblyArtifact,
sourceAction: new codepipeline_actions.GitHubSourceAction(...),
synthAction: SimpleSynthAction.standardNpmSynth(...),
updatePipelineAction: new UpdatePipelineAction(nestedPipelineStack, 'UpdatePipeline', {
cloudAssemblyInput: cloudAssemblyArtifact,
pipelineStackName: pipelineStack.stackName,
buildCommands: [`cdk -a . deploy ${pipelineStack.stackName} --require-approval=never --verbose --exclusively`],
}),
}); |
262e013
to
549ad73
Compare
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@tomas-mazak @rix0rrr Is it expected behavior that When the SelfMutate stage is gone, the stage is not added when Not sure if that is as intended? |
Not sure how it could work otherwise :) To re-enable, it, after setting it back to |
The self-mutation feature of the
CdkPipeline
might at times get in the way of the pipeline development workflow. Each change to the pipeline must be pushed to git, otherwise, after the pipeline was updated usingcdk deploy
, it will automatically revert to the state found in git.To make the development more convenient, the self-mutation feature can be turned off temporarily, by passing
selfMutating: false
property, example:By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license