[JIRA] (JENKINS-45643) Bitbucket PRs are blocked by excluded branches not being able to report progress

6 views
Skip to first unread message

email@benjaminfuchs.de (JIRA)

unread,
Apr 8, 2018, 6:56:03 PM4/8/18
to jenkinsc...@googlegroups.com
Benjamin Fuchs commented on Bug JENKINS-45643
 
Re: Bitbucket PRs are blocked by excluded branches not being able to report progress

We are also having a problem with this issue.

1. There is a "branch" build of the "branch" job running
2. While its running a pull request is opened for that branch.
3. Multibranch scanning gets triggered.
4. The PR gets a "PR" project and a "PR" build starts running.
(5. I guess the Multibranch scanning has to be triggered again.)
6. Now the "branch" project gets disabled while the "branch" job is still running.

The "branch" build will now never update its status to Bitbucket.
This is a major issue, since the developer cannot merge its PR due to a running job.

I found out that this line is the problem when updating the status at the end of the job:
https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/3412b4eb5b35b9ade7a4e6cfafcdbf3375789fcb/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketBuildStatusNotifications.java#L101

s is of type NullSCMSource and I guess it is due to the branch being removed from "sources" in:
https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/MultiBranchProject.java

I create a workaround for us since this was a blocker:
https://github.com/benjaminfuchs/bitbucket-branch-source-plugin/commit/26b9f6ace3745cdd58ae1d43eb05d7eb3108f8f8

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

email@benjaminfuchs.de (JIRA)

unread,
Apr 8, 2018, 7:00:05 PM4/8/18
to jenkinsc...@googlegroups.com
Benjamin Fuchs edited a comment on Bug JENKINS-45643
We are also having a problem with this issue.

1. There is a "branch" build of the "branch" job running
2. While its running a pull request is opened for that branch.
3. Multibranch scanning gets triggered.
4. The PR gets a "PR" project and a "PR" build starts running.
(5. I guess  the Multibranch scanning has to be triggered again.)
6. Now the "branch" project gets disabled while the "branch" job is still running.

The "branch" build will now never update its status to Bitbucket.
This is a major issue, since the developer cannot merge its PR due to a running job.

I found out that this line is the problem when updating the status at the end of the job:
https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/3412b4eb5b35b9ade7a4e6cfafcdbf3375789fcb/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketBuildStatusNotifications.java#L101

s is of type NullSCMSource and I guess it is due to the branch being removed from "sources" in:
https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/MultiBranchProject.java

I create a workaround for us since this was a blocker:
https://github.com/benjaminfuchs/bitbucket-branch-source-plugin/commit/26b9f6ace3745cdd58ae1d43eb05d7eb3108f8f8


What already would help is to update the description in the job config pointing to this issue so it is clear to a new user choosing this option that he will face this race condition.

email@benjaminfuchs.de (JIRA)

unread,
Apr 8, 2018, 7:01:03 PM4/8/18
to jenkinsc...@googlegroups.com
Benjamin Fuchs edited a comment on Bug JENKINS-45643
We are also having a problem with this issue.

1. There is a "branch" build of the "branch" job running
2. While its running a pull request is opened for that branch.
3. Multibranch scanning gets triggered.
4. The PR gets a "PR" project and a "PR" build starts running.
(5. I guess  the Multibranch scanning has to be triggered again.)
6. Now the "branch" project gets disabled while the "branch" job is still running.

The "branch" build will now never update its status to Bitbucket.
This is a major issue, since the developer cannot merge its PR due to a running job.

I found out that this line is the problem when updating the status at the end of the job:
https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/3412b4eb5b35b9ade7a4e6cfafcdbf3375789fcb/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketBuildStatusNotifications.java#L101

s is of type NullSCMSource and I guess it is due to the branch being removed from "sources" in:
https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/MultiBranchProject.java

I create a workaround for us since this was a blocker:
https://github.com/benjaminfuchs/bitbucket-branch-source-plugin/commit/26b9f6ace3745cdd58ae1d43eb05d7eb3108f8f8

What already would help is to update If ther will be now "quickfix" I guess at least the description in the job config should be updated to pointing to this issue so it is clear to a new user choosing this option that he will face this race condition.

