-
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
CodePipeline add multiple source CodeCommit on the same stage #7802
Comments
Hey @cesarpball , you're right, this is a bug in the To unblock yourself while I fix this, you can disable CloudWatch Events (which are the root cause of this issue) in all Actions observing that repository beyond the first: master_action = codepipeline_actions.CodeCommitSourceAction(
# same as yours...
)
devaction = codepipeline_actions.CodeCommitSourceAction(
# as above...
trigger=codepipeline_actions.CodeCommitTrigger.POLL,
)
qaaction = codepipeline_actions.CodeCommitSourceAction(
# as above...
trigger=codepipeline_actions.CodeCommitTrigger.POLL,
) Thanks, |
There are use-cases when you want to add the same CodeCommit repository to a CodePipeline multiple times, with different branches. This wouldn't work when using CloudWatch Events to trigger the pipeline, as the ID of the generated Event only used the pipeline ID for uniqueness. Change it to also use the branch name when generating the Event ID (which cannot be empty, as it turns out, so validate that as well). Fixes aws#7802
There are use-cases when you want to add the same CodeCommit repository to a CodePipeline multiple times, with different branches. This wouldn't work when using CloudWatch Events to trigger the pipeline, as the ID of the generated Event only used the pipeline ID for uniqueness. Change it to also use the branch name when generating the Event ID (which cannot be empty, as it turns out, so validate that as well). Fixes aws#7802
There are use-cases when you want to add the same CodeCommit repository to a CodePipeline multiple times, with different branches. This wouldn't work when using CloudWatch Events to trigger the pipeline, as the ID of the generated Event only used the pipeline ID for uniqueness. Change it to also use the branch name when generating the Event ID (which cannot be empty, as it turns out, so validate that as well). Fixes aws#7802
…nts (#8018) There are use-cases when you want to add the same CodeCommit repository to a CodePipeline multiple times, with different branches. This wouldn't work when using CloudWatch Events to trigger the pipeline, as the ID of the generated Event only used the pipeline ID for uniqueness. Change it to also use the branch name when generating the Event ID (which cannot be empty, as it turns out, so validate that as well). Fixes #7802 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm also getting this issue, but not with Cloudwatch. It informs I cannot have a single output with a build step. I have an array of services in a typescript loop; is there a workaround? Thanks |
Hello @ZakHargz ,
Can you show the relevant code fragment, and the exact error CDK returns? Thanks, |
I'm also experiencing the same issue, however the issue is observed in TypeScript and not Python. Below is the Python snippet which is synthesized without any issues: main_action = codepipeline_actions.CodeCommitSourceAction(
action_name = 'CodeCommit',
repository = repoMain,
output = main_output,
branch = 'main',
trigger = codepipeline_actions.CodeCommitTrigger.EVENTS
)
dev_action = codepipeline_actions.CodeCommitSourceAction(
action_name = 'CodeCommitDev',
repository = repoDev,
output = dev_output,
branch = 'main',
trigger = codepipeline_actions.CodeCommitTrigger.EVENTS
)
pipeline.add_stage(
stage_name = 'Source',
actions = [main_action, dev_action]
) Below is the TypeScript snippet which experiences the following issue:
const main_action = new codepipeline_actions.CodeCommitSourceAction({
actionName: 'CodeCommit',
repository: repoMain,
output: main_output,
branch: 'main',
trigger: codepipeline_actions.CodeCommitTrigger.EVENTS
})
const dev_action = new codepipeline_actions.CodeCommitSourceAction({
actionName: 'CodeCommitDev',
repository: repoDev,
output: dev_output,
branch: 'main',
trigger: codepipeline_actions.CodeCommitTrigger.EVENTS
})
pipeline.addStage({
stageName: 'Source',
actions: [main_action, dev_action]
}) While employing POLL is effective in TypeScript, I'd prefer to utilize EVENTS. Can you kindly advice whether the PR that fixed the problem in Python has also been applied to TypeScript, or is it a future development? |
@sirmattx yes, it should have fixed it for both (the Python code is generated from the TypeScript code). Can you check what version of the CDK libraries you are using in your TypeScript program? |
I just updated my CDK version from v2.87.0 to v2.102.0 and I do see the issue is not there anymore, thanks @skinny85 |
The Question
I want to add multiple source stages from CodeCommit to trigger the same pipeline depending on the branch (master,dev,qa)
Then I get the issue:
I can add multiple actions in the CodeBuild part, but I am getting an error here. I can add manually trough the AWS console and it's fine.
Environment
The text was updated successfully, but these errors were encountered: