diff --git a/plugins/catalog-backend-module-gitlab/package.json b/plugins/catalog-backend-module-gitlab/package.json index d81db51117..302126e015 100644 --- a/plugins/catalog-backend-module-gitlab/package.json +++ b/plugins/catalog-backend-module-gitlab/package.json @@ -71,7 +71,10 @@ "@backstage/catalog-model": "workspace:^", "@backstage/config": "workspace:^", "@backstage/integration": "workspace:^", + "@backstage/plugin-catalog-common": "workspace:^", "@backstage/plugin-catalog-node": "workspace:^", + "@backstage/plugin-events-node": "workspace:^", + "@gitbeaker/rest": "^39.34.3", "lodash": "^4.17.21", "node-fetch": "^2.6.7", "uuid": "^9.0.0" @@ -79,6 +82,7 @@ "devDependencies": { "@backstage/backend-test-utils": "workspace:^", "@backstage/cli": "workspace:^", + "@backstage/plugin-events-backend-test-utils": "workspace:^", "@types/lodash": "^4.14.151", "@types/uuid": "^9.0.0", "luxon": "^3.0.0", diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts index aba888aea1..30105dcc1f 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabOrgDiscoveryEntityProvider.ts @@ -626,7 +626,7 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { ); } - let user: GitLabUser | undefined; + let user: GitLabUser; if (event.event_name === 'user_destroy') { user = { id: event.user_id, @@ -705,19 +705,6 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider { relations, ); - // if (groupMembers.items.length !== 0) { - // groupMembers.items.forEach(element => { - // if ( - // event.event_name === 'user_remove_from_group' && - // element.username === event.user_username - // ) { - // return; - // } - - // usersToBeAdded.push(element.username); - // }); - // } - // new members of the group const usersToBeAdded = event.event_name === 'user_remove_from_group' diff --git a/yarn.lock b/yarn.lock index 78162415e2..2e56066685 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5598,7 +5598,11 @@ __metadata: "@backstage/cli": "workspace:^" "@backstage/config": "workspace:^" "@backstage/integration": "workspace:^" + "@backstage/plugin-catalog-common": "workspace:^" "@backstage/plugin-catalog-node": "workspace:^" + "@backstage/plugin-events-backend-test-utils": "workspace:^" + "@backstage/plugin-events-node": "workspace:^" + "@gitbeaker/rest": ^39.34.3 "@types/lodash": ^4.14.151 "@types/uuid": ^9.0.0 lodash: ^4.17.21 @@ -11348,7 +11352,7 @@ __metadata: languageName: node linkType: hard -"@gitbeaker/rest@npm:^39.25.0": +"@gitbeaker/rest@npm:^39.25.0, @gitbeaker/rest@npm:^39.34.3": version: 39.34.3 resolution: "@gitbeaker/rest@npm:39.34.3" dependencies: