From b891d32604cfa1774a7409c3aa76eae5f013ea16 Mon Sep 17 00:00:00 2001 From: djamaile Date: Wed, 30 Mar 2022 17:39:52 +0200 Subject: [PATCH] chore: clean up of test variables Signed-off-by: djamaile --- .changeset/proud-news-perform.md | 3 ++- packages/app/src/apis.ts | 11 +---------- packages/app/src/components/catalog/EntityPage.tsx | 5 ----- .../cicd-statistics-module-gitlab/src/api/utils.ts | 2 +- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/.changeset/proud-news-perform.md b/.changeset/proud-news-perform.md index 20259c33e5..9d5cbae8ab 100644 --- a/.changeset/proud-news-perform.md +++ b/.changeset/proud-news-perform.md @@ -2,4 +2,5 @@ '@backstage/plugin-cicd-statistics-module-gitlab': minor --- -Will update this once the PR is ready to be merged +Created a module to extract the CI/CD statistics from a Gitlab repository. +Read the `README.md` in the `cicd-statistics-module-gitlab` plugin folder on how to set it up. diff --git a/packages/app/src/apis.ts b/packages/app/src/apis.ts index 7b3232f42d..d587a88402 100644 --- a/packages/app/src/apis.ts +++ b/packages/app/src/apis.ts @@ -33,10 +33,7 @@ import { createApiFactory, errorApiRef, githubAuthApiRef, - gitlabAuthApiRef, } from '@backstage/core-plugin-api'; -import { cicdStatisticsApiRef } from '@backstage/plugin-cicd-statistics'; -import { CicdStatisticsApiGitlab } from '@backstage/plugin-cicd-statistics-module-gitlab'; export const apis: AnyApiFactory[] = [ createApiFactory({ @@ -65,12 +62,6 @@ export const apis: AnyApiFactory[] = [ }), ]), }), - createApiFactory({ - api: cicdStatisticsApiRef, - deps: { gitlabAuthApi: gitlabAuthApiRef }, - factory({ gitlabAuthApi }) { - return new CicdStatisticsApiGitlab(gitlabAuthApi); - }, - }), + createApiFactory(costInsightsApiRef, new ExampleCostInsightsClient()), ]; diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index 3ade051077..26068c6c8f 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -136,7 +136,6 @@ import { EntityNewRelicDashboardCard, } from '@backstage/plugin-newrelic-dashboard'; import { EntityGoCdContent, isGoCdAvailable } from '@backstage/plugin-gocd'; -import { EntityCicdStatisticsContent } from '@backstage/plugin-cicd-statistics'; import React, { ReactNode, useMemo, useState } from 'react'; @@ -445,10 +444,6 @@ const websiteEntityPage = ( {cicdContent} - - - - diff --git a/plugins/cicd-statistics-module-gitlab/src/api/utils.ts b/plugins/cicd-statistics-module-gitlab/src/api/utils.ts index acf2910704..5f1d1cbeba 100644 --- a/plugins/cicd-statistics-module-gitlab/src/api/utils.ts +++ b/plugins/cicd-statistics-module-gitlab/src/api/utils.ts @@ -76,7 +76,7 @@ export function pipelinesToBuilds( * * @remarks * - * The Gitlab API can only return the job (sub-stage) of a pipeline and not a whole stage a pipeline + * The Gitlab API can only return the job (sub-stage) of a pipeline and not a whole stage * The job does return from which stage it is * So, for the stage name we use the parent stage name and in the sub-stages we add the current job * In the end the cicd-statistics plugin will calculate the right durations for each stage