fix GitlabOrgDiscoveryEntityProvider.test.ts
Signed-off-by: Matteo Silvestri <matteosilv@gmail.com>
This commit is contained in:
+2
-3
@@ -184,7 +184,6 @@ describe('GitlabOrgDiscoveryEntityProvider', () => {
|
||||
gitlab: {
|
||||
'test-id': {
|
||||
host: 'test-gitlab',
|
||||
group: 'test-group',
|
||||
orgEnabled: true,
|
||||
},
|
||||
},
|
||||
@@ -376,9 +375,9 @@ describe('GitlabOrgDiscoveryEntityProvider', () => {
|
||||
metadata: {
|
||||
annotations: {
|
||||
'backstage.io/managed-by-location':
|
||||
'url:https://test-gitlab/teams/group1-group2',
|
||||
'url:https://test-gitlab/group1/group2',
|
||||
'backstage.io/managed-by-origin-location':
|
||||
'url:https://test-gitlab/teams/group1-group2',
|
||||
'url:https://test-gitlab/group1/group2',
|
||||
'test-gitlab/team-path': 'group1/group2',
|
||||
},
|
||||
description: 'Group2',
|
||||
|
||||
+6
-1
@@ -356,7 +356,12 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider {
|
||||
}
|
||||
|
||||
private groupName(full_path: string): string {
|
||||
return full_path.replace(`${this.config.group}/`, '').replaceAll('/', '-');
|
||||
if (this.config.group && full_path.startsWith(`${this.config.group}/`)) {
|
||||
return full_path
|
||||
.replace(`${this.config.group}/`, '')
|
||||
.replaceAll('/', '-');
|
||||
}
|
||||
return full_path.replaceAll('/', '-');
|
||||
}
|
||||
|
||||
private createGroupEntity(group: GitLabGroup, host: string): GroupEntity {
|
||||
|
||||
Reference in New Issue
Block a user