Onboarding Software to Backstage

45 MINS

Removing the example entities

In your Backstage app, you may have noticed some software entities already in the catalog. These are sample entities included so that starting up an app is not an empty experience the first time, but we can remove them in favor of your own software components.

These sample entities come from the app-config.yaml file at the root of your Backstage app. By default, there are several locations under the catalog key:

<span class="line"><span style="color:#85E89D">catalog</span><span style="color:#E1E4E8">:</span></span>
<span class="line"><span style="color:#85E89D">  import</span><span style="color:#E1E4E8">:</span></span>
<span class="line"><span style="color:#85E89D">    entityFilename</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">catalog-info.yaml</span></span>
<span class="line"><span style="color:#85E89D">    pullRequestBranchName</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">backstage-integration</span></span>
<span class="line"><span style="color:#85E89D">  rules</span><span style="color:#E1E4E8">:</span></span>
<span class="line"><span style="color:#E1E4E8">    - </span><span style="color:#85E89D">allow</span><span style="color:#E1E4E8">: [</span><span style="color:#9ECBFF">Component</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">System</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">API</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">Resource</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">Location</span><span style="color:#E1E4E8">]</span></span>
<span class="line"><span style="color:#85E89D"> locations</span><span style="color:#E1E4E8">:</span></span>
<span class="line"><span style="color:#6A737D">    # Local example data, file locations are relative to the backend process, typically `packages/backend`</span></span>
<span class="line"><span style="color:#E1E4E8">    - </span><span style="color:#85E89D">type</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">file</span></span>
<span class="line"><span style="color:#85E89D">      target</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">../../examples/entities.yaml</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D">    # Local example template</span></span>
<span class="line"><span style="color:#E1E4E8">    - </span><span style="color:#85E89D">type</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">file</span></span>
<span class="line"><span style="color:#85E89D">      target</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">../../examples/template/template.yaml</span></span>
<span class="line"><span style="color:#85E89D">      rules</span><span style="color:#E1E4E8">:</span></span>
<span class="line"><span style="color:#E1E4E8">        - </span><span style="color:#85E89D">allow</span><span style="color:#E1E4E8">: [</span><span style="color:#9ECBFF">Template</span><span style="color:#E1E4E8">]</span></span>
<span class="line"></span>

Here you can see the metadata concept more concretely. The catalog.locations configuration is a list of locations (URLs or paths to files) that point to metadata files. You can set the type field to either file or url. In case of a URL location, if you paste those URLs into your browser, you can see the metadata definitions themselves. Many of the example entities are a Location kind, which point in turn to other metadata files for the catalog to discover.

Listing locations explicitly in app-config.yaml is convenient for demonstration purposes (or local development), but this isn’t an ideal setup for production; you don’t want every engineer in your organization to modify this configuration just to have their software tracked in the catalog.

So for now, delete the entire locations block so that the catalog config looks like this:

<span class="line"><span style="color:#85E89D">catalog</span><span style="color:#E1E4E8">:</span></span>
<span class="line"><span style="color:#85E89D">  rules</span><span style="color:#E1E4E8">:</span></span>
<span class="line"><span style="color:#E1E4E8">    - </span><span style="color:#85E89D">allow</span><span style="color:#E1E4E8">: [</span><span style="color:#9ECBFF">Component</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">System</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">API</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">Resource</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">Location</span><span style="color:#E1E4E8">]</span></span>
<span class="line"></span>

Save the file and reload your Backstage instance in your browser. You should see an empty catalog.

Onboarding Software to Backstage | Spotify for Backstage