extend filter logic to include parent group
Signed-off-by: Hghtwr <johannes.sonner@outlook.com>
This commit is contained in:
@@ -2347,7 +2347,7 @@ export const expected_full_members_group_org_scan_entities: MockObject[] = [
|
||||
name: 'JohnDoe',
|
||||
},
|
||||
spec: {
|
||||
memberOf: ['subgroup1'],
|
||||
memberOf: ['group1', 'subgroup1'], // since #26554 also config.group needs to be here.
|
||||
profile: {
|
||||
displayName: 'John Doe',
|
||||
email: 'john.doe@company.com',
|
||||
@@ -2431,6 +2431,29 @@ export const expected_full_members_group_org_scan_entities: MockObject[] = [
|
||||
},
|
||||
locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id',
|
||||
},
|
||||
{
|
||||
entity: {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'Group',
|
||||
metadata: {
|
||||
annotations: {
|
||||
'backstage.io/managed-by-location': 'url:https://example.com/group1',
|
||||
'backstage.io/managed-by-origin-location':
|
||||
'url:https://example.com/group1',
|
||||
'example.com/team-path': 'group1',
|
||||
},
|
||||
name: 'group1',
|
||||
},
|
||||
spec: {
|
||||
children: [],
|
||||
profile: {
|
||||
displayName: 'group1',
|
||||
},
|
||||
type: 'team',
|
||||
},
|
||||
},
|
||||
locationKey: 'GitlabOrgDiscoveryEntityProvider:test-id',
|
||||
},
|
||||
{
|
||||
entity: {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
|
||||
+2
-1
@@ -775,7 +775,8 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider {
|
||||
return (
|
||||
this.config.groupPattern.test(group.full_path) &&
|
||||
(!this.config.group ||
|
||||
group.full_path.startsWith(`${this.config.group}/`))
|
||||
group.full_path.startsWith(`${this.config.group}/`) ||
|
||||
group.full_path === this.config.group)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user