email@benjaminfuchs.de (JIRA)

unread,
Apr 8, 2018, 7:01:03 PM4/8/18
to jenkinsc...@googlegroups.com
Benjamin Fuchs edited a comment on Bug JENKINS-45643
We are also having a problem with this issue.

1. There is a "branch" build of the "branch" job running
2. While its running a pull request is opened for that branch.
3. Multibranch scanning gets triggered.
4. The PR gets a "PR" project and a "PR" build starts running.
(5. I guess  the Multibranch scanning has to be triggered again.)
6. Now the "branch" project gets disabled while the "branch" job is still running.

The "branch" build will now never update its status to Bitbucket.
This is a major issue, since the developer cannot merge its PR due to a running job.

I found out that this line is the problem when updating the status at the end of the job:
https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/3412b4eb5b35b9ade7a4e6cfafcdbf3375789fcb/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketBuildStatusNotifications.java#L101

s is of type NullSCMSource and I guess it is due to the branch being removed from "sources" in:
https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/MultiBranchProject.java

I create a workaround for us since this was a blocker:
https://github.com/benjaminfuchs/bitbucket-branch-source-plugin/commit/26b9f6ace3745cdd58ae1d43eb05d7eb3108f8f8

If ther there will be now "quickfix" I guess at least the description in the job config should be updated to pointing to this issue so it is clear to a new user choosing this option that he will face this race condition.

email@benjaminfuchs.de (JIRA)

unread,
Apr 8, 2018, 7:19:03 PM4/8/18
to jenkinsc...@googlegroups.com
Benjamin Fuchs edited a comment on Bug JENKINS-45643
We are also having a problem with this issue.

1. There is a "branch" build of the "branch" job running
2. While its running a pull request is opened for that branch.
3. Multibranch scanning gets triggered.
4. The PR gets a "PR" project and a "PR" build starts running.
(5. I guess  the Multibranch scanning has to be triggered again.)
6. Now the "branch" project gets disabled while the "branch" job is still running.

The "branch" build will now never update its status to Bitbucket.
This is a major issue, since the developer cannot merge its PR due to a running job.

I found out that this line is the problem when updating the status at the end of the job:
https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/3412b4eb5b35b9ade7a4e6cfafcdbf3375789fcb/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketBuildStatusNotifications.java#L101

s is of type NullSCMSource and I guess it is due to the branch being removed from "sources" in:
https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/MultiBranchProject.java

I create a workaround for us since this was a blocker:
https://github.com/benjaminfuchs/bitbucket-branch-source-plugin/ commit tree / 26b9f6ace3745cdd58ae1d43eb05d7eb3108f8f8 JENKINS-45643

If there will be now "quickfix" I guess at least the description in the job config should be updated to pointing to this issue so it is clear to a new user choosing this option that he will face this race condition.

me@thomaskeller.biz (JIRA)

unread,
Nov 22, 2018, 7:37:02 AM11/22/18
to jenkinsc...@googlegroups.com

This is really a blocker for the usage of this plugin. The only way to circumvent this issue is to build each PR twice, by disabling the option "exclude branches that are also filed as PRs", but this will just raise the load on the node for no reason.

I figured if a branch pattern could be applied that would only apply to non-PR branches this could also be worked around (by including only named, important branches there), but sadly, the implemented regex / wildcard filters read NOTE: this filter will be applied to all branch like things, including change requests so this is not an option.

Any reason why the quickfix from Benjamin Fuchs hasn't been considered yet?

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

will@nowhereetc.com (JIRA)

unread,
Dec 13, 2018, 5:23:21 PM12/13/18
to jenkinsc...@googlegroups.com

Note; this is a full on blocker for us, causing huge headaches on a daily basis.

 

One example of the behaviour is as follows:

  1. Build triggered, updates Bitbucket commit build status as 'build in progress', build starts
  2. Job is marked as disabled (can be because PR is merged, branch is gone, or simply that the configuration of the job has changed)
  3. Bitbucket status is frozen as 'in progress', regardless of if the job finishes.

 

I believe this all hinges on the fact that a disabled job never fires an update if the job is disabled, regardless of the build state, and whether the PR exists/is closed, etc.

will@nowhereetc.com (JIRA)

