github backstage/backstage release-2021-04-08

latest releases: v1.26.4, v1.27.0-next.0, v1.26.3...
3 years ago

@backstage/config-loader@0.6.0

Minor Changes

  • 82c66b8cd: Fix bug where ${...} was not being escaped to ${...}

    Add support for environment variable substitution in $include, $file and
    $env transform values.

    • This change allows for including dynamic paths, such as environment specific
      secrets by using the same environment variable substitution (${..}) already
      supported outside of the various include transforms.
    • If you are currently using the syntax ${...} in your include transform values,
      you will need to escape the substitution by using ${...} instead to maintain
      the same behavior.

## @backstage/plugin-badges@0.2.0

Minor Changes

  • d0b4ebf22: Support auth in badge plugin

Patch Changes

  • Updated dependencies [1279a3325]
  • Updated dependencies [4a4681b1b]
  • Updated dependencies [97b60de98]
  • Updated dependencies [b051e770c]
  • Updated dependencies [98dd5da71]
    • @backstage/core@0.7.4
    • @backstage/catalog-model@0.7.6

## @backstage/backend-common@0.6.2

Patch Changes

  • b779b5fee: Add UrlReader for Google Cloud Storage
  • Updated dependencies [82c66b8cd]
    • @backstage/config-loader@0.6.0

## @backstage/catalog-model@0.7.6

Patch Changes

  • 97b60de98: Added stringifyEntityRef, which always creates a string representation of an entity reference. Also deprecated serializeEntityRef, as stringifyEntityRef should be used instead.
  • 98dd5da71: Add support for multiple links to post-scaffold task summary page

## @backstage/cli@0.6.7

Patch Changes

  • Updated dependencies [82c66b8cd]
    • @backstage/config-loader@0.6.0

## @backstage/core@0.7.4

Patch Changes

  • 1279a3325: Introduce a load-chunk step in the BootErrorPage to show make chunk loading
    errors visible to the user.
  • 4a4681b1b: Improved error messaging for routable extension errors, making it easier to identify the component and mount point that caused the error.
  • b051e770c: Fixed a bug with useRouteRef where navigating from routes beneath a mount point would often fail.
  • 98dd5da71: Add support for multiple links to post-scaffold task summary page
  • Updated dependencies [1279a3325]
  • Updated dependencies [4a4681b1b]
  • Updated dependencies [b051e770c]
    • @backstage/core-api@0.2.16

## @backstage/core-api@0.2.16

Patch Changes

  • 1279a3325: Introduce a load-chunk step in the BootErrorPage to show make chunk loading
    errors visible to the user.
  • 4a4681b1b: Improved error messaging for routable extension errors, making it easier to identify the component and mount point that caused the error.
  • b051e770c: Fixed a bug with useRouteRef where navigating from routes beneath a mount point would often fail.

## @backstage/create-app@0.3.17

