Skip to content

Commit c74283e

Browse files
abeiznaction_bot
authored andcommitted
fix: rename pr size to pr merged size (#7823)
* fix: rename pr size to pr merged size * fix: dashboards version
1 parent ebddfe3 commit c74283e

File tree

3 files changed

+46
-51
lines changed

3 files changed

+46
-51
lines changed

grafana/dashboards/EngineeringThroughputAndCycleTime.json

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"editable": true,
1919
"fiscalYearStartMonth": 0,
2020
"graphTooltip": 0,
21-
"id": 27,
2221
"links": [],
2322
"liveNow": false,
2423
"panels": [
@@ -786,7 +785,7 @@
786785
"axisBorderShow": false,
787786
"axisCenteredZero": false,
788787
"axisColorMode": "text",
789-
"axisLabel": "PR Size",
788+
"axisLabel": "PR Merged Size",
790789
"axisPlacement": "auto",
791790
"barAlignment": 1,
792791
"drawStyle": "line",
@@ -869,7 +868,7 @@
869868
"hide": false,
870869
"metricColumn": "none",
871870
"rawQuery": true,
872-
"rawSql": "with _pr_commits_data as(\n SELECT\n DATE_ADD(date(pr.created_date), INTERVAL -$interval(date(pr.created_date))+1 DAY) as time,\n pr.id as pr_id,\n pr.merge_commit_sha,\n sum(c.additions)+sum(c.deletions) as loc\n FROM \n pull_requests pr\n left join commits c on pr.merge_commit_sha = c.sha\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(pr.created_date)\n and pm.project_name in (${project})\n and pr.status = 'MERGED'\n group by 1,2,3\n)\n\nSELECT \n time,\n sum(loc)/count(distinct pr_id) as 'PR Size'\nFROM _pr_commits_data\nGROUP BY 1",
871+
"rawSql": "with _pr_commits_data as(\n SELECT\n DATE_ADD(date(pr.created_date), INTERVAL -$interval(date(pr.created_date))+1 DAY) as time,\n pr.id as pr_id,\n pr.merge_commit_sha,\n sum(c.additions)+sum(c.deletions) as loc\n FROM \n pull_requests pr\n left join commits c on pr.merge_commit_sha = c.sha\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(pr.created_date)\n and pm.project_name in (${project})\n and pr.status = 'MERGED'\n group by 1,2,3\n)\n\nSELECT \n time,\n sum(loc)/count(distinct pr_id) as 'PR Merged Size'\nFROM _pr_commits_data\nGROUP BY 1",
873872
"refId": "A",
874873
"select": [
875874
[
@@ -910,7 +909,7 @@
910909
]
911910
}
912911
],
913-
"title": "PR Size",
912+
"title": "PR Merged Size",
914913
"type": "timeseries"
915914
},
916915
{
@@ -1104,8 +1103,7 @@
11041103
"mode": "absolute",
11051104
"steps": [
11061105
{
1107-
"color": "green",
1108-
"value": null
1106+
"color": "green"
11091107
}
11101108
]
11111109
}
@@ -1241,8 +1239,7 @@
12411239
"mode": "absolute",
12421240
"steps": [
12431241
{
1244-
"color": "green",
1245-
"value": null
1242+
"color": "green"
12461243
}
12471244
]
12481245
}
@@ -1378,8 +1375,7 @@
13781375
"mode": "absolute",
13791376
"steps": [
13801377
{
1381-
"color": "green",
1382-
"value": null
1378+
"color": "green"
13831379
}
13841380
]
13851381
}
@@ -1546,8 +1542,7 @@
15461542
"mode": "absolute",
15471543
"steps": [
15481544
{
1549-
"color": "green",
1550-
"value": null
1545+
"color": "green"
15511546
}
15521547
]
15531548
}
@@ -1714,8 +1709,7 @@
17141709
"mode": "absolute",
17151710
"steps": [
17161711
{
1717-
"color": "green",
1718-
"value": null
1712+
"color": "green"
17191713
}
17201714
]
17211715
}
@@ -1961,11 +1955,10 @@
19611955
"from": "now-6M",
19621956
"to": "now"
19631957
},
1964-
"timeRangeUpdatedDuringEditOrView": false,
19651958
"timepicker": {},
19661959
"timezone": "",
19671960
"title": "Engineering Throughput and Cycle Time",
19681961
"uid": "Jaaimc67k",
1969-
"version": 2,
1962+
"version": 1,
19701963
"weekStart": ""
19711964
}

