You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by li...@apache.org on 2022/10/13 12:55:13 UTC

[incubator-devlake] branch release-v0.14 updated (07d05896 -> 779e87ca)

This is an automated email from the ASF dual-hosted git repository.

likyh pushed a change to branch release-v0.14
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


    from 07d05896 fix(tapd): fix minor issues
     new ed871465 fix: display curl in the webhook page (#3406)
     new 779e87ca fix(config-ui): adjust the text description for DORA (#3413)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../blueprints/transformations/CICD/Deployment.jsx | 64 ++++++++++++----------
 .../connections/incoming-webhook/add-modal.jsx     |  8 +--
 .../pages/connections/incoming-webhook/index.jsx   |  6 +-
 .../pages/connections/incoming-webhook/styled.js   |  7 ++-
 .../incoming-webhook/view-or-edit-modal.jsx        |  2 +-
 5 files changed, 48 insertions(+), 39 deletions(-)


[incubator-devlake] 01/02: fix: display curl in the webhook page (#3406)

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

likyh pushed a commit to branch release-v0.14
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit ed87146572611c89f87f7f15de01465e0574821c
Author: Likyh <l...@likyh.com>
AuthorDate: Thu Oct 13 19:09:20 2022 +0800

    fix: display curl in the webhook page (#3406)
    
    * fix: display curl in webhook page
    
    * fix: fix style
    
    * fix: fix curl content
    
    * fix: fix for lint
    
    * fix: fix for review
    
    * fix: fix for review
    
    Co-authored-by: linyh <ya...@meri.co>
---
 config-ui/src/pages/connections/incoming-webhook/add-modal.jsx    | 8 ++++----
 config-ui/src/pages/connections/incoming-webhook/index.jsx        | 6 +++---
 config-ui/src/pages/connections/incoming-webhook/styled.js        | 7 +++++--
 .../src/pages/connections/incoming-webhook/view-or-edit-modal.jsx | 2 +-
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/config-ui/src/pages/connections/incoming-webhook/add-modal.jsx b/config-ui/src/pages/connections/incoming-webhook/add-modal.jsx
index 7030feac..943976f2 100644
--- a/config-ui/src/pages/connections/incoming-webhook/add-modal.jsx
+++ b/config-ui/src/pages/connections/incoming-webhook/add-modal.jsx
@@ -55,9 +55,9 @@ export const AddModal = ({ onSubmit, onCancel }) => {
       postIssuesEndpoint: `${postUrlPrefix}${res.postIssuesEndpoint}`,
       closeIssuesEndpoint: `${postUrlPrefix}${res.closeIssuesEndpoint}`,
       postDeploymentsCurl: `curl ${postUrlPrefix}${res.postPipelineDeployTaskEndpoint} -X 'POST' -d "{
-  \\"repo_url\\":\\"$CIRCLE_REPOSITORY_URL\\",
-  \\"commit_sha\\":\\"$CIRCLE_SHA1\\",
-  \\"start_time\\":\\"$start_time\\"
+  \\"commit_sha\\":\\"the sha of deployment commit\\",
+  \\"repo_url\\":\\"the repo URL of the deployment commit\\",
+  \\"start_time\\":\\"Optional, eg. 2020-01-01T12:00:00+00:00\\"
 }"`
     })
   }
@@ -142,7 +142,7 @@ export const AddModal = ({ onSubmit, onCancel }) => {
               <h3>Deployment</h3>
               <p>POST to register a deployment</p>
               <div className='block'>
-                <span style={{ flex: '1 0' }}>{record.postDeploymentsCurl}</span>
+                <span>{record.postDeploymentsCurl}</span>
                 <CopyToClipboard text={record.postDeploymentsCurl}>
                   <CopyIcon width={16} height={16} />
                 </CopyToClipboard>
diff --git a/config-ui/src/pages/connections/incoming-webhook/index.jsx b/config-ui/src/pages/connections/incoming-webhook/index.jsx
index f10cd75f..70214f7a 100644
--- a/config-ui/src/pages/connections/incoming-webhook/index.jsx
+++ b/config-ui/src/pages/connections/incoming-webhook/index.jsx
@@ -54,9 +54,9 @@ export const IncomingWebhook = () => {
             postIssuesEndpoint: `${postUrlPrefix}${r.postIssuesEndpoint}`,
             closeIssuesEndpoint: `${postUrlPrefix}${r.closeIssuesEndpoint}`,
             postDeploymentsCurl: `curl ${postUrlPrefix}${r.postPipelineDeployTaskEndpoint} -X 'POST' -d "{
-  \\"repo_url\\":\\"$CIRCLE_REPOSITORY_URL\\",
-  \\"commit_sha\\":\\"$CIRCLE_SHA1\\",
-  \\"start_time\\":\\"$start_time\\"
+  \\"commit_sha\\":\\"the sha of deployment commit\\",
+  \\"repo_url\\":\\"the repo URL of the deployment commit\\",
+  \\"start_time\\":\\"Optional, eg. 2020-01-01T12:00:00+00:00\\"
 }"`
           }
         : existingRecord
diff --git a/config-ui/src/pages/connections/incoming-webhook/styled.js b/config-ui/src/pages/connections/incoming-webhook/styled.js
index e97baeae..91e4d47f 100644
--- a/config-ui/src/pages/connections/incoming-webhook/styled.js
+++ b/config-ui/src/pages/connections/incoming-webhook/styled.js
@@ -143,10 +143,13 @@ export const FormWrapper = styled.div`
       display: flex;
       align-items: center;
       justify-content: space-between;
-      padding: 0 10px;
-      height: 38px;
+      padding: 10px;
       background-color: #f0f4fe;
 
+      & > span {
+        flex: 1 0;
+      }
+
       & > svg {
         cursor: pointer;
       }
diff --git a/config-ui/src/pages/connections/incoming-webhook/view-or-edit-modal.jsx b/config-ui/src/pages/connections/incoming-webhook/view-or-edit-modal.jsx
index fd63ffa6..32ede9ce 100644
--- a/config-ui/src/pages/connections/incoming-webhook/view-or-edit-modal.jsx
+++ b/config-ui/src/pages/connections/incoming-webhook/view-or-edit-modal.jsx
@@ -119,7 +119,7 @@ export const ViewOrEditModal = ({ record, onSubmit, onCancel }) => {
           <h3>Deployment</h3>
           <p>POST to register a deployment</p>
           <div className='block'>
-            <span style={{ flex: '1 0' }}>{record.postDeploymentsCurl}</span>
+            <span>{record.postDeploymentsCurl}</span>
             <CopyToClipboard text={record.postDeploymentsCurl}>
               <CopyIcon width={16} height={16} />
             </CopyToClipboard>


[incubator-devlake] 02/02: fix(config-ui): adjust the text description for DORA (#3413)

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

likyh pushed a commit to branch release-v0.14
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 779e87cab90c12a21895062e570233e97c96297c
Author: 青湛 <0x...@gmail.com>
AuthorDate: Thu Oct 13 19:11:41 2022 +0800

    fix(config-ui): adjust the text description for DORA (#3413)
---
 .../blueprints/transformations/CICD/Deployment.jsx | 64 ++++++++++++----------
 1 file changed, 35 insertions(+), 29 deletions(-)

diff --git a/config-ui/src/components/blueprints/transformations/CICD/Deployment.jsx b/config-ui/src/components/blueprints/transformations/CICD/Deployment.jsx
index 575a6604..ef5aa8c2 100644
--- a/config-ui/src/components/blueprints/transformations/CICD/Deployment.jsx
+++ b/config-ui/src/components/blueprints/transformations/CICD/Deployment.jsx
@@ -63,24 +63,6 @@ const Deployment = (props) => {
     setSelectValue(sv)
   }
 
-  // @todo: check w/ product team about using standard message and avoid customized hints
-  const getDeployTagHint = (providerId, providerName = 'Plugin') => {
-    let tagHint = ''
-    switch (providerId) {
-      case Providers.JENKINS:
-        // eslint-disable-next-line max-len
-        tagHint = `The ${providerName} build with a name that matches the given regEx is considered as a deployment. You can define your Deployments for three environments: Production, Staging and Testing.`
-        break
-      case Providers.GITHUB:
-      case Providers.GITLAB:
-      case 'default':
-        // eslint-disable-next-line max-len
-        tagHint = `A CI job/build with a name that matches the given regEx is considered as a Deployment.`
-        break
-    }
-    return tagHint
-  }
-
   const radioLabels = useMemo(() => {
     let radio1
     let radio2
@@ -106,6 +88,39 @@ const Deployment = (props) => {
     return [radio1, radio2]
   }, [provider])
 
+  const tagHints = useMemo(() => {
+    let hint1
+    let hint2
+
+    const providerId = provider?.id
+
+    switch (providerId) {
+      case Providers.JENKINS:
+        hint1 =
+          'A Jenkins build with a name that matches the given regEx will be considered as a Deployment.'
+        hint2 =
+          // eslint-disable-next-line max-len
+          'A Jenkins build that matches the given regEx will be considered as a build in the Production environment. If you leave this field empty, all data will be tagged as in the Production environment.'
+        break
+      case Providers.GITHUB:
+        hint1 =
+          'A GitHub Action job with a name that matches the given regEx will be considered as a Deployment.'
+        hint2 =
+          // eslint-disable-next-line max-len
+          'A GitHub Action job that matches the given regEx will be considered as a job in the Production environment. If you leave this field empty, all data will be tagged as in the Production environment.'
+        break
+      case Providers.GITLAB:
+        hint1 =
+          'A GitLab CI job with a name that matches the given regEx will be considered as a Deployment.'
+        hint2 =
+          // eslint-disable-next-line max-len
+          'A GitLab CI job that matches the given regEx will be considered as a job in the Production environment. If you leave this field empty, all data will be tagged as in the Production environment.'
+        break
+    }
+
+    return [hint1, hint2]
+  }, [provider])
+
   return (
     <>
       <h5>CI/CD</h5>
@@ -127,12 +142,7 @@ const Deployment = (props) => {
         <Radio label={radioLabels[0]} value={1} />
         {selectValue === 1 && (
           <>
-            <p>
-              {getDeployTagHint(
-                provider?.id,
-                ProviderLabels[provider?.id?.toUpperCase()]
-              )}
-            </p>
+            <p>{tagHints[0]}</p>
             <div className='formContainer'>
               <FormGroup
                 disabled={isSaving}
@@ -165,11 +175,7 @@ const Deployment = (props) => {
                 />
               </FormGroup>
             </div>
-            <p>
-              The environment that matches the given regEx is considered as the
-              Production environment. If you leave this field empty, all data
-              will be tagged as in the Production environment.
-            </p>
+            <p>{tagHints[1]}</p>
             <FormGroup
               disabled={isSaving}
               inline={true}