Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how attribute relations & external IDs work #57

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/aliases-and-external-ids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# External IDs

In your Catalog, entries have an ID, but they also have an external ID. The ID
is a unique reference in our system, generated automatically for each entry,
which cannot be set or changed. If you ever have something (say the
catalog-importer) sync an entry into a type with an external ID, we’ll interpret
that as the same entry as whatever already exists under that external ID.

In practice, this means:
* You can change the name and any attributes: we attach these to either the
external ID or the ID of the entry (whichever is available) and any renames
will transparently apply to custom field values and anywhere else the entry
was used.
* If you happen to delete an entry but then try recreating it with the same
external ID, we’ll bring back the archived entry so you preserve any old
references such as incident custom field values.

# Aliases

The aliases are just about how you might reference a catalog entry via an
attribute on some other entry.

Say you have a team catalog type with a “Slack group” attribute which is of type
“SlackUserGroup”. You could set that value of that attribute to either:
* The ID of the Slack user group catalog entry (e.g. 01H4GFQPTNGNF0FFEGX2BT8811)
* The external ID of the Slack user group catalog entry (e.g. S043VBNSBC3)
* Or any of the aliases (e.g. my-user-group-handle)

Then when you view that team entry in the dashboard or try navigating to its
Slack group attribute, we’ll follow the above rules to find you the match.

Aliases are *only* used for this matching, and nothing else, so:
* They don't show up when you're searching for a catalog entry, either in the
catalog or to assign it to a custom field
* They can't be edited via the Dashboard UI, only via the API, catalog-importer,
or Terraform.
4 changes: 3 additions & 1 deletion docs/outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ The `source` config for the output:
- And similar that `external_id` should come from the `external_id` field.

It's worth reading our guide on [expressions](expressions.md) to understand the
syntax and what is possible in these fields.
syntax and what is possible in these fields, and our guide on [external IDs and
aliases](aliases-and-external-ids.md) to understand how these special fields
work.

The Backstage API Type (the catalog type we're creating for this output) will be
given a single attribute:
Expand Down
Loading