@backstage-community/plugin-codescene
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

codescene

CodeScene is a multi-purpose tool that connects code, businesses, and people. Discover hidden hazards and social trends in your code. Prioritise and minimise technical debt.

The CodeScene Backstage Plugin provides a page component that displays a list of existing projects and associated analysis data on your CodeScene instance.

screenshot

Setup

  1. Install the plugin by running:
# From your Backstage root directory
yarn --cwd packages/app add @backstage-community/plugin-codescene
  1. Add the routes and pages to your App.tsx:
import {
  CodeScenePage,
  CodeSceneProjectDetailsPage,
} from '@backstage-community/plugin-codescene';

...

<Route path="/codescene" element={<CodeScenePage />} />
<Route
    path="/codescene/:projectId"
    element={<CodeSceneProjectDetailsPage />}
/>
  1. Add to the sidebar item routing to the new page:
// In packages/app/src/components/Root/Root.tsx
import { CodeSceneIcon } from '@backstage-community/plugin-codescene';

{
  /* other sidebar items... */
}
<SidebarItem icon={CodeSceneIcon} to="codescene" text="CodeScene" />;
  1. Setup the app-config.yaml codescene proxy and configuration blocks:
proxy:
  '/codescene-api':
    target: '<INSTANCE_HOSTNAME>/api/v1'
    allowedMethods: ['GET']
    allowedHeaders: ['Authorization']
    headers:
      Authorization: Basic ${CODESCENE_AUTH_CREDENTIALS}
codescene:
  baseUrl: https://codescene.my-company.net # replace with your own URL
  1. Adding the codescene plugin to Entity page:
# Add `codescene` annotations to the `catalog-info.yaml` of an entity.
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: backstage
  annotations:
    codescene.io/project-id: <codescene-project-id>
// In packages/app/src/components/catalog/EntityPage.tsx

import {
  CodeSceneEntityPage,
  CodeSceneEntityFileSummary,
  isCodeSceneAvailable,
} from '@backstage-community/plugin-codescene';

/* other EntityLayout.Route items... */

<EntityLayout.Route
  path="/codescene"
  title="codescene"
  if={isCodeSceneAvailable}
>
  <Grid container spacing={3} alignItems="stretch">
    <Grid item md={6}>
      <CodeSceneEntityKPICard />
    </Grid>
    <Grid item md={6}>
      <CodeSceneEntityFileSummary />
    </Grid>
  </Grid>
</EntityLayout.Route>;

/@backstage-community/plugin-codescene/

    Package Sidebar

    Install

    npm i @backstage-community/plugin-codescene

    Homepage

    backstage.io

    Weekly Downloads

    108

    Version

    0.6.0

    License

    Apache-2.0

    Unpacked Size

    129 kB

    Total Files

    41

    Last publish

    Collaborators

    • patriko