-
Notifications
You must be signed in to change notification settings - Fork 50
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
PR Merge and Push causes double-build of branch #201
Comments
This could be related to #200, when merging, a branch s deleted and this might be causing the second build to be triggered. |
@juanmacoo --
Nope. I just tested that case and it didn't make a difference. The steps I took:
So alas, this has nothing to do with #200 -- instead, I think the issue here is a race condition, where it is testing whether the SCM changed before the previous build is processed (and updates the SCM). I think this because while the logs say "SCM changed" and it queues the build, by the time the queued build happens, Jenkins knows there were no changes (because the second build reports no changes). In other words the "test if SCM has changed" isn't actually testing that properly because (I think) the two build requests are being queued too close together. |
Similar issue i am also facing ... |
Similar issue here, too! |
Same issue here too |
Hi @derekatkins. Thank you for reporting. |
@julioc-p -- I'm afraid I don't follow. I mean, yes, I understand that a "merge" and a "push" /can/ be different things (e.g. if I push a commit directly into main branch). However, when I'm merging a PR into main, I do NOT expect it to build the resulting code twice from the same commit. |
@derekatkins Note: Right now what happens is that the pull request event uses the last commit of the branch from where the pull request is made and the push event uses the merge commit id. So, actually two different commits are being built, but as you said, with the same code! |
Thanks. IMHO I think it is self evident that the target branch is what should get built in pretty much every instance. I'm having trouble thinking about when one would not want this to be the case. Regardless, the real issue in my mind is to not build the same commit twice :) |
Hi,
I've got BBPaPRP installed and running and I ran into an interesting issue that I think is a bug. I've got the plugin set up to build on a PR Create, Update, or Merge (for any branch) and I also have it set up to build on a Push to branch master. I also have the webhook set up to trigger on a Repository Push and a PR Create/Update/Merge. This looked like it was working, but I noticed today that when I merged a PR back into master it built the branch twice.
Not surprisingly, the webhook was called twice, however even though I have the "Bitbucket Cloud Push" trigger configured with none of the checkboxes checked (i.e., "Trigger also if nothing has changed in the repo" is NOT checked), it built the branch with no changes! Strangely, the log claims "SCM changes detected in Test-Repo" however when looking at the build itself, it says "No Changes". The log is below.
Am I doing something wrong? Do I have something misconfigured? Or is this actually a bug?
PS: There is an off-by-one bug. The log says it is triggering build 16, but it's really build 15 (when looking at the build history for the project).
The text was updated successfully, but these errors were encountered: