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

zky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 7ab423ef5 fix: join condition bug in the dashboard #5590
7ab423ef5 is described below

commit 7ab423ef5306c9f4b1d2cd8c5f88199a6d7d6686
Author: zhoulixiandevlake <[email protected]>
AuthorDate: Mon Jul 3 10:33:11 2023 +0800

    fix: join condition bug in the dashboard #5590
---
 grafana/dashboards/EngineeringOverview.json        | 12 +++++------
 .../EngineeringThroughputAndCycleTime.json         | 18 ++++++++--------
 .../EngineeringThroughputAndCycleTimeTeamView.json | 24 +++++++++++-----------
 3 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/grafana/dashboards/EngineeringOverview.json 
b/grafana/dashboards/EngineeringOverview.json
index 4749fda62..1400646ae 100644
--- a/grafana/dashboards/EngineeringOverview.json
+++ b/grafana/dashboards/EngineeringOverview.json
@@ -833,7 +833,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "select\n  count(*)\nfrom\n  lake.pull_requests pr\n  join 
project_mapping pm on pr.base_repo_id = pm.row_id\nwhere\n  pr.merged_date is 
not null \n  and date(pr.merged_date) between\n    
STR_TO_DATE('$month','%Y-%m-%d')\n  and STR_TO_DATE('$month','%Y-%m-%d') + 
INTERVAL 1 MONTH - INTERVAL 1 DAY \n  and pm.project_name in ($project);",
+          "rawSql": "select\n  count(*)\nfrom\n  lake.pull_requests pr\n  join 
project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' 
\nwhere\n  pr.merged_date is not null \n  and date(pr.merged_date) between\n    
STR_TO_DATE('$month','%Y-%m-%d')\n  and STR_TO_DATE('$month','%Y-%m-%d') + 
INTERVAL 1 MONTH - INTERVAL 1 DAY \n  and pm.project_name in ($project);",
           "refId": "A",
           "select": [
             [
@@ -930,7 +930,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "with _merged_prs as(\n  select\n    
DATE_ADD(date(pr.merged_date), INTERVAL -DAY(date(pr.merged_date))+1 DAY) as 
time,\n    count(*) as pr_merged_count\n  from\n    lake.pull_requests pr\n    
join project_mapping pm on pr.base_repo_id = pm.row_id\n  where\n    
pm.project_name in ($project)\n    and pr.merged_date is not null\n    and 
$__timeFilter(pr.merged_date)\n    and pr.merged_date >= 
DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL 
[...]
+          "rawSql": "with _merged_prs as(\n  select\n    
DATE_ADD(date(pr.merged_date), INTERVAL -DAY(date(pr.merged_date))+1 DAY) as 
time,\n    count(*) as pr_merged_count\n  from\n    lake.pull_requests pr\n    
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.talbe = 'repos' 
\n  where\n    pm.project_name in ($project)\n    and pr.merged_date is not 
null\n    and $__timeFilter(pr.merged_date)\n    and pr.merged_date >= 
DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__time [...]
           "refId": "A",
           "select": [
             [
@@ -1016,7 +1016,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "select \n  100*sum(case when id in (select 
pull_request_id from pull_request_issues) then 1 else 0 end)/count(*) as 
unlinked_pr_rate\nfrom lake.pull_requests pr\njoin project_mapping pm on 
pr.base_repo_id = pm.row_id\nwhere pm.project_name in ($project)",
+          "rawSql": "select \n  100*sum(case when id in (select 
pull_request_id from pull_request_issues) then 1 else 0 end)/count(*) as 
unlinked_pr_rate\nfrom lake.pull_requests pr\njoin project_mapping pm on 
pr.base_repo_id = pm.row_id and pm.table = 'repos' \nwhere pm.project_name in 
($project)",
           "refId": "A",
           "select": [
             [
@@ -1121,7 +1121,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "select\n  DATE_ADD(date(created_date), INTERVAL 
-DAY(date(created_date))+1 DAY) as time,\n  100*sum(case when id in (select 
pull_request_id from pull_request_issues) then 1 else 0 end)/count(*) as 
unlinked_pr_rate\nfrom lake.pull_requests pr\njoin project_mapping pm on 
pr.base_repo_id = pm.row_id\nwhere pm.project_name in ($project)\nand 
$__timeFilter(created_date)\nand created_date >= 
DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL 
+1  [...]
+          "rawSql": "select\n  DATE_ADD(date(created_date), INTERVAL 
-DAY(date(created_date))+1 DAY) as time,\n  100*sum(case when id in (select 
pull_request_id from pull_request_issues) then 1 else 0 end)/count(*) as 
unlinked_pr_rate\nfrom lake.pull_requests pr\njoin project_mapping pm on 
pr.base_repo_id = pm.row_id and pm.talbe = 'repos' \nwhere pm.project_name in 
($project)\nand $__timeFilter(created_date)\nand created_date >= 
DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom [...]
           "refId": "A",
           "select": [
             [
@@ -1392,7 +1392,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "select\n  AVG(TIMESTAMPDIFF(MINUTE, pr.created_date, 
pr.merged_date) / 1440)\nfrom\n  lake.pull_requests pr\n  join project_mapping 
pm on pr.base_repo_id = pm.row_id\nwhere\n  pm.project_name in ($project) and\n 
 pr.merged_date is not null\n  and date(pr.created_date) between\n    
