catalog-backend: ignore relations when comparing entities
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/catalog-model': patch
|
||||
---
|
||||
|
||||
Ignore relations when comparing entities. This stops the refresh loop from rewriting entities over and over.
|
||||
@@ -46,6 +46,10 @@ export function generateEntityEtag(): string {
|
||||
* are added or existing annotations were changed (since they are effectively
|
||||
* merged when doing updates).
|
||||
*
|
||||
* Note that this comparison does NOT take state, relations or similar into
|
||||
* account. It only compares the actual input entity data, i.e. metadata and
|
||||
* spec.
|
||||
*
|
||||
* @param previous The old state of the entity
|
||||
* @param next The new state of the entity
|
||||
*/
|
||||
@@ -76,6 +80,10 @@ export function entityHasChanges(previous: Entity, next: Entity): boolean {
|
||||
delete e1.metadata.annotations;
|
||||
delete e2.metadata.annotations;
|
||||
|
||||
// Remove things that we explicitly do not compare
|
||||
delete e1.relations;
|
||||
delete e2.relations;
|
||||
|
||||
return !lodash.isEqual(e1, e2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user