Startrekzky commented on code in PR #6214:
URL: 
https://github.com/apache/incubator-devlake/pull/6214#discussion_r1356728703


##########
grafana/dashboards/AzureDevOps.json:
##########
@@ -1072,6 +1072,1120 @@
       "title": "2.6 Mean Time to Merge of Pull Requests in Days [Each Month]",
       "type": "barchart"
     },
+    {
+      "collapsed": false,
+      "gridPos": {
+        "h": 1,
+        "w": 24,
+        "x": 0,
+        "y": 35
+      },
+      "id": 108,
+      "panels": [],
+      "title": "3. CICD Metrics",
+      "type": "row"
+    },
+    {
+      "datasource": {
+        "type": "mysql",
+        "uid": "P430005175C4C7810"
+      },
+      "description": "Number of builds executed in the selected time range",
+      "fieldConfig": {
+        "defaults": {
+          "mappings": [],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              }
+            ]
+          }
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 6,
+        "w": 6,
+        "x": 0,
+        "y": 36
+      },
+      "id": 102,
+      "options": {
+        "colorMode": "value",
+        "graphMode": "area",
+        "justifyMode": "auto",
+        "orientation": "auto",
+        "reduceOptions": {
+          "calcs": [
+            "mean"
+          ],
+          "fields": "",
+          "values": false
+        },
+        "text": {},
+        "textMode": "auto"
+      },
+      "pluginVersion": "9.5.2",
+      "targets": [
+        {
+          "datasource": {
+            "type": "mysql",
+            "uid": "P430005175C4C7810"
+          },
+          "editorMode": "code",
+          "format": "table",
+          "group": [],
+          "metricColumn": "none",
+          "rawQuery": true,
+          "rawSql": "SELECT\n  count(*)\nFROM \n  cicd_pipelines\nWHERE\n  
$__timeFilter(finished_date)\n  and result = 'SUCCESS'\n  and id like 
\"%azure%\"\n  and cicd_scope_id in ($job_id)\n  -- the following condition 
will remove the month with incomplete data\n  and finished_date >= 
DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL 
+1 MONTH)",
+          "refId": "A",
+          "select": [
+            [
+              {
+                "params": [
+                  "project_id"
+                ],
+                "type": "column"
+              }
+            ]
+          ],
+          "sql": {
+            "columns": [
+              {
+                "parameters": [],
+                "type": "function"
+              }
+            ],
+            "groupBy": [
+              {
+                "property": {
+                  "type": "string"
+                },
+                "type": "groupBy"
+              }
+            ],
+            "limit": 50
+          },
+          "table": "gitlab_commits",
+          "timeColumn": "created_at",
+          "timeColumnType": "timestamp",
+          "where": [
+            {
+              "name": "$__timeFilter",
+              "params": [],
+              "type": "macro"
+            }
+          ]
+        }
+      ],
+      "title": "3.1 Total Number of Successful Builds [Selected Time Range]",

Review Comment:
   Since it's the Azure DevOps panel, please use the 'pipeline runs' to replace 
all occurrences of 'builds'. 



##########
grafana/dashboards/AzureDevOps.json:
##########
@@ -1072,6 +1072,1120 @@
       "title": "2.6 Mean Time to Merge of Pull Requests in Days [Each Month]",
       "type": "barchart"
     },
+    {
+      "collapsed": false,
+      "gridPos": {
+        "h": 1,
+        "w": 24,
+        "x": 0,
+        "y": 35
+      },
+      "id": 108,
+      "panels": [],
+      "title": "3. CICD Metrics",
+      "type": "row"
+    },
+    {
+      "datasource": {

Review Comment:
   Please replace all occurrences of
   
   ```
   "datasource": {
           "type": "mysql",
           "uid": "P430005175C4C7810"
         },
   ```
   with 
   
   ```
   "datasource": "mysql",
   ```



##########
grafana/dashboards/AzureDevOps.json:
##########
@@ -1143,6 +2257,30 @@
         "skipUrlSync": false,
         "sort": 0,
         "type": "query"
+      },
+      {
+        "current": {
+          "selected": false,
+          "text": 
"azuredevops:GitRepository:1:56dd3f68-3a9c-4353-9aed-c20c1a805524",
+          "value": 
"azuredevops:GitRepository:1:56dd3f68-3a9c-4353-9aed-c20c1a805524"
+        },
+        "datasource": {
+          "type": "mysql",
+          "uid": "P430005175C4C7810"
+        },
+        "definition": "select distinct cicd_scope_id as text from 
cicd_pipelines where id like \"%azure%\" ",
+        "hide": 0,
+        "includeAll": true,
+        "label": "Job Name",

Review Comment:
   The label should also be changed to 'Repo'



##########
grafana/dashboards/AzureDevOps.json:
##########
@@ -1143,6 +2257,30 @@
         "skipUrlSync": false,
         "sort": 0,
         "type": "query"
+      },
+      {
+        "current": {
+          "selected": false,
+          "text": 
"azuredevops:GitRepository:1:56dd3f68-3a9c-4353-9aed-c20c1a805524",
+          "value": 
"azuredevops:GitRepository:1:56dd3f68-3a9c-4353-9aed-c20c1a805524"
+        },
+        "datasource": {
+          "type": "mysql",
+          "uid": "P430005175C4C7810"
+        },
+        "definition": "select distinct cicd_scope_id as text from 
cicd_pipelines where id like \"%azure%\" ",
+        "hide": 0,
+        "includeAll": true,
+        "label": "Job Name",
+        "multi": true,
+        "name": "job_id",

Review Comment:
   I suggest you use `repo_id` instead, because the cicd_scope for Azure is 
actually repos, unlike Jenkins Jobs for Jenkins.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to