]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-14519 - Update ALMs format and simplify System Info Page
authorBelen Pruvost <belen.pruvost@sonarsource.com>
Fri, 12 Mar 2021 13:13:50 +0000 (14:13 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 12 Mar 2021 20:07:59 +0000 (20:07 +0000)
server/sonar-web/src/main/js/apps/system/components/__tests__/ClusterSysInfos-test.tsx
server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/App-test.tsx.snap
server/sonar-web/src/main/js/apps/system/utils.ts
server/sonar-web/src/main/js/helpers/testMocks.ts
server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/AlmConfigurationSection.java
server/sonar-webserver-core/src/test/java/org/sonar/server/platform/monitoring/AlmConfigurationSectionTest.java

index de10c0f317a8f6930db61fe8ff0f9691b84ad699..2870115bdd322c16c5b059699430dacf6cbf9f08 100644 (file)
@@ -78,6 +78,9 @@ function shallowRender(props = {}) {
             'Web Logging': { 'Logs Level': 'INFO' }
           }
         ],
+        ALMs: [{}],
+        Bundled: [{}],
+        Plugins: [{}],
         'Search Nodes': [
           {
             Name: 'Baz',
index aa0f496acbfa3eb69552afded18d71f54975c4e9..1e3f9399b541ee5f4a15db34ff6c2bfcc842bca7 100644 (file)
@@ -228,6 +228,8 @@ exports[`should render correctly: stand-alone sysinfo 1`] = `
     expandedCards={Array []}
     sysInfoData={
       Object {
+        "ALMs": Object {},
+        "Bundled": Object {},
         "Compute Engine Database Connection": Object {
           "Pool Active Connections": 0,
           "Pool Initial Size": 0,
@@ -258,6 +260,7 @@ exports[`should render correctly: stand-alone sysinfo 1`] = `
         },
         "Health": "GREEN",
         "Health Causes": Array [],
+        "Plugins": Object {},
         "Search Indexes": Object {
           "Index components - Docs": 30445,
           "Index components - Shards": 10,
index beb7de83f7c8a126ec25254e77a0e441277ad9d4..4d57a19396b7843fe650047a9f7eb687ca9d10b5 100644 (file)
@@ -35,6 +35,8 @@ export const LOGS_LEVELS = ['INFO', 'DEBUG', 'TRACE'];
 const DEFAULT_LOG_LEVEL = LOGS_LEVELS[0];
 
 export const APP_NODES_FIELD = 'Application Nodes';
+export const ALMS_FIELD = 'ALMs';
+export const BUNDLED_FIELD = 'Bundled';
 export const CE_FIELD_PREFIX = 'Compute Engine';
 export const CE_LOGGING_FIELD = 'Compute Engine Logging';
 export const HA_FIELD = 'High Availability';
@@ -57,6 +59,8 @@ export const WEB_PREFIX = 'Web';
 
 export function ignoreInfoFields(sysInfoObject: T.SysInfoValueObject) {
   return omit(sysInfoObject, [
+    ALMS_FIELD,
+    BUNDLED_FIELD,
     HEALTH_FIELD,
     HEALTH_CAUSES_FIELD,
     NAME_FIELD,
index f23dedf2a7cc99b94493f91a1d5dfc5da3297e67..efc7915e8974cfdf6ab26b26fc637698ddedb142 100644 (file)
@@ -679,6 +679,9 @@ export function mockStandaloneSysInfo(overrides: Partial<any> = {}): T.SysInfoSt
       'file.encoding': 'UTF-8',
       'file.separator': '/'
     },
+    ALMs: {},
+    Bundled: {},
+    Plugins: {},
     ...overrides
   };
 }
index 5af5cfa6f52f12837769caa45b94e058a6d2e545..970d57081b098a83a97694f1adf3255b113409be 100644 (file)
@@ -54,18 +54,18 @@ public class AlmConfigurationSection implements SystemInfoSection {
   }
 
   private static String buildValue(AlmSettingDto almSettingDto) {
-    String value = String.format("alm:%s", almSettingDto.getRawAlm());
+    String value = String.format("Alm:%s", almSettingDto.getRawAlm());
     if (almSettingDto.getUrl() != null) {
-      value += String.format(", url:%s", almSettingDto.getUrl());
+      value += String.format(", Url:%s", almSettingDto.getUrl());
     }
     switch (almSettingDto.getAlm()) {
       case GITHUB:
         // add APP_ID and CLIENT_ID
-        value += String.format(", appId:%s, clientId:%s", almSettingDto.getAppId(), almSettingDto.getClientId());
+        value += String.format(", App Id:%s, Client Id:%s", almSettingDto.getAppId(), almSettingDto.getClientId());
         break;
       case BITBUCKET_CLOUD:
         // WORKSPACE ID & OAuth key
-        value += String.format(", workspace id:%s, OAuth Key:%s", almSettingDto.getAppId(), almSettingDto.getClientId());
+        value += String.format(", Workspace Id:%s, OAuth Key:%s", almSettingDto.getAppId(), almSettingDto.getClientId());
         break;
       default:
         // no additional information for the other ALMs
index 08b858c2ee2b6be3915cd89c15351b7fe39ddbef..59c3a3173de9b512d43b14e16ad82b1c437bb15f 100644 (file)
@@ -50,11 +50,11 @@ public class AlmConfigurationSectionTest {
     assertThat(section.getAttributesList())
       .extracting(Attribute::getKey, Attribute::getStringValue)
       .containsExactlyInAnyOrder(
-        tuple(azure.getKey(), String.format("alm:%s, url:%s", azure.getRawAlm(), azure.getUrl())),
-        tuple(github.getKey(), String.format("alm:%s, url:%s, appId:%s, clientId:%s", github.getRawAlm(), github.getUrl(), github.getAppId(), github.getClientId())),
-        tuple(gitlab.getKey(), String.format("alm:%s, url:%s", gitlab.getRawAlm(), gitlab.getUrl())),
-        tuple(bitbucket.getKey(), String.format("alm:%s, url:%s", bitbucket.getRawAlm(), bitbucket.getUrl())),
-        tuple(bitbucketCloud.getKey(), String.format("alm:%s, workspace id:%s, OAuth Key:%s", bitbucketCloud.getRawAlm(), bitbucketCloud.getAppId(), bitbucketCloud.getClientId())));
+        tuple(azure.getKey(), String.format("Alm:%s, Url:%s", azure.getRawAlm(), azure.getUrl())),
+        tuple(github.getKey(), String.format("Alm:%s, Url:%s, App Id:%s, Client Id:%s", github.getRawAlm(), github.getUrl(), github.getAppId(), github.getClientId())),
+        tuple(gitlab.getKey(), String.format("Alm:%s, Url:%s", gitlab.getRawAlm(), gitlab.getUrl())),
+        tuple(bitbucket.getKey(), String.format("Alm:%s, Url:%s", bitbucket.getRawAlm(), bitbucket.getUrl())),
+        tuple(bitbucketCloud.getKey(), String.format("Alm:%s, Workspace Id:%s, OAuth Key:%s", bitbucketCloud.getRawAlm(), bitbucketCloud.getAppId(), bitbucketCloud.getClientId())));
   }
 
   @Test
@@ -68,8 +68,8 @@ public class AlmConfigurationSectionTest {
     assertThat(section.getAttributesList())
       .extracting(Attribute::getKey, Attribute::getStringValue)
       .containsExactlyInAnyOrder(
-        tuple(gitlab1.getKey(), String.format("alm:%s, url:%s", gitlab1.getRawAlm(), gitlab1.getUrl())),
-        tuple(gitlab2.getKey(), String.format("alm:%s, url:%s", gitlab2.getRawAlm(), gitlab2.getUrl())));
+        tuple(gitlab1.getKey(), String.format("Alm:%s, Url:%s", gitlab1.getRawAlm(), gitlab1.getUrl())),
+        tuple(gitlab2.getKey(), String.format("Alm:%s, Url:%s", gitlab2.getRawAlm(), gitlab2.getUrl())));
   }
 
   @Test
@@ -82,7 +82,7 @@ public class AlmConfigurationSectionTest {
     assertThat(section.getAttributesList())
       .extracting(Attribute::getKey, Attribute::getStringValue)
       .containsExactlyInAnyOrder(
-        tuple(azure.getKey(), String.format("alm:%s", azure.getRawAlm())));
+        tuple(azure.getKey(), String.format("Alm:%s", azure.getRawAlm())));
   }
 
 }