DevOps Stack Exchange is a question and answer site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure. Join them; it only takes a minute:

We used the shared-pipeline code functionality of Jenkinsfile, along with multibranch pipelines- all our Jenkinsfile code lives in one repo and each application makes only a parameterized call to a function in this repo.
The problem comes when the plugin posts status- it posts to the repo of the shared pipeline code, not the application being built! It is otherwise working correctly, authenticating and posting status quickly.

The plugin is not parameterized to allow me to pass in a commit ID- meaning that this is being derived from an environment variable, presumably in a novel way that other plugins are not using. The plugin specifically cites changes to facilitate Jenkinsfile and multi-branch pipelines. I suspect I may have a race condition with the scm checkout command, perhaps the bitbucket plugin is being initialized before any call to scm checkout is made?

Does anyone have any advice on debugging this? jenkins.err does not contain any errors, since nothing is throwing. Is there an environment variable I can change in order to force a context switch from the shared pipeline code repo to the application code repo?

Thanks for responding. I am using the latest version of this plugin - both of these bugs appear to reference the issue I am having, but only as an incidental side effect, and I suspect that this fix may not have been verified. This is good background on the issue though- thank you! I am unclear how a plugin with thousands of monthly downloads could have such a glaring issue with no open bugs!
– esoterydactylOct 28 '17 at 1:39