#Handling group entities with more than one group entity provider

5 messages · Page 1 of 1 (latest)

prisma marsh
#

In our backstage instance we use groups as team representations and the groups are synced from our AD throguh a custom entity provider "ep1".

Unfortunately, in the company I work for the process of creating a group in the AD is a cumbersome and manual so we're trying to smooth this out by automating some of the steps. The groups in the AD are created through a third-party backend service which we call and initiate a "request" to create a group. Once this has been approved there are some background jobs that syncs these groups with the AD.

What we'd like to improve is to enable users to create groups through the backstage UI where users can provide some additional metadata (which we cannot persist in the AD) and then use this backend service to create a "request" for a new group and at the same time create a group entity in backstage that will remain in a "pending" state until the provider "ep1" runs and then tries to merge the data from the catalog with the data from the AD.

I tried to create an additional entity provider "ep2" and expose it through a backend plugin as an API which I then use in the frontend but there are clashes between "ep1" and "ep2" and the final group entity doesn't contain the merged data - instead it gets replaced with data from either "ep1" or "ep2".

The other approach I could think of is to create a separate backend plugin which will have its own database table to store this local state and then when the group provider "ep1" runs it'll fetch this data and use it to enrich the final entity with the metadata provided by the user.
It might be that I am missing something so any help or advice is much appreciated.

craggy canopy
#

The idea is sound, and you can make that work. ep2 can emit entities that have no locationKey set at all, which means they are fine for other providers to overwrite

#

Ideally ep2 should also query AD and only emit things that actually ARE pending, so you don't get perpetual clashing

#

This only solves the use case of wanting to show a placeholder though. If you want to merge information from several systems, it's better to make a more complex ep1 in the first place, which emits the correct set of entities under all circumstances

#

The complexity tends to become less, that way, too