Skip to content

feat: populate custom fields from Backstage entity annotations#14

Draft
kwent wants to merge 2 commits into
masterfrom
features/backstage-custom-fields-from-annotations
Draft

feat: populate custom fields from Backstage entity annotations#14
kwent wants to merge 2 commits into
masterfrom
features/backstage-custom-fields-from-annotations

Conversation

@kwent
Copy link
Copy Markdown
Member

@kwent kwent commented Jun 2, 2026

Summary

  • Add annotation-to-attribute passthrough for all 4 entity types (services, functionalities, teams, catalog entities)
  • Add annotation-to-catalog-property mapping for services and catalog entities
  • Two new annotation prefixes: rootly.com/<entity>-attr-<key> for API attributes, rootly.com/<entity>-property-<slug> for catalog properties
  • Value coercion: booleans, JSON arrays/objects, plain strings
  • Hardcoded fields (name, backstage_id, etc.) always override passthrough — no control-plane leakage

Example usage

annotations:
  rootly.com/service-attr-color: "#FF5733"
  rootly.com/service-attr-notify_emails: '["alice@co.com","bob@co.com"]'
  rootly.com/service-attr-show_uptime: "true"
  rootly.com/service-property-my-custom-field: "value"

Changes

  • constants.ts — 6 new annotation prefix constants
  • api.tsextractAnnotationEntries, extractPassthroughAttributes, extractProperties functions; integrated into all 8 import/update methods
  • api.test.ts — 17 unit tests

Dependencies

  • Rootly API: requires slug support for catalog_property_id in catalog_fields_support.rb (separate PR)
  • No changes needed in backstage-plugin (frontend) or backstage-plugin-entity-processor (backend) — they pass full entities through

Test plan

  • 17 unit tests for extraction functions (all passing)
  • Integration test: add annotations to test Backstage entity, trigger entity processor sync, verify Rootly service has custom attributes + properties
  • Verify existing sync still works (no regressions on name/description/pagerduty_id)

Ref: PRF-2548

Add support for passing arbitrary attributes and custom catalog properties
to Rootly services, functionalities, teams, and catalog entities from
Backstage entity annotations at sync time.

Two new annotation prefixes per entity type:
- `rootly.com/service-attr-<api_attribute>` passes through to service API
  attributes (color, notify_emails, slack_channels, etc.)
- `rootly.com/service-property-<slug_or_id>` maps to catalog properties
  array on the service

Value coercion: "true"/"false" → boolean, JSON arrays/objects parsed,
everything else stays a string.

Hardcoded fields (name, backstage_id, pagerduty_id) always win over
passthrough — annotations cannot override control-plane attributes.

Ref: PRF-2548
@kwent
Copy link
Copy Markdown
Member Author

kwent commented Jun 2, 2026

@greptileai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant