github-org-edited-team-description

Signed-off-by: danyelleac <danyelleacandido@gmail.com>
This commit is contained in:
danyelleac
2023-05-04 16:48:40 -03:00
parent a160e02c3d
commit bd101cefd3
3 changed files with 14 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-github': major
---
Adding description in function 'onTeamEditedInOrganization` in event of team.edited
@@ -834,6 +834,7 @@ describe('GithubOrgEntityProvider', () => {
},
name: 'mygroup-with-spaces',
},
description: 'description-from-the-new-team',
apiVersion: 'backstage.io/v1alpha1',
kind: 'Group',
spec: {
@@ -371,14 +371,21 @@ export class GithubOrgEntityProvider
assignGroupsToUsers(usersToRebuild, groups);
buildOrgHierarchy(groups);
const oldName = event.changes.name?.from || '';
const oldName = event.changes.name?.from || event.team.name;
const oldSlug = oldName.toLowerCase().replaceAll(/\s/gi, '-');
const oldDescription =
event.changes.description?.from || event.team.description;
const oldDescriptionSlug = oldDescription
?.toLowerCase()
.replaceAll(/\s/gi, '-');
const { removed } = createDeltaOperation(org, [
{
...group,
metadata: {
name: oldSlug,
description: oldDescriptionSlug,
},
},
]);