Some brainiac decided it would be a good idea to throw an error when a pull request was already approved - so we have too much success everywhere, throw an error. Is there anyway to get the system to stop doing this?
Bitbucket Approve: 409 - Conflict
Edited with more details:
1. I've trimmed up the output from my Jenkins job. As you can see, the build is a success (the build number update is an internal service we use to keep track of build numbers, bug resolutions, etc.). Then it goes to approve the Bitbucket system which returns a HTTP 409:
Octopus deployment for Product:3.13.6.2 Version:3.13.825.1782 skipped.
Completed build 3.13.825.1782
Marking build success. Uri: http://myserver.com/BuildNumbers/api/success/3/13/825/1782/Debug/private/jenkins-pullrequest/
BuildNumber is incremented to 3.13.825.1783
Restoring Environment
Bitbucket Approve: https://api.bitbucket.org/2.0/repositories/mysecretrepo/commit/a63bd4c1b72d3202a954163ab2664a95133c2349/approve
Bitbucket Approve: 409 - Conflict
ERROR: Build step failed with exception
java.lang.IllegalStateException: closed
at com.squareup.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:455)
at okio.Buffer.writeAll(Buffer.java:594)
at okio.RealBufferedSource.readByteArray(RealBufferedSource.java:87)
at com.squareup.okhttp.ResponseBody.bytes(ResponseBody.java:56)
at com.squareup.okhttp.ResponseBody.string(ResponseBody.java:82)
at org.jenkinsci.plugins.bitbucket_approve.BitbucketApprover.perform(BitbucketApprover.java:106)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1835)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Approve commit on Bitbucket' marked build as failure
Sending build status FAILED for commit a63bd4c1b72d3202a954163ab2664a95133c2349 to BitBucket is done!
A simple Google shows this:
https://issues.jenkins-ci.org/browse/JENKINS-46681
The issue was raised to Bitbucket and here was the official response:
https://getsupport.atlassian.com/servicedesk/customer/portal/11/BBS-62500
Thank you for contacting Atlassian Support in regards to the issue that you're facing.
Based on our observation, the error 409 that you're receiving is meant to provide an update that the commit is already approved by the authenticated user.
Below is the error message which should be included with error code:
{"type": "error", "error": {"message": "You already approved this commit."}}
With this status code respond, it would help users to identify whether the authenticated user had approved the commit.
Hope this explains.
Nonetheless, if you wish to have this changes be reverted, we would suggest submitting a request with a link below so that our dev team is aware of it: https://bitbucket.org/site/master/issues
Please do note that all new features will be implemented according to our policy:
https://confluence.atlassian.com/display/Support/Implementation+of+New+Features+Policy
If you need any further assistance, please feel free to let me know.As far as I can tell, no user has approved this commit - but clearly the system thinks it has. AND even if it was approved previously (some process re-ran) I don't care - Just approve it again.
Therefore, what I'm hoping for is some sort of flag that says "Don't fail when there is too much success".