Add widget to show recent git workflow runs

Adds a widget to show recent git workflow runs to the
github actions plugin. The default setting is the last
5 runs across all branches but both branch and the
number of runs are configurable.
This commit is contained in:
Iain Billett
2020-09-21 16:06:57 +01:00
parent da2a12d61a
commit 63d3a4d3da
5 changed files with 230 additions and 10 deletions
@@ -14,17 +14,18 @@
* limitations under the License.
*/
import {
Router as GitHubActionsRouter,
isPluginApplicableToEntity as isGitHubActionsAvailable,
RecentWorkflowRunsCard,
Router as GitHubActionsRouter,
} from '@backstage/plugin-github-actions';
import {
Router as JenkinsRouter,
isPluginApplicableToEntity as isJenkinsAvailable,
LatestRunCard as JenkinsLatestRunCard,
Router as JenkinsRouter,
} from '@backstage/plugin-jenkins';
import {
Router as CircleCIRouter,
isPluginApplicableToEntity as isCircleCIAvailable,
Router as CircleCIRouter,
} from '@backstage/plugin-circleci';
import { Router as ApiDocsRouter } from '@backstage/plugin-api-docs';
import { Router as SentryRouter } from '@backstage/plugin-sentry';
@@ -62,14 +63,15 @@ const CICDSwitcher = ({ entity }: { entity: Entity }) => {
const OverviewContent = ({ entity }: { entity: Entity }) => (
<Grid container spacing={3}>
<Grid item>
<Grid item md={6}>
{isJenkinsAvailable(entity) && <JenkinsLatestRunCard branch="master" />}
{isGitHubActionsAvailable(entity) && (
<RecentWorkflowRunsCard entity={entity} />
)}
</Grid>
<Grid item md={6}>
<AboutCard entity={entity} />
</Grid>
{isJenkinsAvailable(entity) && (
<Grid item sm={4}>
<JenkinsLatestRunCard branch="master" />
</Grid>
)}
</Grid>
);