mohamicorp / stash-jenkins-postreceive-webhook

Webhook used to notify Jenkins when commits are made to Stash
Other
138 stars 98 forks source link

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

Open svante66 opened 9 years ago

svante66 commented 9 years ago

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 commented 9 years ago

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?

hendrikhalkow commented 9 years ago

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.

faiyat commented 9 years ago

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

hendrikhalkow commented 9 years ago

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}"

bbaetz commented 9 years ago

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.