Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Enforce naming convention for repository names

Jonas Lindström September 1, 2015

I would like to enforce a stricter naming convention for repository names, which I can do by implementing listeners for repository events. This works fine; however, Stash has a built-in validation which runs first. So if the user enters e.g. a name containing '/', an error message in red is displayed:

  Repository names are limited to 128 characters. They must start
with a letter or number and may contain spaces, hyphens,
underscores and periods

If the user corrects the name and tries again, the event listener will run and possibly cancel the repo change again, but with a different error message. This is confusing to the end user. Is there a way of configuring or hooking into the built-in validation?

1 answer

0 votes
Mark McCormack _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 1, 2015

Jonas,

It seems you have mostly succeeded in achieving your aim of enforcing naming conventions. ScriptRunner for Stash solves this particular problem.

If you simply want to view the documentation, you can find how ScriptRunner for Stash achieves this in the Naming Standard Enforcement section.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events