Add @backstage/plugin-sonarqube-react

Signed-off-by: Magnus Persson <magnus.persson@fortnox.se>
This commit is contained in:
Magnus Persson
2022-11-22 11:13:15 +01:00
parent 12ba9c2efe
commit 2b555e3b83
11 changed files with 409 additions and 2 deletions
-45
View File
@@ -1,45 +0,0 @@
/*
* Copyright 2020 The Backstage Authors
*
* 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 { MetricKey, SonarUrlProcessorFunc } from './types';
import { createApiRef } from '@backstage/core-plugin-api';
/**
* Define a type to make sure that all metrics are used
*/
export type Metrics = {
[key in MetricKey]: string | undefined;
};
export interface FindingSummary {
lastAnalysis: string;
metrics: Metrics;
projectUrl: string;
getIssuesUrl: SonarUrlProcessorFunc;
getComponentMeasuresUrl: SonarUrlProcessorFunc;
getSecurityHotspotsUrl: () => string;
}
export const sonarQubeApiRef = createApiRef<SonarQubeApi>({
id: 'plugin.sonarqube.service',
});
export type SonarQubeApi = {
getFindingSummary(options: {
componentKey?: string;
projectInstance?: string;
}): Promise<FindingSummary | undefined>;
};