From bdd10ca66f39d319a334ae6d8e39b0f36c8ea9ce Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 15 Dec 2020 19:48:11 +0100 Subject: [PATCH] chore: replace GITHUB_ACTIONS_ANNOTATION with const for now as we need a release of the github-actions-plugin first --- plugins/github-actions/src/components/Cards/Cards.tsx | 5 ++++- .../src/components/Cards/RecentWorkflowRunsCard.tsx | 5 ++++- plugins/github-actions/src/components/Router.tsx | 5 ++++- .../src/scaffolder/stages/templater/cra/index.ts | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/plugins/github-actions/src/components/Cards/Cards.tsx b/plugins/github-actions/src/components/Cards/Cards.tsx index 64de351d4e..0d797dcc41 100644 --- a/plugins/github-actions/src/components/Cards/Cards.tsx +++ b/plugins/github-actions/src/components/Cards/Cards.tsx @@ -32,7 +32,10 @@ import { useApi, } from '@backstage/core'; import ExternalLinkIcon from '@material-ui/icons/Launch'; -import { GITHUB_ACTIONS_ANNOTATION } from '../../../universal'; + +// TODO(blam): Replace with the universal import from github-actions after a release +// As it will break the E2E without it +const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug'; const useStyles = makeStyles({ externalLinkIcon: { diff --git a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx index 184e784249..094464f3a2 100644 --- a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx +++ b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; import { errorApiRef, useApi } from '@backstage/core-api'; -import { GITHUB_ACTIONS_ANNOTATION } from '../../../universal'; import { useWorkflowRuns } from '../useWorkflowRuns'; import React, { useEffect } from 'react'; import { EmptyState, InfoCard, Table } from '@backstage/core'; @@ -23,6 +22,10 @@ import { WorkflowRunStatus } from '../WorkflowRunStatus'; import { Button, Link } from '@material-ui/core'; import { generatePath, Link as RouterLink } from 'react-router-dom'; +// TODO(blam): Replace with the universal import from github-actions after a release +// As it will break the E2E without it +const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug'; + const firstLine = (message: string): string => message.split('\n')[0]; export type Props = { diff --git a/plugins/github-actions/src/components/Router.tsx b/plugins/github-actions/src/components/Router.tsx index 720f751be6..964b8dc112 100644 --- a/plugins/github-actions/src/components/Router.tsx +++ b/plugins/github-actions/src/components/Router.tsx @@ -19,9 +19,12 @@ import { Routes, Route } from 'react-router'; import { rootRouteRef, buildRouteRef } from '../plugin'; import { WorkflowRunDetails } from './WorkflowRunDetails'; import { WorkflowRunsTable } from './WorkflowRunsTable'; -import { GITHUB_ACTIONS_ANNOTATION } from '../../universal'; import { MissingAnnotationEmptyState } from '@backstage/core'; +// TODO(blam): Replace with the universal import from github-actions after a release +// As it will break the E2E without it +const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug'; + export const isPluginApplicableToEntity = (entity: Entity) => Boolean(entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION]); diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/templater/cra/index.ts b/plugins/scaffolder-backend/src/scaffolder/stages/templater/cra/index.ts index ce7e76fb47..b30e86d903 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/templater/cra/index.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/templater/cra/index.ts @@ -19,9 +19,12 @@ import { TemplaterBase, TemplaterRunOptions } from '..'; import path from 'path'; import { TemplaterRunResult } from '../types'; import * as yaml from 'yaml'; -import { GITHUB_ACTIONS_ANNOTATION } from '@backstage/plugin-github-actions/universal'; import { resolvePackagePath } from '@backstage/backend-common'; +// TODO(blam): Replace with the universal import from github-actions after a release +// As it will break the E2E without it +const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug'; + export class CreateReactAppTemplater implements TemplaterBase { public async run(options: TemplaterRunOptions): Promise { const {