add ADRs to example app
Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
This commit is contained in:
@@ -274,6 +274,9 @@ catalog:
|
||||
# Example component for TechDocs
|
||||
- type: file
|
||||
target: ../../plugins/techdocs-backend/examples/documented-component/catalog-info.yaml
|
||||
# Example component for ADRs
|
||||
- type: file
|
||||
target: ../../plugins/adr/examples/component/catalog-info.yaml
|
||||
# Backstage example templates
|
||||
- type: file
|
||||
target: ../../plugins/scaffolder-backend/sample-templates/all-templates.yaml
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"@backstage/core-components": "workspace:^",
|
||||
"@backstage/core-plugin-api": "workspace:^",
|
||||
"@backstage/integration-react": "workspace:^",
|
||||
"@backstage/plugin-adr": "workspace:^",
|
||||
"@backstage/plugin-airbrake": "workspace:^",
|
||||
"@backstage/plugin-apache-airflow": "workspace:^",
|
||||
"@backstage/plugin-api-docs": "workspace:^",
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
RELATION_PROVIDES_API,
|
||||
} from '@backstage/catalog-model';
|
||||
import { EmptyState, InfoCard } from '@backstage/core-components';
|
||||
import { EntityAdrContent, isAdrAvailable } from '@backstage/plugin-adr';
|
||||
import {
|
||||
EntityApiDefinitionCard,
|
||||
EntityConsumedApisCard,
|
||||
@@ -484,6 +485,10 @@ const serviceEntityPage = (
|
||||
{techdocsContent}
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route if={isAdrAvailable} path="/adrs" title="ADRS">
|
||||
<EntityAdrContent />
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route
|
||||
if={isNewRelicDashboardAvailable}
|
||||
path="/newrelic-dashboard"
|
||||
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
catalogApiRef,
|
||||
CATALOG_FILTER_EXISTS,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { AdrSearchResultListItem } from '@backstage/plugin-adr';
|
||||
import { SearchType } from '@backstage/plugin-search';
|
||||
import {
|
||||
SearchBar,
|
||||
@@ -86,6 +87,11 @@ const SearchPage = () => {
|
||||
name: 'Documentation',
|
||||
icon: <DocsIcon />,
|
||||
},
|
||||
{
|
||||
value: 'adr',
|
||||
name: 'Architecture Decision Records',
|
||||
icon: <DocsIcon />,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Paper className={classes.filters}>
|
||||
@@ -131,6 +137,7 @@ const SearchPage = () => {
|
||||
<CatalogSearchResultListItem icon={<CatalogIcon />} />
|
||||
<TechDocsSearchResultListItem icon={<DocsIcon />} />
|
||||
<ToolSearchResultListItem icon={<BuildIcon />} />
|
||||
<AdrSearchResultListItem icon={<DocsIcon />} />
|
||||
</SearchResult>
|
||||
<SearchResultPager />
|
||||
</Grid>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import { useHotCleanup } from '@backstage/backend-common';
|
||||
import { DefaultAdrCollatorFactory } from '@backstage/plugin-adr-backend';
|
||||
import { DefaultCatalogCollatorFactory } from '@backstage/plugin-catalog-backend';
|
||||
import { ToolDocumentCollatorFactory } from '@backstage/plugin-explore-backend';
|
||||
import { createRouter } from '@backstage/plugin-search-backend';
|
||||
@@ -68,6 +69,18 @@ export default async function createPlugin(
|
||||
|
||||
// Collators are responsible for gathering documents known to plugins. This
|
||||
// particular collator gathers entities from the software catalog.
|
||||
indexBuilder.addCollator({
|
||||
schedule,
|
||||
factory: DefaultAdrCollatorFactory.fromConfig({
|
||||
cache: env.cache,
|
||||
config: env.config,
|
||||
discovery: env.discovery,
|
||||
logger: env.logger,
|
||||
reader: env.reader,
|
||||
tokenManager: env.tokenManager,
|
||||
}),
|
||||
});
|
||||
|
||||
indexBuilder.addCollator({
|
||||
schedule,
|
||||
factory: DefaultCatalogCollatorFactory.fromConfig(env.config, {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: component-with-adrs
|
||||
title: Component With ADRs
|
||||
description: A Service with ADRs registerd
|
||||
annotations:
|
||||
backstage.io/adr-location: https://github.com/adr/madr/tree/develop/docs/decisions
|
||||
spec:
|
||||
type: service
|
||||
lifecycle: experimental
|
||||
owner: user:guest
|
||||
@@ -4525,7 +4525,7 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@backstage/plugin-adr@workspace:plugins/adr":
|
||||
"@backstage/plugin-adr@workspace:^, @backstage/plugin-adr@workspace:plugins/adr":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@backstage/plugin-adr@workspace:plugins/adr"
|
||||
dependencies:
|
||||
@@ -24254,6 +24254,7 @@ __metadata:
|
||||
"@backstage/core-components": "workspace:^"
|
||||
"@backstage/core-plugin-api": "workspace:^"
|
||||
"@backstage/integration-react": "workspace:^"
|
||||
"@backstage/plugin-adr": "workspace:^"
|
||||
"@backstage/plugin-airbrake": "workspace:^"
|
||||
"@backstage/plugin-apache-airflow": "workspace:^"
|
||||
"@backstage/plugin-api-docs": "workspace:^"
|
||||
|
||||
Reference in New Issue
Block a user