unread,
Dec 13, 2018, 5:24:02 PM12/13/18
to jenkinsc...@googlegroups.com
Will Freeman edited a comment on Bug JENKINS-45643
Note; this is a full on blocker for us, causing huge headaches on a daily basis.

 

One example of the behaviour is as follows (in addition to others listed above) :
# Build triggered, updates Bitbucket commit build status as 'build in progress', build starts
# Job is marked as disabled (can be because PR is merged, branch is gone, or simply that the configuration of the job has changed)
# Bitbucket status is frozen as 'in progress', regardless of if the job finishes.


 

I believe this all hinges on the fact that a disabled job never fires an update if the job is disabled, regardless of the build state, and whether the PR exists/is closed, etc.

will@nowhereetc.com (JIRA)

unread,
Dec 13, 2018, 5:31:02 PM12/13/18
to jenkinsc...@googlegroups.com
Will Freeman edited a comment on Bug JENKINS-45643
Note; this is a full on blocker for us, causing huge headaches on a daily basis.

 

One example of the behaviour is as follows (in addition to others listed above):
# Build triggered, updates Bitbucket commit build status as 'build in progress', build starts
# Job is marked as disabled (can be because PR is merged, branch is gone, or simply that the configuration of the job has changed)
# Bitbucket status is frozen as 'in progress', regardless of if the job finishes.

 

I believe this all hinges on the fact that a disabled job never fires an update if the job is disabled, regardless of the build state, and whether the PR exists/is closed, etc.


 

Triggers are fired on change, not poll.

You can also simulate by opening a pull request, closing it before the build finishes, then opening another PR with the exact same head, and you'll never be able to merge that PR (unless you push yet another change).

will@nowhereetc.com (JIRA)

unread,
Dec 13, 2018, 6:29:01 PM12/13/18
to jenkinsc...@googlegroups.com

email@benjaminfuchs.de (JIRA)

unread,
Dec 15, 2018, 9:56:03 AM12/15/18
to jenkinsc...@googlegroups.com
Benjamin Fuchs edited a comment on Bug JENKINS-45643
 
Re: Bitbucket PRs are blocked by excluded branches not being able to report progress
[~therealwaldo] [~thomaskeller] I just created a pull request from my workaround. We are using this already in our productiv system.

email@benjaminfuchs.de (JIRA)

unread,
Dec 15, 2018, 9:56:04 AM12/15/18
to jenkinsc...@googlegroups.com

Will Freeman I just created a pull request from my workaround. We are using this already in our productiv system.

mrkita@live.com (JIRA)

unread,
Jan 3, 2019, 3:31:02 AM1/3/19
to jenkinsc...@googlegroups.com

This is a total blocker for our team, where we first build Feature-Branch builds without PRs and at some point create a PR, where there can be an active branch build at the time of the creation.

 

This is definitely not a minor bug, and makes this feature unusable as is. If there is a workaround, can someone look into its mergability please?

sowasdummes@gmail.com (JIRA)

unread,
Jul 2, 2019, 4:49:02 AM7/2/19
to jenkinsc...@googlegroups.com
Martin M commented on Bug JENKINS-45643

Benjamin Fuchs, cool that you have a workaround. Any chances you will create a PR so that everybody can benefit from it? Or is the change just a workaround/hack?
Maybe some of the maintainers could take a look and judge whether the changes are fine?

sowasdummes@gmail.com (JIRA)

unread,
Jul 2, 2019, 4:50:02 AM7/2/19
to jenkinsc...@googlegroups.com
Martin M edited a comment on Bug JENKINS-45643
[~vollmilch], cool that you have a workaround. Any chances you will create a PR so that everybody can benefit from it? Or is the change just a workaround/hack?

Maybe some of the maintainers could take a look and judge whether the changes are fine?

josephp90@gmail.com (JIRA)

unread,
Mar 7, 2020, 1:10:24 AM3/7/20
to jenkinsc...@googlegroups.com
Joseph Petersen assigned an issue to Joseph Petersen
 
Change By: Joseph Petersen
Assignee: Joseph Petersen
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

josephp90@gmail.com (JIRA)

unread,
Mar 7, 2020, 1:18:03 AM3/7/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages