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

Some build failures (unstable status) resulting in "in progress" rather than failure status posting to Bitbucket (Cloud) #193

Open
stevemuskiewicz opened this issue Mar 6, 2019 · 7 comments

Comments

@stevemuskiewicz
Copy link

We are on Bitbucket Cloud with version 1.4.30 of Bitbucket pull request builder plugin. It seems like there are certain cases of a Jenkins build failure that are not posting a proper "failed" build status back to the Bitbucket PR, instead we just see an "in progress" build status but the link does not actually go back to a Jenkins build result, only to our main Jenkins URL. If I look at the commit status in the bitbucket API, I see these (relevant) fields:

      u'refname': None,
      u'state': u'INPROGRESS',
      u'type': u'build',
      u'updated_on': u'2019-03-06T15:46:48.456391+00:00',
      u'url': u'http://XXXXXX:8080/'}

However there are other failing builds (checkstyle results) that are properly posting their status back to the PR so this isn't completely broken.

For the Jenkins job with the "failed" (actually unstable) result, the unstable status actually comes from the Violations plugin based on a specific type of check failure (PEP8). I'm not sure if this is significant but figured I would mention in case it is...so I see this at the end of the Jenkins console:

11:33:11 Build step 'Report Violations' changed build result to UNSTABLE
11:33:11 [Slack Notifications] found #359 as previous completed, non-aborted build
11:33:11 Finished: UNSTABLE

Unfortunately I don't see anything else in the build logs to indicate that there was an issue with build status being posted. I don't really see anything relevant in the jenkins.log file either but if there is something specific I should look for please let me know and I'll post here.

@stevemuskiewicz
Copy link
Author

Seeing this issue again, but looks like what might be happening is that build (triggered by the PR builder) is in progress and before the build completes a new commit is pushed to the PR (we have both "Rebuild if destination branch changes?" and "Cancel outdated jobs?" enabled in our Jenkins job config).

It looks like the pull request builder is posting an "in progress" status on the new commit SHA but it is not canceling the existing build and then nothing else happens and no Jenkins build is triggered against the new commit (nor is the old build cancelled).

So seems to me like some of what was supposed to be fixed in #188 is still not working using this version of the plugin.

Indeed I checked our builds today and older builds are definitely not getting cancelled whereas they did when we were using plugin version 1.4.28.

So may still be the same bug as before?

@CodeMonk
Copy link
Collaborator

CodeMonk commented Apr 8, 2019

Thanks - I'll start looking into it.

@otalio
Copy link

otalio commented Jun 3, 2019

@CodeMonk

Hello, We're still facing this with version 1.4.30. Do you have any new release planned in which this will be fixed?

@CodeMonk
Copy link
Collaborator

CodeMonk commented Jun 4, 2019

I have not personally reproduced or fixed it. However, I do hope to get time soon.

If anyone else has cycles to dig, it would be appreciated . . . if not, I will try to get to it as soon as I can -- hopefully this week I can start. Ya know - paying job and stuff . ;-)

@stevemuskiewicz
Copy link
Author

Just confirming that this is still present in the latest version (1.5.0) of the plugin

@stevemuskiewicz stevemuskiewicz changed the title Some build failures resulting in "in progress" rather than failure status posting to Bitbucket (Cloud) Some build failures (unstable status) resulting in "in progress" rather than failure status posting to Bitbucket (Cloud) Aug 26, 2021
@stevemuskiewicz
Copy link
Author

Some clarification on when this happens: if the build results in a "FAILED" status in Jenkins then it does post the correct status to the Bitbucket commit. The problem seems to be when the Jenkins build status is "UNSTABLE" (ie. test failures), in these cases instead of posting a "FAILED" status to Bitbucket (like we see in the 1.4.x plugin versions), it is instead posting an "INPROGRESS" status and the build URL only links to the general CI/Jenkins top URL, not to the specific build job itself.

HTH

@HeidiRechek
Copy link

following

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants