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?
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.)
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 ...
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!
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 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).
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot