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

feat(pipelines): room for extra sequential intermediary actions in CdkStage addApplication() #11376

Merged
merged 3 commits into from
Nov 10, 2020

Conversation

adriantaut
Copy link
Contributor

@adriantaut adriantaut commented Nov 9, 2020

Currently there is no way of reordering stages/actions once they are created. Getting to the Prepare and Execute change set actions while adding an application stage, we identified a use case within our company that needs one or more intermediary sequential actions before actually executing the change set. Moreover, I can imagine there can be plenty of use cases with similar requirements of having certain actions to fulfil between the Prepare and actual Execution of the Change Sets.

To resolve the problem, I suggest extending the AddStageOptions interface with an optional property representing the number of intermediary actions you need room for.

Closes #11333


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

…kStage addApplication()

Currently there is no way of reordering stages/actions once they are created. Getting to

the Prepare and Execute change set actions while adding an application stage, we identified a

use case within our company that needs one or more intermediary sequential actions before

actually executing the change set. To resolve the problem, I suggest extending

the AddStageOptions interface with an optional property representing the number of

intermediary actions you need room for.

Closes aws#11333
@gitpod-io
Copy link

gitpod-io bot commented Nov 9, 2020

@hoegertn
Copy link
Contributor

hoegertn commented Nov 9, 2020

Can you provide a sample code on how you would use this in reality?

I am struggling with the name a little bit.

@adriantaut
Copy link
Contributor Author

adriantaut commented Nov 9, 2020

@hoegertn sure, please find it below

const cdkStage: cdkpipelines.CdkStage = this.cdkPipelineInstance().addStage(appStage.stageName);

cdkStage.addApplication(appStage, {
  manualApprovals: true,
  roomForIntermediaryActions: 1,
});

cdkStage.addActions(this.createOpenSNowChangeRequestAction(runOrder: 3);

The main idea is the need for the following actions in a sequential order:

  1. Prepare Stack Change Set
  2. Manual Approval
  3. Interaction with ServiceNow (ticketing tool) - consumes the user that approved 2) and creates a change request with that email. Before any change in the AWS infrastructure, this change needs to be created.
  4. Execute Change Set

*
* @default 0
*/
readonly roomForIntermediaryActions?: number;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not too happy with the name, but I'm struggling to come up with a better one.

How about:

  • prepareExecuteDistance
  • runOrderSpace
  • runOrderDistance
  • extraRunOrderSpace // leaning most towards this
  • runOrderIncrement (default: 1, cannot be <1)

Also, can add to the comment block why you might want to use this? Something like: You can use this to make extra room in the runOrder sequence between the changeset 'prepare' and 'execute' actions and insert your own actions there.

Heads up: this API is going to change in the somewhat near future, because I'm very unhappy that users are being forced to deal with runOrders at all. We don't know what the final form will be though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to change it and I agree extraRunOrderSpace better illustrates the intention of this work

…kStage addApplication()

naming changes as per reviewer recommendation

Closes aws#11333
@mergify mergify bot dismissed rix0rrr’s stale review November 10, 2020 10:12

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Nov 10, 2020

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: c4cfc1d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Nov 10, 2020

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pipelines] extra room for actions in cdkStage addApplication()
4 participants