Skip to content

pipelines: specify dependencies between pre/post steps #17945

@jeromevdl

Description

@jeromevdl

What is the problem?

When adding multiple pre (or post) steps to a stage, I cannot specify the order. If I'm adding them in the order I'd like (using addPre or addPost), the generated pipeline actions are not in the correct order but alphabetically ordered.

Reproduction Steps

Have a stage and add multiple pre steps:

prodStage.addPre(
      new pipelines.ManualApprovalStep('Validation'),
      new pipelines.CodeBuildStep('Bootstrap', {...})
);

The Validation Step is after the Boostrap one in my template, while it should be before as I've added it before.

If I change "Validation" to "Approval":

prodStage.addPre(
      new pipelines.ManualApprovalStep('Approval'),
      new pipelines.CodeBuildStep('Bootstrap', {...})
);

Approval is now before Bootstrap.

What did you expect to happen?

I expect to have the steps in the order I add them:

prodStage.addPre(
      new pipelines.ManualApprovalStep('Validation'),
      new pipelines.CodeBuildStep('Bootstrap', {...})
);

Should give Validation first and then Bootstrap

What actually happened?

Validation was after Bootstrap.

CDK CLI Version

2.0.0 (build 4b6ce31)

Framework Version

No response

Node.js Version

v17.0.1

OS

macOS BigSur 11.6.1 (M1)

Language

Typescript

Language Version

Typescript (4.5.2)

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/pipelinesCDK Pipelines libraryeffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions