To handle problems mentioned here and here, I wrote a plugin that listen on pull request events and then does a POST to a pre-defined URL. Since I'll need different URLs for each repository, I need to, somehow, create a per-repository configuration for my plugin.
That seems trivial enough to do if I were using a hook, but, unfortunately, no hook covers my use case.
How can I create configuration screens per-repository, and the retrieve these settings?
Community moderators have prevented the ability to post new answers.
Hi Daniel,
The best example to look at would be the following plugin:
https://bitbucket.org/atlassianlabs/stash-refchange-settings-plugin
You may also want to look at a few other UI examples here, although they don't store any settings. A list of all the Stash example plugins can be found here:
http://atlassian.bitbucket.org/#stash
Just in general most of this relies on general Atlassian plugin components, which has plenty of documention (ie you might have more lucking searching for JIRA/Confluence than just Stash).
Let me know if you get stuck or have any questions.
Charles
PS. We do have plans to make adding plugins that save general settings as streamlined as hooks, but we haven't had the time to make that possible.
Thanks. I have been using that plugin as reference -- and all the other resources you mentioned, in fact --, though it uses the old widget.aui library and the completely undocumented soy templates, plus a lot of completely undocumented APIs. It has not been an easy task at all, despite how close it comes that my needs.
I might also add that looking at that plugin and at this tutorial, one would be hard pressed to tell what they have in common, despite the fact that the tutorial is essentially teaching most of what the refchange plugin is doing.
And, as a final note, I could not find a single other plugin that stores state and is not a hook plugin. Having other plugins to compare against each other would have made the task easier.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
Since then, did you manage to write this piece of plugin? I am facing with the same issue here, I want to write a simple plugin that listens to server events (so it is not a git hook) and configure settings per repository. I cannot find any useful information that I can start with, when I am new to stash plugin development. I cannot even find any documentation about these soy templates.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For more code youc an look at that might be helpful, I have just open-sourced my stashbot plugin. It does per-repository configurations which are not done as hooks and persists them using active objects. Check out https://github.com/palantir/stashbot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.