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

Pushing new commit to existing PR does not stop previous build #379

Closed
slefrancois opened this issue Jul 7, 2016 · 11 comments

Comments

Projects
None yet
10 participants
@slefrancois
Copy link

commented Jul 7, 2016

We are using Github hooks to trigger builds. It seems that when pushing a new commit to a PR that already has a Jenkins build running, it starts a new build as expected, but does not automatically close the old build on the previous commit.

@gharcombe-minson

This comment has been minimized.

Copy link

commented Jul 15, 2016

In your job configuration, under Trigger Setup, you can add Cancel Build on Update, which will terminate the job when an update is pushed and it's running.

@slefrancois

This comment has been minimized.

Copy link
Author

commented Jul 26, 2016

Thanks, seems I missed that option.

@aballano

This comment has been minimized.

Copy link

commented Apr 25, 2017

@gharcombe-minson Hi there, is there any way to configure that using the DSL plugin? Otherwise, won't that config be overriden by the DSL script?

@ggrell

This comment has been minimized.

Copy link

commented May 4, 2017

Is there any place to check why this wouldn't be working? Our Jenkins PR job has the "Cancel build on update" added under trigger setup, but no matter how many subsequent pushes happens on the GH PR, it keeps adding new jobs and old ones stay in the queue. Don't know if it matters that it's Enterprise GH.

Or does this only stop running jobs, but not queued ones?

@perguth

This comment has been minimized.

Copy link

commented Oct 27, 2017

Because it's so incredibly well hidden:

Cancel Build on Update

  • That one I could not find: At the job level, it is found under Trigger Setup. Select Cancel build on update.
  • In Configure System (/configure), it is found under GitHub Pull Request Builder -> Application Setup -> Add -> Cancel build on update

Thanks janinko#440 (comment)

@16slowly

This comment has been minimized.

Copy link

commented Apr 13, 2018

when I add this selection "Cancel Build on Update", it still dosen't cancel the previous build @perguth , it seem to about with https://jenkins.io/security/advisory/2018-03-26/#SECURITY-261, what should i do ?
Thanks!

@forpix

This comment has been minimized.

Copy link

commented May 16, 2018

is it possible to restrict the build for pull request.

@bjoernhaeuser

This comment has been minimized.

Copy link
Contributor

commented May 16, 2018

@forpix please create a new Issue which detailly explains your problem :)

@forpix

This comment has been minimized.

Copy link

commented May 17, 2018

@bjoernhaeuser Thanks for the response, let me explain here.

In Jenkins I have a job which is configured to trigger on web-hook with GitHub, In GitHub I have 2 branches one is master and other is working branch. when I committed on master Jenkins trigger the job which is perfectly all right. But when I tried to pull request to working branch from master for the committed changes again a new build getting triggering which is completely annoying.
so is there any logic to stop the triggering the job for only pull-request

@tulku

This comment has been minimized.

Copy link

commented Mar 25, 2019

Is there a way to achieve this (cancel builds when new things are pushed to a branch / PR) when using the Pipeline Multibranch Plugin?

@nouiz

This comment has been minimized.

Copy link

commented Mar 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.