err-jenkins icon indicating copy to clipboard operation
err-jenkins copied to clipboard

Allow chaining commands in bender

Open arthursoprana opened this issue 4 years ago • 7 comments

The idea is that the user would be able to to the following (perhaps with a different syntax)

!build <some-job-name> !merge <branch-name>

Which means that, after the command !build finishes, call the command !merge.

arthursoprana avatar Oct 19 '20 16:10 arthursoprana

But only if the first command succeeds, right? Do we have a notion of "success" for bender commands?

tigarmo avatar Oct 19 '20 16:10 tigarmo

The "build" command succeed when bender can trigger the job. The job build state change is another event.

prusse-martin avatar Oct 19 '20 16:10 prusse-martin

Then that's something to consider, because I imagine that we don't want to merge if the job triggered by the build command fails

tigarmo avatar Oct 19 '20 16:10 tigarmo

merge is actually implemented on err-stash here and for now we don't know whether it succeeded or not.

gcardozo123 avatar Oct 19 '20 16:10 gcardozo123

I think this comes in line with the proposed gate keeper. I don't think we have it in our short time planning.

prusse-martin avatar Oct 19 '20 16:10 prusse-martin

Another thing that should be considered. If the triggered job succeeds and that cause another downstream job to be started? A merge could fail since stash already know there is another build for that commit running; Or bender could try to merge before jenkins notify about the build and the merge and branch deletion happens. I don't have idea of what will happen if jobs_done try to remove a job with an ongoing build.

prusse-martin avatar Oct 20 '20 14:10 prusse-martin

Then that's something to consider, because I imagine that we don't want to merge if the job triggered by the build command fails

True @tigarmo, this process of build followed by merge would only be safe if a merge check of minimum number of successful builds is enabled in stash.

arthursoprana avatar Oct 20 '20 17:10 arthursoprana