STR_TO_DATE('$month','%Y-%m-%d') \n    and STR_TO_DATE('$month','%Y-%m-%d') + 
INTERVAL 1 MONTH - INTERVAL 1 DAY",
+          "rawSql": "select\n  AVG(TIMESTAMPDIFF(MINUTE, pr.created_date, 
pr.merged_date) / 1440)\nfrom\n  lake.pull_requests pr\n  join project_mapping 
pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \nwhere\n  
pm.project_name in ($project) and\n  pr.merged_date is not null\n  and 
date(pr.created_date) between\n    STR_TO_DATE('$month','%Y-%m-%d') \n    and 
STR_TO_DATE('$month','%Y-%m-%d') + INTERVAL 1 MONTH - INTERVAL 1 DAY",
           "refId": "A",
           "select": [
             [
@@ -1499,7 +1499,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "select\n  DATE_ADD(date(pr.created_date), INTERVAL 
-DAY(date(pr.created_date))+1 DAY) as time,\n  AVG(TIMESTAMPDIFF(MINUTE, 
pr.created_date, pr.merged_date) / 1440) as pr_cycle_time_in_days\nfrom\n  
lake.pull_requests pr\n  join project_mapping pm on pr.base_repo_id = 
pm.row_id\nwhere\n  pm.project_name in ($project) and\n  pr.merged_date is not 
null\n  and $__timeFilter(pr.created_date)\n  and pr.created_date >= 
DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__time [...]
+          "rawSql": "select\n  DATE_ADD(date(pr.created_date), INTERVAL 
-DAY(date(pr.created_date))+1 DAY) as time,\n  AVG(TIMESTAMPDIFF(MINUTE, 
pr.created_date, pr.merged_date) / 1440) as pr_cycle_time_in_days\nfrom\n  
lake.pull_requests pr\n  join project_mapping pm on pr.base_repo_id = pm.row_id 
and pm.table = 'repos' \nwhere\n  pm.project_name in ($project) and\n  
pr.merged_date is not null\n  and $__timeFilter(pr.created_date)\n  and 
pr.created_date >= DATE_ADD(DATE_ADD($__timeFrom( [...]
           "refId": "A",
           "select": [
             [
diff --git a/grafana/dashboards/EngineeringThroughputAndCycleTime.json 
b/grafana/dashboards/EngineeringThroughputAndCycleTime.json
index 4116ffe4d..cadd47d5a 100644
--- a/grafana/dashboards/EngineeringThroughputAndCycleTime.json
+++ b/grafana/dashboards/EngineeringThroughputAndCycleTime.json
@@ -167,7 +167,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "SELECT\n  DATE_ADD(date(pr.created_date), INTERVAL 
-$interval(date(pr.created_date))+1 DAY) as time,\n  count(distinct pr.id) as 
\"PR: Opened\",\n  count(distinct case when pr.merged_date is not null then id 
else null end) as \"PR: Merged\"\nFROM pull_requests pr\n  join project_mapping 
pm on pr.base_repo_id = pm.row_id\nWHERE\n  $__timeFilter(pr.created_date)\n  
and pm.project_name in ($project)\ngroup by 1\n",
+          "rawSql": "SELECT\n  DATE_ADD(date(pr.created_date), INTERVAL 
-$interval(date(pr.created_date))+1 DAY) as time,\n  count(distinct pr.id) as 
\"PR: Opened\",\n  count(distinct case when pr.merged_date is not null then id 
else null end) as \"PR: Merged\"\nFROM pull_requests pr\n  join project_mapping 
pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \nWHERE\n  
$__timeFilter(pr.created_date)\n  and pm.project_name in ($project)\ngroup by 
1\n",
           "refId": "A",
           "select": [
             [
@@ -519,7 +519,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "SELECT\n  DATE_ADD(date(pr.created_date), INTERVAL 
-$interval(date(pr.created_date))+1 DAY) as time,\n  count(distinct 
prc.id)/count(distinct pr.id) as \"PR Review Depth\"\nFROM \n  pull_requests 
pr\n  left join pull_request_comments prc on pr.id = prc.pull_request_id\n  
join project_mapping pm on pr.base_repo_id = pm.row_id\nWHERE\n  
$__timeFilter(pr.created_date)\n  and pm.project_name in ($project)\n  and 
pr.merged_date is not null\ngroup by 1\n",
+          "rawSql": "SELECT\n  DATE_ADD(date(pr.created_date), INTERVAL 
-$interval(date(pr.created_date))+1 DAY) as time,\n  count(distinct 
prc.id)/count(distinct pr.id) as \"PR Review Depth\"\nFROM \n  pull_requests 
pr\n  left join pull_request_comments prc on pr.id = prc.pull_request_id\n  
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' 
\nWHERE\n  $__timeFilter(pr.created_date)\n  and pm.project_name in 
($project)\n  and pr.merged_date is not null\ngroup by 1\n",
           "refId": "A",
           "select": [
             [
@@ -734,7 +734,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "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    prc.commit_sha,\n    
sum(c.additions)+sum(c.deletions) as loc\n  FROM \n    pull_requests pr\n    
left join pull_request_commits prc on pr.id = prc.pull_request_id\n    left 
join commits c on prc.commit_sha = c.sha\n    join project_mapping pm on 
pr.base_repo_id = pm.row_id\n  WHERE\n    $__timeFilter(pr.created [...]
+          "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    prc.commit_sha,\n    
sum(c.additions)+sum(c.deletions) as loc\n  FROM \n    pull_requests pr\n    
left join pull_request_commits prc on pr.id = prc.pull_request_id\n    left 
join commits c on prc.commit_sha = c.sha\n    join project_mapping pm on 
pr.base_repo_id = pm.row_id and pm.table = 'repos' \n  WHERE\n     [...]
           "refId": "A",
           "select": [
             [
@@ -838,7 +838,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "SELECT\n  DATE_ADD(date(pr.created_date), INTERVAL 
-$interval(date(pr.created_date))+1 DAY) as time,\n  sum(case when pr.id not in 
(SELECT pull_request_id FROM pull_request_comments) then 1 else 0 end) as \"PRs 
Merged w/o Review\"\nFROM \n  pull_requests pr\n  join project_mapping pm on 
pr.base_repo_id = pm.row_id\nWHERE\n  $__timeFilter(pr.created_date)\n  and 
pm.project_name in ($project)\n  and pr.merged_date is not null\nGROUP BY 
1\nORDER BY 1",
+          "rawSql": "SELECT\n  DATE_ADD(date(pr.created_date), INTERVAL 
-$interval(date(pr.created_date))+1 DAY) as time,\n  sum(case when pr.id not in 
(SELECT pull_request_id FROM pull_request_comments) then 1 else 0 end) as \"PRs 
Merged w/o Review\"\nFROM \n  pull_requests pr\n  join project_mapping pm on 
pr.base_repo_id = pm.row_id and pm.table = 'repos' \nWHERE\n  
$__timeFilter(pr.created_date)\n  and pm.project_name in ($project)\n  and 
pr.merged_date is not null\nGROUP BY 1\nORDER BY 1",
           "refId": "A",
           "select": [
             [
@@ -987,7 +987,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no cycle_time to make 
sure cycle_time equals the sum of the four metrics 
below\n\t\tcoalesce(prm.pr_cycle_time/60,0) as cycle_time\n  FROM pull_requests 
pr\n    left join project_pr_metrics prm on pr.id = prm.id\n    join 
project_mapping pm on pr.base_repo_id = pm.row_id\n  WHERE\n    
$__timeFilter(pr.created_date)\n    and pr.created_date >= DATE_ADD(DAT [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no cycle_time to make 
sure cycle_time equals the sum of the four metrics 
below\n\t\tcoalesce(prm.pr_cycle_time/60,0) as cycle_time\n  FROM pull_requests 
pr\n    left join project_pr_metrics prm on pr.id = prm.id\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 pr.crea [...]
           "refId": "A",
           "select": [
             [
@@ -1091,7 +1091,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no coding_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_coding_time/60,0) as coding_time\n  FROM 
pull_requests pr\n    left join project_pr_metrics prm on pr.id = prm.id\n    
join project_mapping pm on pr.base_repo_id = pm.row_id\n  WHERE\n    
$__timeFilter(pr.created_date)\n    and pr.created_date >= DATE_ADD(DA [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no coding_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_coding_time/60,0) as coding_time\n  FROM 
pull_requests pr\n    left join project_pr_metrics prm on pr.id = prm.id\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 pr.cre [...]
           "refId": "A",
           "select": [
             [
@@ -1226,7 +1226,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no pickup_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_pickup_time/60,0) as pickup_time\n  FROM 
pull_requests pr\n    left join project_pr_metrics prm on pr.id = prm.id\n    
join project_mapping pm on pr.base_repo_id = pm.row_id\n  WHERE\n    
$__timeFilter(pr.created_date)\n    and pr.created_date >= DATE_ADD(DA [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no pickup_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_pickup_time/60,0) as pickup_time\n  FROM 
pull_requests pr\n    left join project_pr_metrics prm on pr.id = prm.id\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 pr.cre [...]
           "refId": "A",
           "select": [
             [
@@ -1361,7 +1361,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no review_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_review_time/60,0) as review_time\n  FROM 
pull_requests pr\n    left join project_pr_metrics prm on pr.id = prm.id\n    
join project_mapping pm on pr.base_repo_id = pm.row_id\n  WHERE\n    
$__timeFilter(pr.created_date)\n    and pr.created_date >= DATE_ADD(DA [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no review_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_review_time/60,0) as review_time\n  FROM 
pull_requests pr\n    left join project_pr_metrics prm on pr.id = prm.id\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 pr.cre [...]
           "refId": "A",
           "select": [
             [
@@ -1496,7 +1496,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no deploy_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_deploy_time/60,0) as deploy_time\n  FROM 
pull_requests pr\n    left join project_pr_metrics prm on pr.id = prm.id\n    
join project_mapping pm on pr.base_repo_id = pm.row_id\n  WHERE\n    
$__timeFilter(pr.created_date)\n    and pr.created_date >= DATE_ADD(DA [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no deploy_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_deploy_time/60,0) as deploy_time\n  FROM 
pull_requests pr\n    left join project_pr_metrics prm on pr.id = prm.id\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 pr.cre [...]
           "refId": "A",
           "select": [
             [
diff --git a/grafana/dashboards/EngineeringThroughputAndCycleTimeTeamView.json 
b/grafana/dashboards/EngineeringThroughputAndCycleTimeTeamView.json
index dad862bf8..04fdc8cf2 100644
--- a/grafana/dashboards/EngineeringThroughputAndCycleTimeTeamView.json
+++ b/grafana/dashboards/EngineeringThroughputAndCycleTimeTeamView.json
@@ -167,7 +167,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.url,\n    
pr.created_date,\n    pr.merged_date,\n    pr.author_id,\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 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    join 
project_mapping pm on pr.base_repo_id = pm.row_id\n   [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.url,\n    
pr.created_date,\n    pr.merged_date,\n    pr.author_id,\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 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    join 
project_mapping pm on pr.base_repo_id = pm.row_id and [...]
           "refId": "A",
           "select": [
             [
@@ -305,7 +305,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.url,\n    
pr.created_date,\n    pr.merged_date,\n    pr.author_id,\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\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   [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.url,\n    
pr.created_date,\n    pr.merged_date,\n    pr.author_id,\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    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  [...]
           "refId": "A",
           "select": [
             [
@@ -443,7 +443,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.url,\n    
pr.created_date,\n    pr.merged_date,\n    pr.author_id,\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\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   [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.url,\n    
pr.created_date,\n    pr.merged_date,\n    pr.author_id,\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    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  [...]
           "refId": "A",
           "select": [
             [
@@ -581,7 +581,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.url,\n    
pr.created_date,\n    pr.merged_date,\n    pr.author_id,\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\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   [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.url,\n    
pr.created_date,\n    pr.merged_date,\n    pr.author_id,\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    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  [...]
           "refId": "A",
           "select": [
             [
@@ -1313,7 +1313,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _merged_prs as(\n  SELECT\n    pr.id,\n    pr.url,\n 
   pr.created_date,\n    pr.merged_date,\n    pr.author_id,\n    prc.id as 
comment_id,\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\n    left join pull_request_comments prc on 
pr.id = prc.pull_request_id\n    join user_accounts ua on pr.author_id = 
ua.account_id\n    join users u on [...]
+          "rawSql": "with _merged_prs as(\n  SELECT\n    pr.id,\n    pr.url,\n 
   pr.created_date,\n    pr.merged_date,\n    pr.author_id,\n    prc.id as 
comment_id,\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 
pull_request_comments prc on pr.id = prc.pull_request_id\n    join 
user_accounts ua on pr.author_id = ua.account [...]
           "refId": "A",
           "select": [
             [
@@ -1451,7 +1451,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.url,\n    
pr.created_date,\n    pr.merged_date,\n    pr.author_id,\n    prc.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\n    left join 
pull_request_commits prc on pr.id = prc.pull_request_id\n    left join commits 
c on prc.commit_sha = c.sha\n   [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.url,\n    
pr.created_date,\n    pr.merged_date,\n    pr.author_id,\n    prc.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 pull_request_commits prc on pr.id = 
prc.pull_request_id\n    left join commits c on pr [...]
           "refId": "A",
           "select": [
             [
@@ -1890,7 +1890,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no cycle_time to make 
sure cycle_time equals the sum of the four metrics 
below\n\t\tcoalesce(prm.pr_cycle_time/60,0) as cycle_time,\n\t\tpr.author_id,\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\n\t\tleft join project_pr_metri [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no cycle_time to make 
sure cycle_time equals the sum of the four metrics 
below\n\t\tcoalesce(prm.pr_cycle_time/60,0) as cycle_time,\n\t\tpr.author_id,\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\t\tle [...]
           "refId": "A",
           "select": [
             [
@@ -2025,7 +2025,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no coding_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_coding_time/60,0) as 
coding_time,\n\t\tpr.author_id,\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\n\t\tleft join 
project_pr_metr [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no coding_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_coding_time/60,0) as 
coding_time,\n\t\tpr.author_id,\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\t\tl [...]
           "refId": "A",
           "select": [
             [
@@ -2160,7 +2160,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no pickup_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_pickup_time/60,0) as 
pickup_time,\n\t\tpr.author_id,\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\n\t\tleft join 
project_pr_metr [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no pickup_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_pickup_time/60,0) as 
pickup_time,\n\t\tpr.author_id,\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\t\tl [...]
           "refId": "A",
           "select": [
             [
@@ -2295,7 +2295,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no review_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_review_time/60,0) as 
review_time,\n\t\tpr.author_id,\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\n\t\tleft join 
project_pr_metr [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no review_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_review_time/60,0) as 
review_time,\n\t\tpr.author_id,\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\t\tl [...]
           "refId": "A",
           "select": [
             [
@@ -2430,7 +2430,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no deploy_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_deploy_time/60,0) as 
deploy_time,\n\t\tpr.author_id,\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\n\t\tleft join 
project_pr_metr [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.created_date 
as pr_issued_date,\n    -- convert null to 0 if a PR has no deploy_time to make 
sure cycle_time equals the sum of the four 
sub-metrics\n\t\tcoalesce(prm.pr_deploy_time/60,0) as 
deploy_time,\n\t\tpr.author_id,\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\t\tl [...]
           "refId": "A",
           "select": [
             [
@@ -2579,7 +2579,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _merged_prs as(\n  SELECT\n    pr.id,\n    pr.url,\n 
   pr.created_date,\n    pr.merged_date,\n    pr.author_id,\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\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 [...]
+          "rawSql": "with _merged_prs as(\n  SELECT\n    pr.id,\n    pr.url,\n 
   pr.created_date,\n    pr.merged_date,\n    pr.author_id,\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    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 t [...]
           "refId": "A",
           "select": [
             [

Reply via email to