Skip to content

Commit b446411

Browse files
authored
Merge pull request #34 from rootlyhq/fix/entity-kind-guard
[bug]: Fix Entity Kind Guard
2 parents c89cdc8 + 6ce016b commit b446411

7 files changed

Lines changed: 14 additions & 7 deletions

File tree

.yarn/install-state.gz

6.86 KB
Binary file not shown.

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @rootly/backstage-plugin-entity-processor
22

3+
## 1.3.1
4+
5+
- Add entity kind guards to prevent wrong-kind annotations from corrupting Rootly resources
6+
- `rootly.com/team-id` and `rootly.com/team-slug` annotations are now only processed for `kind: Group` entities
7+
- `rootly.com/service-id` and `rootly.com/service-slug` annotations are now only processed for `kind: Component` entities
8+
- Pre-existing wrong-kind annotations (e.g. a Component carrying `rootly.com/team-slug`) become silent no-ops after upgrading
9+
310
## 1.3.0
411

512
- Add catalog entity processing support

dist/module.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/processor/RootlyEntityProcessor.cjs.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/processor/RootlyEntityProcessor.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@rootly/backstage-plugin-entity-processor",
33
"description": "Rootly Catalog processor Backstage",
4-
"version": "1.3.0",
4+
"version": "1.3.1",
55
"main": "dist/index.cjs.js",
66
"types": "dist/index.d.ts",
77
"license": "MIT",

src/processor/RootlyEntityProcessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export class RootlyEntityProcessor implements CatalogProcessor {
176176
config: this.config,
177177
organizationId: organizationId,
178178
});
179-
if (this.serviceIdAnnotations(entity)) {
179+
if (this.serviceIdAnnotations(entity) && entity.kind === 'Component') {
180180
return this.processRootlyService(
181181
rootlyClient,
182182
organizationId,
@@ -192,7 +192,7 @@ export class RootlyEntityProcessor implements CatalogProcessor {
192192
location,
193193
emit,
194194
);
195-
} else if (this.teamIdAnnotations(entity)) {
195+
} else if (this.teamIdAnnotations(entity) && entity.kind === 'Group') {
196196
return this.processRootlyTeam(
197197
rootlyClient,
198198
organizationId,

0 commit comments

Comments
 (0)