grafana/dashboards/EngineeringThroughputAndCycleTimeTeamView.json

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"editable": true,
1919
"fiscalYearStartMonth": 0,
2020
"graphTooltip": 0,
21-
"id": 1,
21+
"id": 9,
2222
"links": [],
2323
"liveNow": false,
2424
"panels": [
@@ -1472,7 +1472,7 @@
14721472
"refId": "A"
14731473
}
14741474
],
1475-
"title": "4. PR Review Depth and PR Size",
1475+
"title": "4. PR Review Depth and PR Merged Size",
14761476
"type": "row"
14771477
},
14781478
{
@@ -1773,7 +1773,7 @@
17731773
"hide": false,
17741774
"metricColumn": "none",
17751775
"rawQuery": true,
1776-
"rawSql": "with _prs as(\n SELECT\n distinct pr.id,\n pr.url,\n pr.created_date,\n pr.merged_date,\n pr.author_id,\n pr.merge_commit_sha,\n c.additions + c.deletions as loc,\n u.id as user_id,\n u.name as user_name,\n t.id as team_id,\n t.name as team\n FROM pull_requests pr\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n left join commits c on pr.merge_commit_sha = c.sha\n join user_accounts ua on pr.author_id = ua.account_id\n join users u on ua.user_id = u.id\n join team_users tu on u.id = tu.user_id\n join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.created_date)\n and pm.project_name in (${project})\n and pr.status = 'MERGED'\n ORDER BY 1\n)\n\nselect\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n sum(case when team_id in (${team1}) then loc else null end)/(select count(distinct user_id) from team_users where team_id in (${team1})) as \"Team1: PR Size\",\n sum(case when team_id in (${team2}) then loc else null end)/(select count(distinct user_id) from team_users where team_id in (${team2})) as \"Team2: PR Size\",\n sum(loc)/(select count(*) FROM users) as \"Org: PR Size\"\nFROM _prs\nGROUP BY 1\nORDER BY 1",
1776+
"rawSql": "with _prs as(\n SELECT\n distinct pr.id,\n pr.url,\n pr.created_date,\n pr.merged_date,\n pr.author_id,\n pr.merge_commit_sha,\n c.additions + c.deletions as loc,\n u.id as user_id,\n u.name as user_name,\n t.id as team_id,\n t.name as team\n FROM pull_requests pr\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n left join commits c on pr.merge_commit_sha = c.sha\n join user_accounts ua on pr.author_id = ua.account_id\n join users u on ua.user_id = u.id\n join team_users tu on u.id = tu.user_id\n join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.created_date)\n and pm.project_name in (${project})\n and pr.status = 'MERGED'\n ORDER BY 1\n)\n\nselect\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n sum(case when team_id in (${team1}) then loc else null end)/(select count(distinct user_id) from team_users where team_id in (${team1})) as \"Team1: PR Size\",\n sum(case when team_id in (${team2}) then loc else null end)/(select count(distinct user_id) from team_users where team_id in (${team2})) as \"Team2: PR Size\",\n sum(loc)/(select count(*) FROM users) as \"Org: PR Merged Size\"\nFROM _prs\nGROUP BY 1\nORDER BY 1",
17771777
"refId": "A",
17781778
"select": [
17791779
[
@@ -1814,7 +1814,7 @@
18141814
]
18151815
}
18161816
],
1817-
"title": " Average PR Size by Team",
1817+
"title": " Average PR Merged Size by Team",
18181818
"type": "timeseries"
18191819
},
18201820
{
@@ -2425,8 +2425,7 @@
24252425
"mode": "absolute",
24262426
"steps": [
24272427
{
2428-
"color": "green",
2429-
"value": null
2428+
"color": "green"
24302429
}
24312430
]
24322431
}
@@ -2593,8 +2592,7 @@
25932592
"mode": "absolute",
25942593
"steps": [
25952594
{
2596-
"color": "green",
2597-
"value": null
2595+
"color": "green"
25982596
}
25992597
]
26002598
}
@@ -2761,8 +2759,7 @@
27612759
"mode": "absolute",
27622760
"steps": [
27632761
{
2764-
"color": "green",
2765-
"value": null
2762+
"color": "green"
27662763
}
27672764
]
27682765
}
@@ -2929,8 +2926,7 @@
29292926
"mode": "absolute",
29302927
"steps": [
29312928
{
2932-
"color": "green",
2933-
"value": null
2929+
"color": "green"
29342930
}
29352931
]
29362932
}
@@ -3123,8 +3119,7 @@
31233119
"mode": "absolute",
31243120
"steps": [
31253121
{
3126-
"color": "green",
3127-
"value": null
3122+
"color": "green"
31283123
}
31293124
]
31303125
}
@@ -3415,11 +3410,10 @@
34153410
"from": "now-6M",
34163411
"to": "now"
34173412
},
3418-
"timeRangeUpdatedDuringEditOrView": false,
34193413
"timepicker": {},
34203414
"timezone": "",
34213415
"title": "Engineering Throughput and Cycle Time - Team View",
34223416
"uid": "nJ1ijje7k",
3423-
"version": 2,
3417+
"version": 1,
34243418
"weekStart": ""
34253419
}

