What happens if there are two suborgs mapped to the same repository? #418
-
Suppose I have these two files: # admin/suborgs/example.yml
suborgs:
- example-* # admin/suborgs/example-foo.yml
suborgs:
- example-foo-* And then I were to create a repo named Would it apply one or both suborg settings, and in which order? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Hi @justinmchase, it will apply only one of the suborg configurations. I haven't checked yet for the order but I assume it loads the setting files alphabetically and the last one would take precedence. To prevent from these situations I have implemented in our org a validator, which validates the yaml files based on a schema + ensures that suborgs do not have overlapping repos. If there is interest I might consider open sourcing the validator. At least the tool ensures that users get immediately informed in a PR through annotations if they made a mistake/typo in the settings. |
Beta Was this translation helpful? Give feedback.
-
I have been playing around with suborg matching the same repository and the order in which the suborgs are evaluated is indeed alphabetical. |
Beta Was this translation helpful? Give feedback.
-
Not to hijack this but @martinm82 how did you implement the validator, as a plugin or a simple validator in deployment-settings? |
Beta Was this translation helpful? Give feedback.
Hi @justinmchase, it will apply only one of the suborg configurations. I haven't checked yet for the order but I assume it loads the setting files alphabetically and the last one would take precedence.
To prevent from these situations I have implemented in our org a validator, which validates the yaml files based on a schema + ensures that suborgs do not have overlapping repos.
If there is interest I might consider open sourcing the validator. At least the tool ensures that users get immediately informed in a PR through annotations if they made a mistake/typo in the settings.