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

Add support for canceling goals #572

Merged
merged 16 commits into from Nov 13, 2018

Conversation

Projects
None yet
4 participants
@cdupuis
Copy link
Contributor

cdupuis commented Nov 12, 2018

This adds support for canceling goals:

export const cancel = new Cancel({ goals: [autofix, build, dockerBuild, publish] });

This goal when added to a goal set will cancel all pending or in process auto fix, build, docker build and publish goal instances on the current goal's push.before.sha of the same branch.

Which goals should be canceled can you be defined with the goalFilter on CancelOptions:

/**
 * Options to configure the Cancel goal
 */
export interface CancelOptions {

    /**
     * Goals that should be canceled if they are in a state that allows cancellation
     */
    goals: Array<Goal | Goals>;

    /**
     * Filter goals to cancel based on goalSet or state
     * @param goalSet
     */
    goalFilter?: (goal: SdmGoalEvent) => boolean;
}

fixes #571

@cdupuis cdupuis changed the title Add tests for Cancel goal Add support for canceling goals Nov 12, 2018

@cdupuis cdupuis requested review from ddgenome and lievendoclo Nov 12, 2018

@cdupuis cdupuis referenced this pull request Nov 12, 2018

Merged

Add support canceling goals #80

cdupuis added some commits Nov 12, 2018

@ddgenome
Copy link
Member

ddgenome left a comment

Looks good. One question about a null check.

Show resolved Hide resolved lib/api-helper/listener/executeCancel.ts Outdated
@lievendoclo
Copy link
Contributor

lievendoclo left a comment

OK

@atomist-bot atomist-bot merged commit d64899f into master Nov 13, 2018

2 checks passed

license/cla Contributor License Agreement is signed.
Details
sdm/atomist/atomist-sdm Atomist Software Delivery Machine goals: all succeeded
Details
@atomist-bot

This comment has been minimized.

Copy link
Contributor

atomist-bot commented Nov 13, 2018

Pull request auto merged by Atomist.

[atomist:generated] [auto-merge:on-approve]

@atomist-bot atomist-bot deleted the cancel-goal branch Nov 13, 2018

atomist-bot added a commit that referenced this pull request Nov 13, 2018

Changelog: #572 to added
[atomist:generated]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment