-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Gitlab Discovery Processor should automatically add the project-id if not present in catalog-info.yaml / backstage.yaml #13118
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
If I understand the situation correctly, the discovery processor does have knowledge of what the project ID is, but later down the line when the If so, then yeah, something needs to be added that lets this contextual information be passed down through the layers. Not sure what the best solution would be, off the top of my head, but suggestions are welcome. |
For context, I see this comment in the discovery processor:
|
This is how the code then fetches the project ID based on the URL where the file is stored:
This is something that anybody can do at a later time, for example a processor that fills in these IDs in annotations in a pre-processing step. Unfortunately that would lead to more API hammering of your GitLab instance - but the calls could be heavily cached, so maybe that actually can be sidestepped to a large degree. To be clear, the UrlReader can't have this type of knowledge, since it's way more low level and should not modify data. |
A solution that currently works very well with the backstage-plugin-gitlab plugin is using 'gitlab.com/project-slug' instead of 'gitlab.com/project-id'. After adding the AnnotateScmSlugEntityProcessor to your catalog configuration like this
the project-slug annotation is automatically added for all entities originating from a GitLab repository. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Feature Suggestion
The
@loblaw-sre/backstage-plugin-gitlab
depends on the gitlab project-id to be added to the entity in a specific location. It would be great if the discovery processor could automatically populate that id into that location so that users don't have to specify it in their yaml files. If the user does specify a project-id in the yaml file, the plugin could skip the attempt to populate it so that it doesn't override the value set by the user.Possible Implementation
I don't have context into the discovery processor to provide implementation suggestions, but I know there might be alternatives to the gitlab discovery processor to populate those entities, and it would be great if this same feature could be implemented by them as well.
I believe these changes would live in this plugin:
@backstage/plugin-catalog-backend-module-gitlab
Context
The text was updated successfully, but these errors were encountered: