Feat/gh issues forallkinds#7941
Conversation
Changed Packages
|
|
Thanks for the contribution! |
Signed-off-by: Patrik Švikruha <patrik.svikruha.dev@gmail.com>
…inds Signed-off-by: Patrik Švikruha <patrik.svikruha.dev@gmail.com>
Signed-off-by: Patrik Švikruha <patrik.svikruha.dev@gmail.com>
52c4552 to
12300c1
Compare
| }); | ||
| const repositoryEntities: Repository[] = []; | ||
| // For Group and User entities fetch owned components and retrieve all issues | ||
| if (entity.kind === 'Group' || entity.kind === 'User') { |
There was a problem hiding this comment.
I'm thinking, what if we remove the if else and execute the two operations regardless?
something like this:
const repositoryEntities = (await catalogApi.getEntities({
filter: {
'relations.ownedBy': stringifyEntityRef(entity),
},
}).map(blablabla);
const entityName = getProjectNameFromEntity(entity);
const locationHostname = getHostnameFromEntity(entity);
if (entityName) {
repositoryEntities.push({
name: entityName,
locationHostname,
});
}Or is the check Component/API vs Group/User needed for some reason?
There was a problem hiding this comment.
Current logic is:
If User/Group View, get all Entities that have relation ownedBy to User/Group* and get all repositories (based on https://backstage.io/docs/features/software-catalog/well-known-annotations/#githubcomteam-slug annotation.)
For all other kinds, just extract https://backstage.io/docs/features/software-catalog/well-known-annotations/#githubcomteam-slug. For other types does not make sense to search for ownedBy relation as is related only to Group and User
*for now it works only for Group and User - it does not solve transitive dependency => User is part of Group that owns Entity) => this could be also enhanced as User view show on card all transitive (Groups) "ownedBy" entities.
* feat: add support for all kinds Signed-off-by: Patrik Švikruha <patrik.svikruha.dev@gmail.com> * doc: enhance README to clarify plugin behavior for different Entity kinds Signed-off-by: Patrik Švikruha <patrik.svikruha.dev@gmail.com> * chore: add changelog Signed-off-by: Patrik Švikruha <patrik.svikruha.dev@gmail.com> --------- Signed-off-by: Patrik Švikruha <patrik.svikruha.dev@gmail.com> Co-authored-by: Patrik Švikruha <patrik.svikruha.dev@gmail.com> Signed-off-by: Emiel van Lankveld <evanlankveld@bol.com>

Hey, I just made a Pull Request!
✔️ Checklist
Signed-off-byline in the message. (more info)#7462