nemccarthy / stash-pullrequest-builder-plugin

A Jenkins plugin for Building Stash Pull Requests
https://wiki.jenkins-ci.org/display/JENKINS/Stash+pullrequest+builder+plugin
Other
64 stars 130 forks source link

Builds won't start if branch has restricted permissions #57

Closed DanEngelbrecht closed 9 years ago

DanEngelbrecht commented 9 years ago

If branch permissions are added in stash for a branch and the user jenkins uses is not listed as a user the pull-request won't start. This is strange since the access permissions only prevents writing to the branch and just fetch/checkout/merge locally on the build machine should not be blocked by that.

If I add the jenkins stash user to the list of users for the permission the build starts as expected.

nemccarthy commented 9 years ago

Have you tested the git checkout processes as the jenkins user without this plugin. This plugin simply drives the git plugin and the jenkins user should just need write permission as well as permissions to make comments on PRs.

DanEngelbrecht commented 9 years ago

The stash user works fine for doing regular checkouts and the pull-request builder works if I allow write permission to the target branch for the user.

You say it "just needs write permission" - why would it need to have write permissions to the branch? It does not push any changes to stash, it just checks out and merge locally or am I missing something?

17 nov. 2015 kl. 03:53 skrev Nathan notifications@github.com:

Have you tested the git checkout processes as the jenkins user without this plugin. This plugin simply drives the git plugin and the jenkins user should just need write permission as well as permissions to make comments on PRs.

— Reply to this email directly or view it on GitHub.

nemccarthy commented 9 years ago

It needs the permission to write the comment, if for some reason you don't give it write permissions to some branch can that user still post a comment on the PR. I haven't tried. Certainly the user used by this plugin needs write to the repo. Is the git plugin being called? It doesn't push anything back, it just parameterises the git plugin. So if the git plugin isn't working its out of the hands of the PR builder.