🚀 Feature: Add possibility to discover archived projects with `catalog-backend-module-gitlab`
🔖 Feature description
I'd love to have a possibility to discover archived projects as well as the active ones. I think it should work analogically to skipArchivedRepos in Bitbucket Server Discovery.
🎤 Context
This feature should be implemented, as there is currently no control over discovering archived projects. This would be helpful for organizational purposes, allowing you to see which elements are no longer in use (for example, by editing the entity with a custom postProcessEntity implementation).
✌️ Possible Implementation
- Extend
GitlabProviderConfigtype inplugins/catalog-backend-module-gitlab/src/lib/types.ts - Add
trueas the default value if property missing in config -plugins/catalog-backend-module-gitlab/src/lib/types.ts - Update the
refreshmethod inplugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.tsfrom:
const projects = paginated<GitLabProject>(options => this.gitLabClient.listProjects(options), {
archived: false,
group: this.config.group,
page: 1,
per_page: 50,
});
to:
const projects = paginated<GitLabProject>(options => this.gitLabClient.listProjects(options), {
...(this.config.skipArchivedRepos && { archived: false }),
group: this.config.group,
page: 1,
per_page: 50,
});
👀 Have you spent some time to check if this feature request has been raised before?
- [X] I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
Are you willing to submit PR?
Yes I am willing to submit a PR!
### Tasks
Yep, sounds good, please go ahead! 👍
I think we want to keep archived repos excluded by default, so the actual config should probably be something like includeArchivedRepos: true, just because it's more intuitive to have the default value be false.
@Rugvip thanks for your comment! I just created a PR -> https://github.com/backstage/backstage/pull/27245.
This is already implemented and released.