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

Use git scm as provider #58

Closed nickbroon closed 8 years ago

nickbroon commented 8 years ago

I rebased/squashed, laurentverbruggen:feature/use-git-scm-as-provider as originally submitted in #26

nickbroon commented 8 years ago

Ignore this pull request! Still suffers from a problem with invalid URI.

WARNING: stashpullrequestbuilder.stashpullrequestbuilder.StashBuildTrigger.run() failed for hudson.model.FreeStyleProject@18266395[code_pullrequest_checker]
java.lang.IllegalArgumentException: Invalid stash URI git@example.com/~user/code.git
at stashpullrequestbuilder.stashpullrequestbuilder.stash.StashApiClient.<init>(StashApiClient.java:62)
        at stashpullrequestbuilder.stashpullrequestbuilder.StashRepository.init(StashRepository.java:142)
        at stashpullrequestbuilder.stashpullrequestbuilder.StashPullRequestsBuilder.run(StashPullRequestsBuilder.java:29)
        at stashpullrequestbuilder.stashpullrequestbuilder.StashBuildTrigger.run(StashBuildTrigger.java:182)

@laurentverbruggen @nemccarthy

nemccarthy commented 8 years ago

Thanks @nickbroon does this work with different URIs? Could we just add credentials support instead of trying to get them from the git plugin

nickbroon commented 8 years ago

Actually, now that I think about it, I think your right, just adding credential support to the plugin keeps it simple. The URI for the stash instance used for the PR trigger is distinct from the URI used for the Git repository, so trying to combine the handling is over kill.

nemccarthy commented 8 years ago

Would you have time to work on this? Would be a killer feature. Make a great release for 1.5 which should also have the ability to avoid posting messages to Stash when build starts

nickbroon commented 8 years ago

I'll start having a look into this. Don't know much about Jenkins in general and the credentials in particular, but I'm sure other plugins to look at, and conceptually it's seem straightforward to replace the user/password fields with credentials selection box. https://github.com/jenkinsci/ghprb-plugin looks like a good place to learn from. Are you working on the serialise support for local storage to allow better PR comment control? :-)

nickbroon commented 8 years ago

I'm making slow but steady progress: https://github.com/nickbroon/stash-pullrequest-builder-plugin/commit/adce271a26645b8b7bb1784f1e15ec44e8e146a2

I've just got to pass the credential down to the StashApiClient class, and then do some testing.

Though I've just spotted you've got a similar branch: https://github.com/nemccarthy/stash-pullrequest-builder-plugin/commit/654443365b9068a0f10b6b61508f1377f93af163

I'll complete the work I've begun, and submit a PR for your consideration.

nemccarthy commented 8 years ago

Awesome, thanks @nickbroon This and PR state serialisation should be the next big features.

nickbroon commented 8 years ago

I completed what I thought was all the coding but hitting a crash at moment. Code and backtrace at: https://github.com/nemccarthy/stash-pullrequest-builder-plugin/commit/877340538d532d3e4e20851260b48c6fa5bf91d8?_pjax=%23js-repo-pjax-container#commitcomment-14529030

nickbroon commented 8 years ago

https://github.com/nickbroon/stash-pullrequest-builder-plugin/commits/stash_credentials This one works. Minor issue of it not showing the selected Credential in the drop down box after saving/reloading the config page, which I'm looking into, but it does work.

nickbroon commented 8 years ago

Closing in favour of #61