Closed itay closed 8 years ago
I'll have a look at it. I'm positive to the idea! But if it means to much duplicated code, I'd rather not implement it.
+1. This would be a nice feature but it may be tough to implement.. I'm still learning the Atlassian SDK and Java :) but I believe only pre-receive and post-receive hooks can be configured at the repository level. Can event listener type plugins be configured at the repository level?
We are currently triggering post-merge/commit builds using https://marketplace.atlassian.com/plugins/de.aeffle.stash.plugin.stash-http-get-post-receive-hook In our case we had the post-merge/commit builds setup first using the above hook and had no way of triggering pull-request builds.
For our project/repo owners, we wanted to make the setup for all their builds be common using one hook and we administer the pull-request-notifier-for-stash plugin at the system admin level. So the project/repo owners still use the stash-http-get-post-receive-hook to setup all their jobs including pull-request and based on the pull-request events we trigger on from Tomas' plugin, we have a job "pull-request-handler" that queries the database for the pull-request job configurations that are setup/enabled with the other plugin and trigger the appropriate jobs.
Not having it on a repository level makes it useless for my use case. So I cannot have more than one jenkins or I'd need stash administration privileges to configure it.
Why can you not get administrative privileges?
Hi Tomas, I belong to a large organization which has a Stash administrator who don't want to reconfigure the plugin for every user/project. Also, we have several jenkins servers across different projects, so definitely we would need to setup on a repository level, just like the "Stash Webhook to Jenkins" addon does. We currently use it, but I suppose your plugin is better designed for pull requests. Thank you for your effort thought :)
Ok. I dont think it would be to hard to fulfill your requirements, @thalesac.
It could be solved by adding configuration option, in the plugin configuration page, to also allow ordinary admins and users. System admins should always be allowed. The access restrictions is implemented in the plugin, https://github.com/tomasbjerre/pull-request-notifier-for-stash/blob/1c7904f89566b0ba29c42c777b1f3925256d6f8b/src/main/java/se/bjurr/prnfs/admin/ConfigResource.java#L77 . So it is just a matter of reading the config and check if current action is allowed. It would mean that you can access the configuration page as an ordinary user. If you know the exact URL of it, which is something like "/stash/plugins/servlet/prnfs/admin".
I just released 1.20 with that configuration option.
Any news about this issue. With a lot of repo's with different build plans it is very hard to maintain this globally. So a per repo based configuration would be very appreciated.
Rudy
No not really. There is a rest resource here: https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/blob/master/src/main/java/se/bjurr/prnfb/admin/ConfigResource.java I know that some people use scripts to configure it. Such script are welcome as pull-requests by the way.
Perhaps it would help refactoring the admin gui a bit? But I dont have time for this right now.
Refactoring might help (a bit) e.g. tabs in stead of a growing page. And I will look into the rest resource.
Thanks for creating this plugin and for your quick response.
GUI is just not my cup of tea :)
Haha, and Java not mine!
The GUI is just an html, js and css. The .travis.yml file shows exactly how to setup atlassian SDK. So if you want to, feel free to make an attempt :)
Or perhaps just edit the static files offline. And I'll make it work with java.
I will look into it, after the weekend, but no promises from my side.
+1 It would be great if it were possible to do per-repository configuration without the risk of breaking the config for another team/project.
It's conceptually simpler for the user to keep all the repo specific config in the repo settings page and all the system level config in the admin screen.
I'm in a large organisation with dozens of teams where only the Stash admins have access to the admin screen.
I'd like to do a pretty big refactoring of the code. That would solve this issue. I'll try to find some time for that soon.
This is what I have right now. Whats left to do is add Javascrits to invoke the new rest-resources and add migration code to be backwards compatible with previous settings format.
Global level config:
Repo level config:
That looks much cleaner than the current version! You are doing a great job!
@tomasbjerre any reason the button configuration is not in the repo-specific page?
I'll change that and add buttons to repo level config as well.
Anybody wants to try it out before release?
https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/releases/tag/2.18-RC1
Released in 2.18
It's a bit odd that the configuration is done globally and you have to explicitly "filter" out your repository. It would be nice if you could also edit configuration in the per-repository hook setup screen, which would automatically be filtered out for that repository.
You would keep the global config too, in case someone wanted to define a global rule.