Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR - GLAB_TAKE_NAMESPACE_SLUG #22

Open
magicofit opened this issue Sep 6, 2023 · 4 comments
Open

FR - GLAB_TAKE_NAMESPACE_SLUG #22

magicofit opened this issue Sep 6, 2023 · 4 comments

Comments

@magicofit
Copy link

Hi,

i have a new issue with subgroups.

If a group in gitlab contains another group that contains the repository, then the repository is not found.

Example: MainGroup/SubGroup/MyRepository
And if GLAB_EXPORT_PATHS is only "MainGroup", then "MyRepository" is not found.

(And i am not sure, if GLAB_SERVICE_NAME will be correct=MainGroup/SubGroup/MyRepository).

Additionally a GLAB_TAKE_NAMESPACE_SLUG for servicenames would be helpfull.
If this variable is false, then the servicename should be named by groupnames like "MainGroup/SubGroup/MyRepository" (maybe with spaces, casesensitive ect.)
and if this variable is true, then the servicename-creation should use slug-names for groups ...example: "mgroup/sgroup/myrepository"

Is this possible?
Thanks!

@dpacheconr
Copy link
Contributor

Hi

The GLAB_EXPORT_PATHS is intended to contain the full_path, up to the repository, so in your example you should configure it to MainGroup/SubGroup/ which should then generate GLAB_SERVICE_NAME=MainGroup/SubGroup/MyRepository

Have you tried that?

@magicofit
Copy link
Author

I tested it, and its working!
But now i have a dynamic situation. Everytime when a team is creating a subgroup in our company i have change the GLAB_EXPORT_PATHS-variable.

In our company we have stable 50 toplevel groups but only 27 groups should push infos to NewRelic.
And some groups have up to 5 sub-groups....growing.
But its working somehow with a loong GLAB_EXPORT_PATHS expression.

My second wish to take optionally slug-names instead of "names" of groups would help me to create more readable services. Because some of our subgroups have longer descriptions,specialchars&spaces in the subgroup-name.
This option would be nice. :)

@dpacheconr dpacheconr changed the title Repositories in subgroups are not found FR - GLAB_TAKE_NAMESPACE_SLUG Sep 20, 2023
@dpacheconr
Copy link
Contributor

@magicofit can you provide some examples how you believe that would work?

if I understood correctly if GLAB_TAKE_NAMESPACE_SLUG is set is to myslug, then MainGroup/SubGroup/MyRepository subgroup becomes myslug/MyRepositorysubgroup, but also that would mean that MainGroup/SubGroup0/MyRepositorysub0 will become myslug/MyRepositorysub0, the slug will apply to all groups/subgroups, is this the intentation?

I can't say we will implement this, but I can definitely look at it once we understood exactly what your requirements are

@magicofit
Copy link
Author

Sure.

Right now the Servicesnames in NewRelic are for example:
"Töp Level Group/Secönd Level Group/My Servicename"
or
"Töp Level Group/My Servicename"

And it should be (from my perspective) something like:
"tlg/slg/my-servicename"
or
"tlg/my-servicename"

...with this glab_take_slug-option
gitlab_groups

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants