Is it somehow possible to set default values for the repository settings for newly created repositories? (e.g. reject force push plugin enabled, pull requests require at least one approver and all tasks to be resolved)
Also, is there any way to bulk-apply settings to all existing repositories within a project?
No - it isn't (see https://jira.atlassian.com/browse/STASH-3597 or https://jira.atlassian.com/browse/STASH-3787 or https://jira.atlassian.com/browse/STASH-4323)
The only way to bulk-apply settings I know is by scripting the API or writing an own STASH-plugin ...
I am a bit confused now. Are you in the process of making this happen or not? Default settings on the server level and/or the project level would be very useful. The bulk-applying would also be great. We just upgraded Stash and I had to manually switch on the "Requires all tasks to be resolved" in about a hundred repos. Not very fun on the web interface. (If there is/were a central config file storing these settings, that would make life much easier.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wrote perl modules, implementing the needed API-functionality / REST-interface and a script to ensure certain repository settings. These scripts are for internal use only yet (containing some internals ...) and aren't in a state to be publishable - I have not any plans (nor permission) to publish this yet ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ours are in Ruby, but for the same reason I cannot publish them just yet. I will check if we can make these open source!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Atlassian: Judging by the relatively elaborate workarounds posted here, I think this would be something to implement. ;) @Everybody else, thanks for the tips. So far it does not annoy me enough to write a script for it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You might be interested in our new Stash plug-in Repository Templates for Stash which allows you to configure a repository as a template to copy all repository settings (hooks settings, pull request settings, permissions, ...) from this template over to newly created repositories (and to existing repositories as well).
Kind regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Balazs,
We have solved this with a cron-job running on the Stash server while waiting for STASH-3597 to be implemented.
The cron-job runs every 5 minutes and uses the REST API to
It uses a structure where each project is defined and the various repo settings are specific per project.
The main benefits are that we can centrally manage this and ensure repos are correct configured. Another great effect is that when a new repo is created in a project it takes just a few minutes and then it is automatically configured according to the project specification!
NOTE: if you have a lot of repos you may want to monitor this cron-job. It takes a while for it to execute when you scale it.
Hope this helped!
Cheers,
// Svante
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We use a similar setup - unless we run our job manually. We mostly use this to ensure that "force push" is not accepted by STASH ... (miost of our user knew that force push is not a thing to do - but some might do it by accident - if it wouldn't be disabled from STASH-side...)
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.