Update api-report.md
Signed-off-by: Magnus Persson <magnus.persson@fortnox.se>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
import { createApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
/** @alpha */
|
||||
export type MetricKey =
|
||||
// alert status
|
||||
| 'alert_status'
|
||||
@@ -42,15 +43,19 @@ export type MetricKey =
|
||||
// duplicated lines
|
||||
| 'duplicated_lines_density';
|
||||
|
||||
/** @alpha */
|
||||
export type SonarUrlProcessorFunc = (identifier: string) => string;
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*
|
||||
* Define a type to make sure that all metrics are used
|
||||
*/
|
||||
export type Metrics = {
|
||||
[key in MetricKey]: string | undefined;
|
||||
};
|
||||
|
||||
/** @alpha */
|
||||
export interface FindingSummary {
|
||||
lastAnalysis: string;
|
||||
metrics: Metrics;
|
||||
@@ -60,6 +65,7 @@ export interface FindingSummary {
|
||||
getSecurityHotspotsUrl: () => string;
|
||||
}
|
||||
|
||||
/** @alpha */
|
||||
export const sonarQubeApiRef = createApiRef<SonarQubeApi>({
|
||||
id: 'plugin.sonarqube.service',
|
||||
});
|
||||
|
||||
@@ -17,5 +17,4 @@
|
||||
export {
|
||||
isSonarQubeAvailable,
|
||||
SONARQUBE_PROJECT_KEY_ANNOTATION,
|
||||
SONARQUBE_PROJECT_INSTANCE_SEPARATOR,
|
||||
} from './isSonarQubeAvailable';
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
|
||||
/** @public */
|
||||
export const SONARQUBE_PROJECT_KEY_ANNOTATION = 'sonarqube.org/project-key';
|
||||
export const SONARQUBE_PROJECT_INSTANCE_SEPARATOR = '/';
|
||||
|
||||
/** @public */
|
||||
export const isSonarQubeAvailable = (entity: Entity) =>
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
*/
|
||||
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import {
|
||||
SONARQUBE_PROJECT_INSTANCE_SEPARATOR,
|
||||
SONARQUBE_PROJECT_KEY_ANNOTATION,
|
||||
} from '../components';
|
||||
import { SONARQUBE_PROJECT_KEY_ANNOTATION } from '../components';
|
||||
import { useProjectInfo } from './useProjectInfo';
|
||||
import { SONARQUBE_PROJECT_INSTANCE_SEPARATOR } from './useProjectInfo';
|
||||
|
||||
const createDummyEntity = (sonarqubeAnnotationValue: string): Entity => {
|
||||
return {
|
||||
|
||||
@@ -15,10 +15,9 @@
|
||||
*/
|
||||
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import {
|
||||
SONARQUBE_PROJECT_INSTANCE_SEPARATOR,
|
||||
SONARQUBE_PROJECT_KEY_ANNOTATION,
|
||||
} from '../components';
|
||||
import { SONARQUBE_PROJECT_KEY_ANNOTATION } from '../components';
|
||||
|
||||
export const SONARQUBE_PROJECT_INSTANCE_SEPARATOR = '/';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -27,8 +26,8 @@ import {
|
||||
* If part or all info are not found, they will default to undefined
|
||||
*
|
||||
* @alpha
|
||||
* @param entity entity to find the sonarqube information from.
|
||||
* @return a ProjectInfo properly populated.
|
||||
* @param entity - entity to find the sonarqube information from.
|
||||
* @returns a ProjectInfo properly populated.
|
||||
*/
|
||||
export const useProjectInfo = (
|
||||
entity: Entity,
|
||||
|
||||
Reference in New Issue
Block a user