Remove circular dependencies

In reference to issue #5563 this does the initial work to remove
all the circular dependencies that we have encountered while
building backstage using bazel. The next step will be to implement
a method to catch these circular dependencies before they get
merged in

Signed-off-by: jrusso1020 <jrusso@brex.com>
This commit is contained in:
jrusso1020
2021-05-15 10:21:34 -06:00
parent 1cfef4244e
commit 65e6c45410
70 changed files with 384 additions and 267 deletions
@@ -34,8 +34,8 @@ import {
import ExternalLinkIcon from '@material-ui/icons/Launch';
import React, { useEffect } from 'react';
import { GITHUB_ACTIONS_ANNOTATION } from '../useProjectName';
import { useWorkflowRuns } from '../useWorkflowRuns';
import { WorkflowRun, WorkflowRunsTable } from '../WorkflowRunsTable';
import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';
import { WorkflowRunsTable } from '../WorkflowRunsTable';
import { WorkflowRunStatus } from '../WorkflowRunStatus';
const useStyles = makeStyles<Theme>({
@@ -17,7 +17,7 @@ import React from 'react';
import { Entity } from '@backstage/catalog-model';
import { useEntity } from '@backstage/plugin-catalog-react';
import { Routes, Route } from 'react-router';
import { rootRouteRef, buildRouteRef } from '../plugin';
import { rootRouteRef, buildRouteRef } from '../routes';
import { WorkflowRunDetails } from './WorkflowRunDetails';
import { WorkflowRunsTable } from './WorkflowRunsTable';
import { GITHUB_ACTIONS_ANNOTATION } from './useProjectName';
@@ -16,7 +16,7 @@
import { useApi, useRouteRefParams } from '@backstage/core';
import { useAsync } from 'react-use';
import { githubActionsApiRef } from '../../api';
import { buildRouteRef } from '../../plugin';
import { buildRouteRef } from '../../routes';
export const useWorkflowRunsDetails = ({
hostname,
@@ -32,32 +32,14 @@ import {
configApiRef,
useApi,
} from '@backstage/core';
import { useWorkflowRuns } from '../useWorkflowRuns';
import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';
import { WorkflowRunStatus } from '../WorkflowRunStatus';
import SyncIcon from '@material-ui/icons/Sync';
import { buildRouteRef } from '../../plugin';
import { buildRouteRef } from '../../routes';
import { useProjectName } from '../useProjectName';
import { Entity } from '@backstage/catalog-model';
import { readGitHubIntegrationConfigs } from '@backstage/integration';
export type WorkflowRun = {
workflowName: string;
id: string;
message: string;
url?: string;
githubUrl?: string;
source: {
branchName: string;
commit: {
hash: string;
url?: string;
};
};
status: string;
conclusion: string;
onReRunClick: () => void;
};
const generatedColumns: TableColumn[] = [
{
title: 'ID',
@@ -14,4 +14,3 @@
* limitations under the License.
*/
export { WorkflowRunsTable, WorkflowRunsTableView } from './WorkflowRunsTable';
export type { WorkflowRun } from './WorkflowRunsTable';
@@ -15,10 +15,27 @@
*/
import { useState } from 'react';
import { useAsyncRetry } from 'react-use';
import { WorkflowRun } from './WorkflowRunsTable/WorkflowRunsTable';
import { githubActionsApiRef } from '../api/GithubActionsApi';
import { useApi, errorApiRef } from '@backstage/core';
export type WorkflowRun = {
workflowName: string;
id: string;
message: string;
url?: string;
githubUrl?: string;
source: {
branchName: string;
commit: {
hash: string;
url?: string;
};
};
status: string;
conclusion: string;
onReRunClick: () => void;
};
export function useWorkflowRuns({
hostname,
owner,
+1 -13
View File
@@ -17,25 +17,13 @@
import {
configApiRef,
createPlugin,
createRouteRef,
createApiFactory,
githubAuthApiRef,
createRoutableExtension,
createComponentExtension,
} from '@backstage/core';
import { githubActionsApiRef, GithubActionsClient } from './api';
// TODO(freben): This is just a demo route for now
export const rootRouteRef = createRouteRef({
path: '',
title: 'GitHub Actions',
});
export const buildRouteRef = createRouteRef({
path: ':id',
params: ['id'],
title: 'GitHub Actions Workflow Run',
});
import { rootRouteRef } from './routes';
export const githubActionsPlugin = createPlugin({
id: 'github-actions',
+29
View File
@@ -0,0 +1,29 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createRouteRef } from '@backstage/core';
// TODO(freben): This is just a demo route for now
export const rootRouteRef = createRouteRef({
path: '',
title: 'GitHub Actions',
});
export const buildRouteRef = createRouteRef({
path: ':id',
params: ['id'],
title: 'GitHub Actions Workflow Run',
});