grafana/dashboards/WorkLogs.json

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"editable": true,
1919
"fiscalYearStartMonth": 0,
2020
"graphTooltip": 0,
21-
"id": 40,
21+
"id": 20,
2222
"links": [],
2323
"liveNow": false,
2424
"panels": [
@@ -43,7 +43,7 @@
4343
"content": "- Use Cases: This dashboard shows the work logs of a team or a developer\n- Data Sources Required to show all data: \n - One of the Git tools, e.g. [GitHub](https://devlake.apache.org/docs/Configuration/GitHub), [GitLab](https://devlake.apache.org/docs/Configuration/GitLab), [Bitbucket](https://devlake.apache.org/docs/Configuration/BitBucket) or [Azure DevOps](https://devlake.apache.org/docs/Configuration/AzureDevOps)\n - One of the issue tracking tools, e.g. [Jira](https://devlake.apache.org/docs/Configuration/Jira)\n - You also need to complete the [team configuration](https://devlake.apache.org/docs/Configuration/TeamConfiguration) to use this dashboard",
4444
"mode": "markdown"
4545
},
46-
"pluginVersion": "10.4.1",
46+
"pluginVersion": "11.0.0",
4747
"targets": [
4848
{
4949
"datasource": {
@@ -209,7 +209,7 @@
209209
"showHeader": true,
210210
"sortBy": []
211211
},
212-
"pluginVersion": "10.4.1",
212+
"pluginVersion": "11.0.0",
213213
"targets": [
214214
{
215215
"datasource": "mysql",
@@ -352,7 +352,7 @@
352352
"showHeader": true,
353353
"sortBy": []
354354
},
355-
"pluginVersion": "10.4.1",
355+
"pluginVersion": "11.0.0",
356356
"targets": [
357357
{
358358
"datasource": "mysql",
@@ -780,7 +780,7 @@
780780
"textMode": "auto",
781781
"wideLayout": true
782782
},
783-
"pluginVersion": "10.4.1",
783+
"pluginVersion": "11.0.0",
784784
"targets": [
785785
{
786786
"datasource": "mysql",
@@ -853,7 +853,7 @@
853853
"textMode": "auto",
854854
"wideLayout": true
855855
},
856-
"pluginVersion": "10.4.1",
856+
"pluginVersion": "11.0.0",
857857
"targets": [
858858
{
859859
"datasource": "mysql",
@@ -926,7 +926,7 @@
926926
"textMode": "auto",
927927
"wideLayout": true
928928
},
929-
"pluginVersion": "10.4.1",
929+
"pluginVersion": "11.0.0",
930930
"targets": [
931931
{
932932
"datasource": "mysql",
@@ -999,7 +999,7 @@
999999
"textMode": "auto",
10001000
"wideLayout": true
10011001
},
1002-
"pluginVersion": "10.4.1",
1002+
"pluginVersion": "11.0.0",
10031003
"targets": [
10041004
{
10051005
"datasource": "mysql",
@@ -1194,7 +1194,8 @@
11941194
"mode": "absolute",
11951195
"steps": [
11961196
{
1197-
"color": "green"
1197+
"color": "green",
1198+
"value": null
11981199
}
11991200
]
12001201
},
@@ -1219,17 +1220,18 @@
12191220
"fields": "",
12201221
"values": true
12211222
},
1223+
"showPercentChange": false,
12221224
"textMode": "auto",
12231225
"wideLayout": true
12241226
},
1225-
"pluginVersion": "10.2.6",
1227+
"pluginVersion": "11.0.0",
12261228
"targets": [
12271229
{
12281230
"datasource": "mysql",
12291231
"editorMode": "code",
12301232
"format": "table",
12311233
"rawQuery": true,
1232-
"rawSql": "with _accounts as (\n select ua.account_id, ua.user_id, u.name\n from accounts a \n join user_accounts ua on a.id = ua.account_id\n join users u on ua.user_id = u.id\n where ua.user_id in ($users)\n),\n\n\n_commits as (\n SELECT distinct DATE_FORMAT(authored_date, '%d/%m/%Y') as Date, authored_date as Time, 'Finish a commit' as Activity, concat(message, ' #', sha) as Details, a.name as Name, c.additions, c.deletions, c.sha\n FROM commits c\n join _accounts a on c.author_id = a.account_id\n where $__timeFilter(authored_date)\n),\n\n_pr_commits_data as(\n SELECT\n pr.id as pr_id,\n pr.merge_commit_sha,\n sum(c.additions)+sum(c.deletions) as loc\n FROM \n pull_requests pr\n left join _commits c on pr.merge_commit_sha = c.sha\n WHERE\n $__timeFilter(pr.created_date)\n and pr.status = 'MERGED'\n group by 1,2\n)\n\nSELECT \n avg(loc) as 'PR Size'\nFROM _pr_commits_data\n",
1234+
"rawSql": "with _accounts as (\n select ua.account_id, ua.user_id, u.name\n from accounts a \n join user_accounts ua on a.id = ua.account_id\n join users u on ua.user_id = u.id\n where ua.user_id in ($users)\n),\n\n\n_commits as (\n SELECT distinct DATE_FORMAT(authored_date, '%d/%m/%Y') as Date, authored_date as Time, 'Finish a commit' as Activity, concat(message, ' #', sha) as Details, a.name as Name, c.additions, c.deletions, c.sha\n FROM commits c\n join _accounts a on c.author_id = a.account_id\n where $__timeFilter(authored_date)\n),\n\n_pr_commits_data as(\n SELECT\n pr.id as pr_id,\n pr.merge_commit_sha,\n sum(c.additions)+sum(c.deletions) as loc\n FROM \n pull_requests pr\n left join _commits c on pr.merge_commit_sha = c.sha\n WHERE\n $__timeFilter(pr.created_date)\n and pr.status = 'MERGED'\n group by 1,2\n)\n\nSELECT \n avg(loc) as 'PR Merged Size'\nFROM _pr_commits_data\n",
12331235
"refId": "A",
12341236
"sql": {
12351237
"columns": [
@@ -1250,7 +1252,7 @@
12501252
}
12511253
}
12521254
],
1253-
"title": "Average PR size",
1255+
"title": "Average PR merged size",
12541256
"type": "stat"
12551257
},
12561258
{
@@ -1265,7 +1267,8 @@
12651267
"mode": "absolute",
12661268
"steps": [
12671269
{
1268-
"color": "green"
1270+
"color": "green",
1271+
"value": null
12691272
}
12701273
]
12711274
},
@@ -1290,10 +1293,11 @@
12901293
"fields": "",
12911294
"values": true
12921295
},
1296+
"showPercentChange": false,
12931297
"textMode": "auto",
12941298
"wideLayout": true
12951299
},
1296-
"pluginVersion": "10.2.6",
1300+
"pluginVersion": "11.0.0",
12971301
"targets": [
12981302
{
12991303
"datasource": "mysql",
@@ -1337,7 +1341,8 @@
13371341
"mode": "absolute",
13381342
"steps": [
13391343
{
1340-
"color": "green"
1344+
"color": "green",
1345+
"value": null
13411346
}
13421347
]
13431348
},
@@ -1362,10 +1367,11 @@
13621367
"fields": "",
13631368
"values": true
13641369
},
1370+
"showPercentChange": false,
13651371
"textMode": "auto",
13661372
"wideLayout": true
13671373
},
1368-
"pluginVersion": "10.2.6",
1374+
"pluginVersion": "11.0.0",
13691375
"targets": [
13701376
{
13711377
"datasource": "mysql",
@@ -1407,9 +1413,10 @@
14071413
"list": [
14081414
{
14091415
"current": {
1416+
"isNone": true,
14101417
"selected": false,
1411-
"text": "red",
1412-
"value": "1"
1418+
"text": "None",
1419+
"value": ""
14131420
},
14141421
"datasource": "mysql",
14151422
"definition": "select concat(name, '--', id) from teams",
@@ -1438,6 +1445,7 @@
14381445
},
14391446
"datasource": "mysql",
14401447
"definition": "select concat(users.name, '--', users.id) from users left join team_users on users.id = team_users.user_id where team_users.team_id in ($team)",
1448+
"error": {},
14411449
"hide": 0,
14421450
"includeAll": true,
14431451
"label": "User",
@@ -1461,6 +1469,6 @@
14611469
"timezone": "",
14621470
"title": "Work Logs",
14631471
"uid": "d449042e-22f0-4357-b8b7-22083f47618d",
1464-
"version": 6,
1472+
"version": 1,
14651473
"weekStart": ""
14661474
}

0 commit comments

Comments
 (0)