Patch Changes

  • 3e7de08af: Fully migrated the template to the new composability API

    The create-app template is now fully migrated to the new composability API, see Composability System Migration Documentation for explanations and more details. The final change which is now done was to migrate the EntityPage from being a component built on top of the EntityPageLayout and several more custom components, to an element tree built with EntitySwitch and EntityLayout.

    To apply this change to an existing plugin, it is important that all plugins that you are using have already been migrated. In this case the most crucial piece is that no entity page cards of contents may require the entity prop, and they must instead consume the entity from context using useEntity.

    Since this change is large with a lot of repeated changes, we'll describe a couple of common cases rather than the entire change. If your entity pages are unchanged from the create-app template, you can also just bring in the latest version directly from the template itself.

    The first step of the change is to change the packages/app/src/components/catalog/EntityPage.tsx export to entityPage rather than EntityPage. This will require an update to App.tsx, which is the only change we need to do outside of EntityPage.tsx:

    ```diff
    -import { EntityPage } from './components/catalog/EntityPage';
    +import { entityPage } from './components/catalog/EntityPage';

    }


    • {entityPage}

      The rest of the changes happen within `EntityPage.tsx`, and can be split into two broad categories, updating page components, and updating switch components. #### Migrating Page Components Let's start with an example of migrating a user page component. The following is the old code in the template: tsx
      const UserOverviewContent = ({ entity }: { entity: UserEntity }) => (








      );
      const UserEntityPage = ({ entity }: { entity: Entity }) => (

      }
      />

      );
      ```

    There's the main UserEntityPage component, and the UserOverviewContent component. Let's start with migrating the page contents, which we do by rendering an element rather than creating a component, as well as replace the cards with their new composability compatible variants. The new cards and content components can be identified by the Entity prefix.

    const userOverviewContent = (
      <Grid container spacing={3}>
        <Grid item xs={12} md={6}>
          <EntityUserProfileCard variant="gridItem" />
        </Grid>
        <Grid item xs={12} md={6}>
          <EntityOwnershipCard variant="gridItem" />
        </Grid>
      </Grid>
    );
    

    Now let's migrate the page component, again by converting it into a rendered element instead of a component, as well as replacing the use of EntityPageLayout with EntityLayout.

    const userPage = (
      <EntityLayout>
        <EntityLayout.Route path="/" title="Overview">
          {userOverviewContent}
        </EntityLayout.Route>
      </EntityLayout>
    );
    

    At this point the userPage is quite small, so throughout this migration we have inlined the page contents for all pages. This is an optional step, but may help reduce noise. The final page now looks like this:

    const userPage = (
      <EntityLayout>
        <EntityLayout.Route path="/" title="Overview">
          <Grid container spacing={3}>
            <Grid item xs={12} md={6}>
              <EntityUserProfileCard variant="gridItem" />
            </Grid>
            <Grid item xs={12} md={6}>
              <EntityOwnershipCard variant="gridItem" />
            </Grid>
          </Grid>
        </EntityLayout.Route>
      </EntityLayout>
    );
    

    Migrating Switch Components

    Switch components were used to select what entity page components or cards to render, based on for example the kind of entity. For this example we'll focus on the root EntityPage switch component, but the process is the same for example for the CI/CD switcher.
    The old EntityPage looked like this:

    export const EntityPage = () => {
      const { entity } = useEntity();
      switch (entity?.kind?.toLocaleLowerCase('en-US')) {
        case 'component':
          return <ComponentEntityPage entity={entity} />;
        case 'api':
          return <ApiEntityPage entity={entity} />;
        case 'group':
          return <GroupEntityPage entity={entity} />;
        case 'user':
          return <UserEntityPage entity={entity} />;
        case 'system':
          return <SystemEntityPage entity={entity} />;
        case 'domain':
          return <DomainEntityPage entity={entity} />;
        case 'location':
        case 'resource':
        case 'template':
        default:
          return <DefaultEntityPage entity={entity} />;
      }
    };
    

    In order to migrate to the composability API, we need to make this an element instead of a component, which means we're unable to keep the switch statement as is. To help with this, the catalog plugin provides an EntitySwitch component, which functions similar to a regular switch statement, which the first match being the one that is rendered. The catalog plugin also provides a number of built-in filter functions to use, such as isKind and isComponentType.

    To migrate the EntityPage, we convert the switch statement into an EntitySwitch element, and each case statement into an EntitySwitch.Case element. We also move over to use our new element version of the page components, with the result looking like this:

    export const entityPage = (
      <EntitySwitch>
        <EntitySwitch.Case if={isKind('component')} children={componentPage} />
        <EntitySwitch.Case if={isKind('api')} children={apiPage} />
        <EntitySwitch.Case if={isKind('group')} children={groupPage} />
        <EntitySwitch.Case if={isKind('user')} children={userPage} />
        <EntitySwitch.Case if={isKind('system')} children={systemPage} />
        <EntitySwitch.Case if={isKind('domain')} children={domainPage} />
    
    
        <EntitySwitch.Case>{defaultEntityPage}</EntitySwitch.Case>
      </EntitySwitch>
    );
    

    Another example is the ComponentEntityPage, which is migrated from this:

    export const ComponentEntityPage = ({ entity }: { entity: Entity }) => {
      switch (entity?.spec?.type) {
        case 'service':
          return <ServiceEntityPage entity={entity} />;
        case 'website':
          return <WebsiteEntityPage entity={entity} />;
        default:
          return <DefaultEntityPage entity={entity} />;
      }
    };
    

    To this:

    const componentPage = (
      <EntitySwitch>
        <EntitySwitch.Case if={isComponentType('service')}>
          {serviceEntityPage}
        </EntitySwitch.Case>
    
    
        <EntitySwitch.Case if={isComponentType('website')}>
          {websiteEntityPage}
        </EntitySwitch.Case>
    
    
        <EntitySwitch.Case>{defaultEntityPage}</EntitySwitch.Case>
      </EntitySwitch>
    );
    

    Note that if you want to conditionally render some piece of content, you can omit the default EntitySwitch.Case. If no case is matched in an EntitySwitch, nothing will be rendered.

    • Updated dependencies [802b41b65]

    • Updated dependencies [2b2b31186]

    • Updated dependencies [1279a3325]

    • Updated dependencies [4a4681b1b]

    • Updated dependencies [97b60de98]

    • Updated dependencies [3f96a9d5a]

    • Updated dependencies [b051e770c]

    • Updated dependencies [f9c75f7a9]

    • Updated dependencies [ae6250ce3]

    • Updated dependencies [98dd5da71]

    • Updated dependencies [b779b5fee]

    • @backstage/plugin-scaffolder-backend@0.9.5

    • @backstage/plugin-auth-backend@0.3.8

    • @backstage/core@0.7.4

    • @backstage/catalog-model@0.7.6

    • @backstage/plugin-scaffolder@0.8.2

    • @backstage/plugin-catalog-import@0.5.2

    • @backstage/test-utils@0.1.10

    • @backstage/plugin-catalog@0.5.3

    • @backstage/backend-common@0.6.2

    • @backstage/cli@0.6.7

    • @backstage/plugin-app-backend@0.3.11

      @backstage/test-utils@0.1.10

      Patch Changes

    • ae6250ce3: Remove unnecessary wrapping of elements rendered by wrapInTestApp and renderInTestApp, which was breaking mount discovery.

    • Updated dependencies [1279a3325]

    • Updated dependencies [4a4681b1b]

    • Updated dependencies [b051e770c]

    • @backstage/core-api@0.2.16

      @backstage/plugin-app-backend@0.3.11

      Patch Changes

    • Updated dependencies [82c66b8cd]

    • Updated dependencies [b779b5fee]

    • @backstage/config-loader@0.6.0

    • @backstage/backend-common@0.6.2

      @backstage/plugin-auth-backend@0.3.8

      Patch Changes

    • 2b2b31186: When using OAuth2 authentication the name is now taken from the name property of the JWT instead of the email property

    • Updated dependencies [97b60de98]

    • Updated dependencies [ae6250ce3]

    • Updated dependencies [98dd5da71]

    • Updated dependencies [b779b5fee]

    • @backstage/catalog-model@0.7.6

    • @backstage/test-utils@0.1.10

    • @backstage/backend-common@0.6.2

      @backstage/plugin-badges-backend@0.1.2

      Patch Changes

    • d0b4ebf22: Support auth in badge plugin

    • Updated dependencies [97b60de98]

    • Updated dependencies [98dd5da71]

    • Updated dependencies [b779b5fee]

    • @backstage/catalog-model@0.7.6

    • @backstage/backend-common@0.6.2

      @backstage/plugin-catalog@0.5.3

      Patch Changes

    • 98dd5da71: Add support for multiple links to post-scaffold task summary page

    • Updated dependencies [1279a3325]

    • Updated dependencies [4a4681b1b]

    • Updated dependencies [97b60de98]

    • Updated dependencies [b051e770c]

    • Updated dependencies [98dd5da71]

    • @backstage/core@0.7.4

    • @backstage/catalog-model@0.7.6

      @backstage/plugin-catalog-import@0.5.2

      Patch Changes

    • f9c75f7a9: When importing components you will now have the ability to use non Unicode characters in the entity owner field

    • Updated dependencies [1279a3325]

    • Updated dependencies [4a4681b1b]

    • Updated dependencies [97b60de98]

    • Updated dependencies [b051e770c]

    • Updated dependencies [98dd5da71]

    • @backstage/core@0.7.4

    • @backstage/catalog-model@0.7.6

      @backstage/plugin-github-deployments@0.1.2

      Patch Changes

    • 64d2ce700: Add a button to reload the GitHub Deployments card

    • Updated dependencies [1279a3325]

    • Updated dependencies [4a4681b1b]

    • Updated dependencies [97b60de98]

    • Updated dependencies [b051e770c]

    • Updated dependencies [98dd5da71]

    • @backstage/core@0.7.4

    • @backstage/catalog-model@0.7.6

      @backstage/plugin-org@0.3.12

      Patch Changes

    • 97d53f686: Optimize data fetched for the OwnershipCard.

    • Updated dependencies [1279a3325]

    • Updated dependencies [4a4681b1b]

    • Updated dependencies [97b60de98]

    • Updated dependencies [b051e770c]

    • Updated dependencies [98dd5da71]

    • @backstage/core@0.7.4

    • @backstage/core-api@0.2.16

    • @backstage/catalog-model@0.7.6

      @backstage/plugin-scaffolder@0.8.2

      Patch Changes

    • 3f96a9d5a: Support auth by sending cookies in event stream request

    • 98dd5da71: Add support for multiple links to post-scaffold task summary page

    • Updated dependencies [1279a3325]

    • Updated dependencies [4a4681b1b]

    • Updated dependencies [97b60de98]

    • Updated dependencies [b051e770c]

    • Updated dependencies [98dd5da71]

    • @backstage/core@0.7.4

    • @backstage/catalog-model@0.7.6

      @backstage/plugin-scaffolder-backend@0.9.5

      Patch Changes

    • 802b41b65: Allow custom directory to be specified for GitHub publish action

    • Updated dependencies [97b60de98]

    • Updated dependencies [98dd5da71]

    • Updated dependencies [b779b5fee]

    • @backstage/catalog-model@0.7.6

    • @backstage/backend-common@0.6.2

      example-app@0.2.23

      Patch Changes

    • Updated dependencies [d0b4ebf22]

    • Updated dependencies [1279a3325]

    • Updated dependencies [4a4681b1b]

    • Updated dependencies [97b60de98]

    • Updated dependencies [3f96a9d5a]

    • Updated dependencies [b051e770c]

    • Updated dependencies [f9c75f7a9]

    • Updated dependencies [98dd5da71]

    • Updated dependencies [97d53f686]

    • Updated dependencies [64d2ce700]

    • @backstage/plugin-badges@0.2.0

    • @backstage/core@0.7.4

    • @backstage/catalog-model@0.7.6

    • @backstage/plugin-scaffolder@0.8.2

    • @backstage/plugin-catalog-import@0.5.2

    • @backstage/plugin-catalog@0.5.3

    • @backstage/plugin-org@0.3.12

    • @backstage/plugin-github-deployments@0.1.2

    • @backstage/cli@0.6.7

Don't miss a new backstage release

NewReleases is sending notifications on new releases.