stash-jenkins-postreceive-webhook icon indicating copy to clipboard operation
stash-jenkins-postreceive-webhook copied to clipboard

Set "Omit SHA1 Hash Code" as checked after upgrading the Jenkins plugin

Open svante66 opened this issue 10 years ago • 5 comments

Hi, We just upgraded the Stash Webhook to Jenkins to the latest version where the new option "Omit SHA1 Hash Code" is added. It seems that this new option changed the behavior of the plugin, Now when it is un-checked (default for enabled repos) the parameter $GIT_BRANCH is passed with the value 'detached' when triggering a build manually. In the earlier versions this parameter was not passed at all. This makes a lot of our builds to fail and I need to check this new option for all repos where I don't want this parameter to be passed. My issue is that I have 820 repos using this plugin! In my opinion the Omit-option should have been checked as default when upgrading the plugin since this mimics the previous behavior. Is there a way to "bulk"-update these repos checking this option? Please get back at your earliest convenience. This is quite an issue at the moment! Cheers, // Svante

svante66 avatar Oct 30 '14 10:10 svante66

I noticed this closed issue: https://github.com/Nerdwin15/stash-jenkins-postreceive-webhook/issues/78 Would it be wiser to downgrade to 2.4.2 maybe, waiting for the fix in Jenkins?

svante66 avatar Oct 30 '14 11:10 svante66

I just re-tested the fix I implemented and I see that the branch name is passed correctly. I also see that the $GIT_BRANCH variable shows up as "detached". To me, it looks like this comes from the Jenkins Git plugin, so I doubt downgrading would change anything. In case you downgrade, let us know if it helped.

hendrikhalkow avatar Oct 30 '14 16:10 hendrikhalkow

Down grade should be the right thing to do now. We've downgraded to 2.4.2 and is working fine.

faiyat avatar Oct 30 '14 16:10 faiyat

Just did a few tests: Omitting the branches parameter when sending the hash code seems to solve the issue. Can somebody of you confirm this by testing it via curl that this helps? curl "${JENKINS_URL}/git/notifyCommit?url=${REPO_URL}&sha1=${SHA1}"

hendrikhalkow avatar Oct 30 '14 17:10 hendrikhalkow

FWIW, I don't seem to have this problem with the newer Jenkins GIT plugin (2.3.1, released late Nov) - $GIT_BRANCH is correct when the SHA1 is sent by the stash plugin. ie the default probably shouldn't be changed.

bbaetz avatar Dec 19 '14 09:12 bbaetz