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

681 integrate backstage readme plugin #690

Closed
wants to merge 14 commits into from
Closed
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
8 changes: 4 additions & 4 deletions .github/workflows/code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected].4
uses: actions/[email protected].6

- name: Set node
uses: actions/[email protected]
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected].4
uses: actions/[email protected].6

- name: Set node
uses: actions/[email protected]
Expand Down Expand Up @@ -78,14 +78,14 @@ jobs:
packages: write
steps:
- name: Checkout
uses: actions/[email protected].4
uses: actions/[email protected].6

- name: Generate Image Name
run: echo IMAGE_REPOSITORY=ghcr.io/$(tr '[:upper:]' '[:lower:]' <<< "${{ github.repository }}")-${{ matrix.target }} >> $GITHUB_ENV

- name: Log in to GitHub Docker Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devcontainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected].4
uses: actions/[email protected].6

- name: Set up Docker Buildx
uses: docker/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
# Need this to get version number from last tag
fetch-depth: 0
Expand All @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
# Need this to get version number from last tag
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
fetch-depth: 0

Expand Down
3 changes: 2 additions & 1 deletion backstage/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"cy:run": "cypress run --browser chrome"
},
"dependencies": {
"@axis-backstage/plugin-readme": "^0.7.1",
"@backstage/app-defaults": "^1.4.5",
"@backstage/catalog-model": "^1.4.3",
"@backstage/cli": "^0.26.2",
Expand All @@ -29,7 +30,7 @@
"@backstage/plugin-catalog": "^1.15.1",
"@backstage/plugin-catalog-common": "^1.0.18",
"@backstage/plugin-catalog-graph": "^0.4.0",
"@backstage/plugin-catalog-import": "^0.10.3",
"@backstage/plugin-catalog-import": "^0.11.0",
"@backstage/plugin-catalog-react": "^1.9.1",
"@backstage/plugin-github-actions": "^0.6.8",
"@backstage/plugin-home": "^0.7.2",
Expand Down
19 changes: 14 additions & 5 deletions backstage/packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import {
import { Button, Grid } from '@material-ui/core';
import React from 'react';
import { EntityAboutCard } from '../AboutCard/AboutCard';
import { ReadmeCard } from '@axis-backstage/plugin-readme';

const TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref';
const ANNOTATIONS_DOCS_URL =
Expand Down Expand Up @@ -147,17 +148,25 @@ const entityWarningContent = (
const overviewContent = (
<Grid container spacing={3} alignItems="stretch">
{entityWarningContent}
<Grid item md={6}>

{/* Top Row - Main Information Cards */}
<Grid item xs={12} md={8}>
<EntityAboutCard variant="gridItem" />
</Grid>
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
<Grid item xs={12} md={4}>
<ReadmeCard />
</Grid>

<Grid item md={4} xs={12}>
{/* Middle Row - Graph and Links */}
<Grid item xs={12} md={6}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
<Grid item xs={12} md={6}>
<EntityLinksCard />
</Grid>
<Grid item md={8} xs={12}>

{/* Bottom Row - Subcomponents and any additional details */}
<Grid item xs={12} md={12}>
<EntityHasSubcomponentsCard variant="gridItem" />
</Grid>
</Grid>
Expand Down
7 changes: 4 additions & 3 deletions backstage/packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"build-image": "docker build ../.. -f Dockerfile --tag backstage"
},
"dependencies": {
"@backstage/backend-common": "^0.21.2",
"@axis-backstage/plugin-readme-backend": "^0.6.0",
"@backstage/backend-common": "^0.22.0",
"@backstage/backend-tasks": "^0.5.12",
"@backstage/catalog-client": "^1.4.6",
"@backstage/catalog-model": "^1.4.3",
Expand All @@ -39,7 +40,7 @@
"@backstage/plugin-techdocs-backend": "^1.9.0",
"@diamondlightsource/plugin-scaffolder-backend-module-copier": "^0.3.4",
"@immobiliarelabs/backstage-plugin-gitlab-backend": "^6.0.0",
"better-sqlite3": "^9.0.0",
"better-sqlite3": "^11.0.0",
"dockerode": "^4.0.0",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
Expand All @@ -56,4 +57,4 @@
"files": [
"dist"
]
}
}
3 changes: 3 additions & 0 deletions backstage/packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Router from 'express-promise-router';
import auth from './plugins/auth';
import catalog from './plugins/catalog';
import gitlab from './plugins/gitlab';
import readme from './plugins/readme';
import proxy from './plugins/proxy';
import scaffolder from './plugins/scaffolder';
import search from './plugins/search';
Expand Down Expand Up @@ -73,6 +74,7 @@ async function main() {
const catalogEnv = useHotMemoize(module, () => createEnv('catalog'));
const scaffolderEnv = useHotMemoize(module, () => createEnv('scaffolder'));
const authEnv = useHotMemoize(module, () => createEnv('auth'));
const readmeEnv = useHotMemoize(module, () => createEnv('readme'));
const proxyEnv = useHotMemoize(module, () => createEnv('proxy'));
const techdocsEnv = useHotMemoize(module, () => createEnv('techdocs'));
const searchEnv = useHotMemoize(module, () => createEnv('search'));
Expand All @@ -84,6 +86,7 @@ async function main() {
apiRouter.use('/auth', await auth(authEnv));
apiRouter.use('/techdocs', await techdocs(techdocsEnv));
apiRouter.use('/proxy', await proxy(proxyEnv));
apiRouter.use('/readme', await readme(readmeEnv));
apiRouter.use('/search', await search(searchEnv));
apiRouter.use('/gitlab', await gitlab(gitlabEnv));

Expand Down
15 changes: 15 additions & 0 deletions backstage/packages/backend/src/plugins/readme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { createRouter } from '@axis-backstage/plugin-readme-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';

export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
return await createRouter({
logger: env.logger,
config: env.config,
reader: env.reader,
discovery: env.discovery,
tokenManager: env.tokenManager,
});
}
Loading
Loading