]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15322 Fix DevOps platform field's max length disprecancies
authorPhilippe Perrin <philippe.perrin@sonarsource.com>
Tue, 31 Aug 2021 12:40:23 +0000 (14:40 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 31 Aug 2021 20:07:04 +0000 (20:07 +0000)
12 files changed:
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AzureForm.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketCloudForm.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/BitbucketServerForm.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/GithubForm.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/GitlabForm.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AzureForm-test.tsx.snap
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/BitbucketCloudForm-test.tsx.snap
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/BitbucketServerForm-test.tsx.snap
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/GithubForm-test.tsx.snap
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/GitlabForm-test.tsx.snap
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/CreateGithubAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/UpdateBitbucketCloudAction.java

index 128f260f341ce6c0df09785728af125e8a30c7cf..cedafcad2dd4a5848306c67c3d88381bcf0e61ee 100644 (file)
@@ -42,6 +42,7 @@ export default function AzureForm(props: AzureFormProps) {
         onFieldChange={onFieldChange}
         propKey="key"
         value={formData.key}
+        maxLength={200}
       />
       <AlmBindingDefinitionFormField
         help={
index f6d08382860a3a635f60a1216f67472c560846cc..70bd049cae4a8087f1c977b83b2863de863b9aa8 100644 (file)
@@ -41,7 +41,7 @@ export default function BitbucketCloudForm(props: BitbucketCloudFormProps) {
         autoFocus={true}
         help={translate('settings.almintegration.form.name.bitbucketcloud.help')}
         id="name.bitbucket"
-        maxLength={100}
+        maxLength={200}
         onFieldChange={props.onFieldChange}
         propKey="key"
         value={formData.key || ''}
@@ -63,7 +63,7 @@ export default function BitbucketCloudForm(props: BitbucketCloudFormProps) {
           />
         }
         id="workspace.bitbucketcloud"
-        maxLength={2000}
+        maxLength={80}
         onFieldChange={props.onFieldChange}
         propKey="workspace"
         value={formData.workspace || ''}
@@ -96,6 +96,7 @@ export default function BitbucketCloudForm(props: BitbucketCloudFormProps) {
         onFieldChange={props.onFieldChange}
         propKey="clientId"
         value={formData.clientId || ''}
+        maxLength={80}
       />
       <AlmBindingDefinitionFormField
         id="client_secret.bitbucketcloud"
index 9779db9e32964960993fe55fe88c207560ea41e2..eee252e45e0dd7ff32d022829b03b6dd5b0b1662 100644 (file)
@@ -40,7 +40,7 @@ export default function BitbucketServerForm(props: BitbucketServerFormProps) {
         autoFocus={true}
         help={translate('settings.almintegration.form.name.bitbucket.help')}
         id="name.bitbucket"
-        maxLength={100}
+        maxLength={200}
         onFieldChange={props.onFieldChange}
         propKey="key"
         value={formData.key || ''}
index a94593e57aa738e3eca1c97d590833d00f2fe221..a5cf1cd36ef200145e6dcc83bd8b6e5da830405f 100644 (file)
@@ -43,6 +43,7 @@ export default function GithubForm(props: GithubFormProps) {
         onFieldChange={onFieldChange}
         propKey="key"
         value={formData.key}
+        maxLength={200}
       />
       <AlmBindingDefinitionFormField
         help={
index 015fbc581aaf0f44fe47333bc5e2255d50cffaa3..f519e9edb8b55516296ef885af285b5b2ddd1461 100644 (file)
@@ -42,6 +42,7 @@ export default function GitlabForm(props: GitlabFormProps) {
         onFieldChange={onFieldChange}
         propKey="key"
         value={formData.key}
+        maxLength={200}
       />
       <AlmBindingDefinitionFormField
         help={
index d03d8b8f90a1234c98cb7cc072025409fa677d15..a13b6b6ead19d518c853eab90a7e1ab81bd6f6da 100644 (file)
@@ -6,6 +6,7 @@ exports[`should render correctly: create 1`] = `
     autoFocus={true}
     help="settings.almintegration.form.name.azure.help"
     id="name.azure"
+    maxLength={200}
     onFieldChange={[MockFunction]}
     propKey="key"
     value=""
@@ -80,6 +81,7 @@ exports[`should render correctly: edit 1`] = `
     autoFocus={true}
     help="settings.almintegration.form.name.azure.help"
     id="name.azure"
+    maxLength={200}
     onFieldChange={[MockFunction]}
     propKey="key"
     value="key"
index 4fd3e07e4fa58aec31a122e3a3aa3d3123c00963..2bf6f6b524407657dd519213721c319beb4d75ab 100644 (file)
@@ -6,7 +6,7 @@ exports[`should render correctly 1`] = `
     autoFocus={true}
     help="settings.almintegration.form.name.bitbucketcloud.help"
     id="name.bitbucket"
-    maxLength={100}
+    maxLength={200}
     onFieldChange={[MockFunction]}
     propKey="key"
     value="key"
@@ -30,7 +30,7 @@ exports[`should render correctly 1`] = `
       />
     }
     id="workspace.bitbucketcloud"
-    maxLength={2000}
+    maxLength={80}
     onFieldChange={[MockFunction]}
     propKey="workspace"
     value="workspace"
@@ -69,6 +69,7 @@ exports[`should render correctly 1`] = `
   <AlmBindingDefinitionFormField
     help="settings.almintegration.form.oauth_key.bitbucketcloud.help"
     id="client_id.bitbucketcloud"
+    maxLength={80}
     onFieldChange={[MockFunction]}
     propKey="clientId"
     value="client1"
index 168036c2123585ab95acaae1bd59196014d54a9b..f8bf5e2ce02ca8103e9d66286a1ff32c92a7f6e4 100644 (file)
@@ -6,7 +6,7 @@ exports[`should render correctly 1`] = `
     autoFocus={true}
     help="settings.almintegration.form.name.bitbucket.help"
     id="name.bitbucket"
-    maxLength={100}
+    maxLength={200}
     onFieldChange={[MockFunction]}
     propKey="key"
     value="key"
index 2eaa2b199955954a40c20aaab1d5f1018c0cab2a..e921eb46af90f0280f6c0b6a23b120ccc5e4faed 100644 (file)
@@ -6,6 +6,7 @@ exports[`should render correctly 1`] = `
     autoFocus={true}
     help="settings.almintegration.form.name.github.help"
     id="name.github"
+    maxLength={200}
     onFieldChange={[MockFunction]}
     propKey="key"
     value=""
@@ -100,6 +101,7 @@ exports[`should render correctly 2`] = `
     autoFocus={true}
     help="settings.almintegration.form.name.github.help"
     id="name.github"
+    maxLength={200}
     onFieldChange={[MockFunction]}
     propKey="key"
     value="key"
index 33452300e00e952fc9217e569aff7ad898d40eab..335a2f039bcdce56abae1c8d8324879ce624db3a 100644 (file)
@@ -6,6 +6,7 @@ exports[`should render correctly 1`] = `
     autoFocus={true}
     help="settings.almintegration.form.name.gitlab.help"
     id="name.gitlab"
+    maxLength={200}
     onFieldChange={[MockFunction]}
     propKey="key"
     value=""
@@ -76,6 +77,7 @@ exports[`should render correctly 2`] = `
     autoFocus={true}
     help="settings.almintegration.form.name.gitlab.help"
     id="name.gitlab"
+    maxLength={200}
     onFieldChange={[MockFunction]}
     propKey="key"
     value="foo"
index f1b6c1b295ca4511252e798ee948fe41738e6c1a..4a0a86c16eaf46d6509133557ddaabcc6858870f 100644 (file)
@@ -72,7 +72,7 @@ public class CreateGithubAction implements AlmSettingsWsAction {
       .setDescription("GitHub App ID");
     action.createParam(PARAM_PRIVATE_KEY)
       .setRequired(true)
-      .setMaximumLength(2000)
+      .setMaximumLength(2500)
       .setDescription("GitHub App private key");
     action.createParam(PARAM_CLIENT_ID)
       .setRequired(true)
@@ -80,7 +80,7 @@ public class CreateGithubAction implements AlmSettingsWsAction {
       .setDescription("GitHub App Client ID");
     action.createParam(PARAM_CLIENT_SECRET)
       .setRequired(true)
-      .setMaximumLength(80)
+      .setMaximumLength(160)
       .setDescription("GitHub App Client Secret");
   }
 
index 1141bc58b2a5ba0fc0e4d79d1d781d6e102c0702..f62d751520708bfde713d3fa919504fc6e970570 100644 (file)
@@ -66,14 +66,15 @@ public class UpdateBitbucketCloudAction implements AlmSettingsWsAction {
       .setDescription("Optional new value for an unique key of the Bitbucket Cloud setting");
     action.createParam(PARAM_WORKSPACE)
       .setRequired(true)
+      .setMaximumLength(80)
       .setDescription("Bitbucket Cloud workspace ID");
     action.createParam(PARAM_CLIENT_ID)
       .setRequired(true)
-      .setMaximumLength(2000)
+      .setMaximumLength(80)
       .setDescription("Bitbucket Cloud Client ID");
     action.createParam(PARAM_CLIENT_SECRET)
       .setRequired(false)
-      .setMaximumLength(2000)
+      .setMaximumLength(160)
       .setDescription("Optional new value for the Bitbucket Cloud client secret");
   }