@backstage-community/plugin-sonarqube 0.8.6 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/alpha/package.json +1 -1
- package/config.d.ts +32 -0
- package/dist/alpha/apis.esm.js +4 -4
- package/dist/alpha/apis.esm.js.map +1 -1
- package/dist/api/SonarQubeClient.esm.js +7 -10
- package/dist/api/SonarQubeClient.esm.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/plugin.esm.js +4 -4
- package/dist/plugin.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @backstage-community/plugin-sonarqube
|
|
2
2
|
|
|
3
|
+
## 0.8.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4c50596: Add config visibility to the frontend
|
|
8
|
+
- c05862b: fix: use fetchApi instead of explicit identityApi token in sonarqube frontend plugin api
|
|
9
|
+
|
|
3
10
|
## 0.8.6
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/config.d.ts
CHANGED
|
@@ -22,5 +22,37 @@ export interface Config {
|
|
|
22
22
|
* @visibility frontend
|
|
23
23
|
*/
|
|
24
24
|
baseUrl?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The external url of the sonarqube installation.
|
|
28
|
+
* Use this if you want to use a different url for the frontend than the backend.
|
|
29
|
+
* @visibility frontend
|
|
30
|
+
*/
|
|
31
|
+
externalBaseUrl?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The optional sonarqube instances.
|
|
35
|
+
* @visibility frontend
|
|
36
|
+
*/
|
|
37
|
+
instances?: Array<{
|
|
38
|
+
/**
|
|
39
|
+
* The name of the sonarqube instance.
|
|
40
|
+
* @visibility frontend
|
|
41
|
+
*/
|
|
42
|
+
name: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The base url of the sonarqube instance.
|
|
46
|
+
* @visibility frontend
|
|
47
|
+
*/
|
|
48
|
+
baseUrl: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The external url of the sonarqube instance.
|
|
52
|
+
* Use this if you want to use a different url for the frontend than the backend.
|
|
53
|
+
* @visibility frontend
|
|
54
|
+
*/
|
|
55
|
+
externalBaseUrl?: string;
|
|
56
|
+
}>;
|
|
25
57
|
};
|
|
26
58
|
}
|
package/dist/alpha/apis.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiBlueprint, createApiFactory } from '@backstage/frontend-plugin-api';
|
|
2
2
|
import { SonarQubeClient } from '../api/SonarQubeClient.esm.js';
|
|
3
3
|
import { sonarQubeApiRef } from '@backstage-community/plugin-sonarqube-react';
|
|
4
|
-
import { discoveryApiRef,
|
|
4
|
+
import { discoveryApiRef, fetchApiRef } from '@backstage/core-plugin-api';
|
|
5
5
|
|
|
6
6
|
const sonarQubeApi = ApiBlueprint.make({
|
|
7
7
|
params: {
|
|
@@ -9,11 +9,11 @@ const sonarQubeApi = ApiBlueprint.make({
|
|
|
9
9
|
api: sonarQubeApiRef,
|
|
10
10
|
deps: {
|
|
11
11
|
discoveryApi: discoveryApiRef,
|
|
12
|
-
|
|
12
|
+
fetchApi: fetchApiRef
|
|
13
13
|
},
|
|
14
|
-
factory: ({ discoveryApi,
|
|
14
|
+
factory: ({ discoveryApi, fetchApi }) => new SonarQubeClient({
|
|
15
15
|
discoveryApi,
|
|
16
|
-
|
|
16
|
+
fetchApi
|
|
17
17
|
})
|
|
18
18
|
})
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apis.esm.js","sources":["../../src/alpha/apis.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ApiBlueprint, createApiFactory } from '@backstage/frontend-plugin-api';\nimport { SonarQubeClient } from '../api';\nimport { sonarQubeApiRef } from '@backstage-community/plugin-sonarqube-react';\nimport { discoveryApiRef,
|
|
1
|
+
{"version":3,"file":"apis.esm.js","sources":["../../src/alpha/apis.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ApiBlueprint, createApiFactory } from '@backstage/frontend-plugin-api';\nimport { SonarQubeClient } from '../api';\nimport { sonarQubeApiRef } from '@backstage-community/plugin-sonarqube-react';\nimport { discoveryApiRef, fetchApiRef } from '@backstage/core-plugin-api';\n\n/**\n * @alpha\n */\nexport const sonarQubeApi = ApiBlueprint.make({\n params: {\n factory: createApiFactory({\n api: sonarQubeApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new SonarQubeClient({\n discoveryApi,\n fetchApi,\n }),\n }),\n },\n});\n"],"names":[],"mappings":";;;;;AAuBa,MAAA,YAAA,GAAe,aAAa,IAAK,CAAA;AAAA,EAC5C,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,eAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA,WAAA;AAAA,OACZ;AAAA,MACA,SAAS,CAAC,EAAE,cAAc,QAAS,EAAA,KACjC,IAAI,eAAgB,CAAA;AAAA,QAClB,YAAA;AAAA,QACA,QAAA;AAAA,OACD,CAAA;AAAA,KACJ,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import fetch from 'cross-fetch';
|
|
2
|
-
|
|
3
1
|
class SonarQubeClient {
|
|
4
2
|
discoveryApi;
|
|
5
|
-
|
|
3
|
+
fetchApi;
|
|
6
4
|
constructor(options) {
|
|
7
5
|
this.discoveryApi = options.discoveryApi;
|
|
8
|
-
this.
|
|
6
|
+
this.fetchApi = options.fetchApi;
|
|
9
7
|
}
|
|
10
8
|
async callApi(path, query) {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const response = await this.fetchApi.fetch(
|
|
10
|
+
`${await this.discoveryApi.getBaseUrl(
|
|
11
|
+
"sonarqube"
|
|
12
|
+
)}/${path}?${new URLSearchParams(query).toString()}`,
|
|
15
13
|
{
|
|
16
14
|
headers: {
|
|
17
|
-
"Content-Type": "application/json"
|
|
18
|
-
...idToken && { Authorization: `Bearer ${idToken}` }
|
|
15
|
+
"Content-Type": "application/json"
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
18
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SonarQubeClient.esm.js","sources":["../../src/api/SonarQubeClient.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"SonarQubeClient.esm.js","sources":["../../src/api/SonarQubeClient.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FindingSummary,\n Metrics,\n SonarQubeApi,\n} from '@backstage-community/plugin-sonarqube-react';\nimport { InstanceUrlWrapper, FindingsWrapper } from './types';\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\n\n/** @public */\nexport class SonarQubeClient implements SonarQubeApi {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n\n constructor(options: { discoveryApi: DiscoveryApi; fetchApi: FetchApi }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n }\n\n private async callApi<T>(\n path: string,\n query: { [key in string]: any },\n ): Promise<T | undefined> {\n const response = await this.fetchApi.fetch(\n `${await this.discoveryApi.getBaseUrl(\n 'sonarqube',\n )}/${path}?${new URLSearchParams(query).toString()}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n },\n },\n );\n if (response.status === 200) {\n return (await response.json()) as T;\n }\n return undefined;\n }\n\n async getFindingSummary({\n componentKey,\n projectInstance,\n }: {\n componentKey?: string;\n projectInstance?: string;\n } = {}): Promise<FindingSummary | undefined> {\n if (!componentKey) {\n return undefined;\n }\n\n const instanceKey = projectInstance || '';\n\n const metrics: Metrics = {\n alert_status: undefined,\n bugs: undefined,\n reliability_rating: undefined,\n vulnerabilities: undefined,\n security_rating: undefined,\n security_hotspots_reviewed: undefined,\n security_review_rating: undefined,\n code_smells: undefined,\n sqale_rating: undefined,\n coverage: undefined,\n duplicated_lines_density: undefined,\n };\n\n const baseUrlWrapper = await this.callApi<InstanceUrlWrapper>(\n 'instanceUrl',\n {\n instanceKey,\n },\n );\n let baseUrl = baseUrlWrapper?.instanceUrl;\n if (!baseUrl) {\n return undefined;\n }\n // ensure trailing slash for later on\n if (!baseUrl.endsWith('/')) {\n baseUrl += '/';\n }\n\n const findings = await this.callApi<FindingsWrapper>('findings', {\n componentKey,\n instanceKey,\n });\n if (!findings) {\n return undefined;\n }\n\n findings.measures.forEach(m => {\n metrics[m.metric] = m.value;\n });\n\n return {\n title: componentKey,\n lastAnalysis: findings.analysisDate,\n metrics,\n projectUrl: `${baseUrl}dashboard?id=${encodeURIComponent(componentKey)}`,\n getIssuesUrl: identifier =>\n `${baseUrl}project/issues?id=${encodeURIComponent(\n componentKey,\n )}&types=${identifier.toLocaleUpperCase('en-US')}&resolved=false`,\n getComponentMeasuresUrl: identifier =>\n `${baseUrl}component_measures?id=${encodeURIComponent(\n componentKey,\n )}&metric=${identifier.toLocaleLowerCase(\n 'en-US',\n )}&resolved=false&view=list`,\n getSecurityHotspotsUrl: () =>\n `${baseUrl}${\n baseUrl === 'https://sonarcloud.io/' ? 'project/' : ''\n }security_hotspots?id=${encodeURIComponent(componentKey)}`,\n };\n }\n settledResponseOf(responses: PromiseSettledResult<any>[]): Array<any> {\n return responses.map(response =>\n response.status === 'fulfilled' ? response.value : null,\n );\n }\n\n async getFindingSummaries(\n components: Array<{\n projectInstance: string | undefined;\n componentKey: string;\n }>,\n ): Promise<Map<string, FindingSummary>> {\n const map = new Map<string, FindingSummary>();\n if (components.length === 0) {\n return map;\n }\n const promises = components.map(({ projectInstance, componentKey }) =>\n this.getFindingSummary({ componentKey, projectInstance }),\n );\n const summaries: any = await Promise.allSettled(promises).then(results => {\n return results\n .map(result => result as PromiseFulfilledResult<FindingSummary>)\n .map(result => result.value);\n });\n\n for await (const summary of summaries) {\n if (!map.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AAA,KAAA;AACxE,MAAO,OAAA,OAAA,CACJ,IAAI,CAAU,MAAA,KAAA,MAAgD,EAC9D,GAAI,CAAA,CAAA,MAAA,KAAU,OAAO,KAAK,CAAA,CAAA;AAAA,KAC9B,CAAA,CAAA;AAED,IAAA,WAAA,MAAiB,WAAW,SAAW,EAAA;AACrC,MAAA,IAAI,CAAC,GAAA,CAAI,GAAI,CAAA,OAAA,CAAQ,KAAK,CAAG,EAAA;AAC3B,QAAI,GAAA,CAAA,GAAA,CAAI,OAAQ,CAAA,KAAA,EAAO,OAAO,CAAA,CAAA;AAAA,OAChC;AAAA,KACF;AACA,IAAO,OAAA,GAAA,CAAA;AAAA,GACT;AACF;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SonarQubeApi, FindingSummary } from '@backstage-community/plugin-sonarqube-react';
|
|
3
3
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
4
|
-
import { DiscoveryApi,
|
|
4
|
+
import { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';
|
|
5
5
|
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import React__default from 'react';
|
|
@@ -11,10 +11,10 @@ import { InfoCardVariants } from '@backstage/core-components';
|
|
|
11
11
|
/** @public */
|
|
12
12
|
declare class SonarQubeClient implements SonarQubeApi {
|
|
13
13
|
discoveryApi: DiscoveryApi;
|
|
14
|
-
|
|
14
|
+
fetchApi: FetchApi;
|
|
15
15
|
constructor(options: {
|
|
16
16
|
discoveryApi: DiscoveryApi;
|
|
17
|
-
|
|
17
|
+
fetchApi: FetchApi;
|
|
18
18
|
});
|
|
19
19
|
private callApi;
|
|
20
20
|
getFindingSummary({ componentKey, projectInstance, }?: {
|
package/dist/plugin.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SonarQubeClient } from './api/SonarQubeClient.esm.js';
|
|
2
|
-
import { createPlugin, createApiFactory, discoveryApiRef,
|
|
2
|
+
import { createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createComponentExtension } from '@backstage/core-plugin-api';
|
|
3
3
|
import { sonarQubeApiRef } from '@backstage-community/plugin-sonarqube-react';
|
|
4
4
|
|
|
5
5
|
const sonarQubePlugin = createPlugin({
|
|
@@ -9,11 +9,11 @@ const sonarQubePlugin = createPlugin({
|
|
|
9
9
|
api: sonarQubeApiRef,
|
|
10
10
|
deps: {
|
|
11
11
|
discoveryApi: discoveryApiRef,
|
|
12
|
-
|
|
12
|
+
fetchApi: fetchApiRef
|
|
13
13
|
},
|
|
14
|
-
factory: ({ discoveryApi,
|
|
14
|
+
factory: ({ discoveryApi, fetchApi }) => new SonarQubeClient({
|
|
15
15
|
discoveryApi,
|
|
16
|
-
|
|
16
|
+
fetchApi
|
|
17
17
|
})
|
|
18
18
|
})
|
|
19
19
|
]
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SonarQubeClient } from './api';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n discoveryApiRef,\n
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SonarQubeClient } from './api';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport { sonarQubeApiRef } from '@backstage-community/plugin-sonarqube-react';\n\n/** @public */\nexport const sonarQubePlugin = createPlugin({\n id: 'sonarqube',\n apis: [\n createApiFactory({\n api: sonarQubeApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new SonarQubeClient({\n discoveryApi,\n fetchApi,\n }),\n }),\n ],\n});\n\n/** @public */\nexport const EntitySonarQubeCard = sonarQubePlugin.provide(\n createComponentExtension({\n name: 'EntitySonarQubeCard',\n component: {\n lazy: () =>\n import('./components/SonarQubeCard').then(m => m.SonarQubeCard),\n },\n }),\n);\n\n/** @public */\nexport const EntitySonarQubeContentPage = sonarQubePlugin.provide(\n createComponentExtension({\n name: 'EntitySonarQubeContentPage',\n component: {\n lazy: () =>\n import('./components/SonarQubeContentPage').then(\n m => m.SonarQubeContentPage,\n ),\n },\n }),\n);\n"],"names":[],"mappings":";;;;AA2BO,MAAM,kBAAkB,YAAa,CAAA;AAAA,EAC1C,EAAI,EAAA,WAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,eAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA,WAAA;AAAA,OACZ;AAAA,MACA,SAAS,CAAC,EAAE,cAAc,QAAS,EAAA,KACjC,IAAI,eAAgB,CAAA;AAAA,QAClB,YAAA;AAAA,QACA,QAAA;AAAA,OACD,CAAA;AAAA,KACJ,CAAA;AAAA,GACH;AACF,CAAC,EAAA;AAGM,MAAM,sBAAsB,eAAgB,CAAA,OAAA;AAAA,EACjD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,qBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,yCAA4B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,aAAa,CAAA;AAAA,KAClE;AAAA,GACD,CAAA;AACH,EAAA;AAGO,MAAM,6BAA6B,eAAgB,CAAA,OAAA;AAAA,EACxD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,4BAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,gDAAmC,CAAE,CAAA,IAAA;AAAA,QAC1C,OAAK,CAAE,CAAA,oBAAA;AAAA,OACT;AAAA,KACJ;AAAA,GACD,CAAA;AACH;;;;"}
|