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 49d9ffcfc fix(grafana): remove extra date condition that is applied 
together with $__timeFilter(date) (#8147)
49d9ffcfc is described below

commit 49d9ffcfc5d86699576b25d1979d72c4b7c04bbb
Author: Volodymyr Shulga <[email protected]>
AuthorDate: Mon Oct 21 11:42:07 2024 +0300

    fix(grafana): remove extra date condition that is applied together with 
$__timeFilter(date) (#8147)
    
    Co-authored-by: Volodymyr Shulga <[email protected]>
---
 grafana/dashboards/DORADetails-LeadTimeforChanges.json   | 10 +++++-----
 grafana/dashboards/EngineeringOverview.json              | 16 ++++++++--------
 .../dashboards/EngineeringThroughputAndCycleTime.json    | 10 +++++-----
 grafana/dashboards/WorkLogs.json                         |  2 +-
 4 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/grafana/dashboards/DORADetails-LeadTimeforChanges.json 
b/grafana/dashboards/DORADetails-LeadTimeforChanges.json
index 5fa6fc7de..557aad180 100644
--- a/grafana/dashboards/DORADetails-LeadTimeforChanges.json
+++ b/grafana/dashboards/DORADetails-LeadTimeforChanges.json
@@ -131,7 +131,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 and pm.table = 'repos' \n  
WHERE\n    $__timeFilter(pr.created_date)\n    and pr.crea [...]
+          "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 pm.proj [...]
           "refId": "A",
           "select": [
             [
@@ -236,7 +236,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 and pm.table = 'repos' 
\n  WHERE\n    $__timeFilter(pr.created_date)\n    and pr.cre [...]
+          "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 pm.pro [...]
           "refId": "A",
           "select": [
             [
@@ -372,7 +372,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 and pm.table = 'repos' 
\n  WHERE\n    $__timeFilter(pr.created_date)\n    and pr.cre [...]
+          "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 pm.pro [...]
           "refId": "A",
           "select": [
             [
@@ -508,7 +508,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 and pm.table = 'repos' 
\n  WHERE\n    $__timeFilter(pr.created_date)\n    and pr.cre [...]
+          "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 pm.pro [...]
           "refId": "A",
           "select": [
             [
@@ -644,7 +644,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 and pm.table = 'repos' 
\n  WHERE\n    $__timeFilter(pr.created_date)\n    and pr.cre [...]
+          "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 pm.pro [...]
           "refId": "A",
           "select": [
             [
diff --git a/grafana/dashboards/EngineeringOverview.json 
b/grafana/dashboards/EngineeringOverview.json
index e2e6cdede..e105eca57 100644
--- a/grafana/dashboards/EngineeringOverview.json
+++ b/grafana/dashboards/EngineeringOverview.json
@@ -253,7 +253,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "with _issues as(\n  select\n    
DATE_ADD(date(i.created_date), INTERVAL -DAY(date(i.created_date))+1 DAY) as 
time,\n    count(distinct i.id) as defect_count\n  from\n    issues i\n    join 
board_issues bi on i.id = bi.issue_id\n\t  join boards b on bi.board_id = 
b.id\n\t  join project_mapping pm on b.id = pm.row_id\n  where\n    
pm.project_name in (${project}) and\n    i.priority in (${priority})\n    and 
i.type = 'BUG'\n    and $__timeFilter(i.created_date)\n    and [...]
+          "rawSql": "with _issues as(\n  select\n    
DATE_ADD(date(i.created_date), INTERVAL -DAY(date(i.created_date))+1 DAY) as 
time,\n    count(distinct i.id) as defect_count\n  from\n    issues i\n    join 
board_issues bi on i.id = bi.issue_id\n\t  join boards b on bi.board_id = 
b.id\n\t  join project_mapping pm on b.id = pm.row_id\n  where\n    
pm.project_name in (${project}) and\n    i.priority in (${priority})\n    and 
i.type = 'BUG'\n    and $__timeFilter(i.created_date)\n  group [...]
           "refId": "A",
           "select": [
             [
@@ -502,7 +502,7 @@
           "group": [],
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _issues as(\n  SELECT\n    
DATE_ADD(date(i.resolution_date), INTERVAL -DAY(date(i.resolution_date))+1 DAY) 
as time,\n    AVG(i.lead_time_minutes/1440) as issue_lead_time\n  FROM issues 
i\n\t  join board_issues bi on i.id = bi.issue_id\n\t  join boards b on 
bi.board_id = b.id\n\t  join project_mapping pm on b.id = pm.row_id\n  WHERE\n  
  pm.project_name in (${project})\n    and i.status = \"DONE\"\n    and 
$__timeFilter(i.resolution_date)\n    and i.resolution_da [...]
+          "rawSql": "with _issues as(\n  SELECT\n    
DATE_ADD(date(i.resolution_date), INTERVAL -DAY(date(i.resolution_date))+1 DAY) 
as time,\n    AVG(i.lead_time_minutes/1440) as issue_lead_time\n  FROM issues 
i\n\t  join board_issues bi on i.id = bi.issue_id\n\t  join boards b on 
bi.board_id = b.id\n\t  join project_mapping pm on b.id = pm.row_id\n  WHERE\n  
  pm.project_name in (${project})\n    and i.status = \"DONE\"\n    and 
$__timeFilter(i.resolution_date)\n  group by 1\n)\n\nSELE [...]
           "refId": "A",
           "select": [
             [
@@ -725,7 +725,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "with _developers as(\n  select\n    
DATE_ADD(date(c.authored_date), INTERVAL -DAY(date(c.authored_date))+1 DAY) as 
time,\n    count(distinct author_name) as developer_count\n  from\n    commits 
c\n    join repo_commits rc on c.sha = rc.commit_sha\n    join project_mapping 
pm on rc.repo_id = pm.row_id and pm.table = 'repos' \n  where\n    
$__timeFilter(c.authored_date)\n    and c.authored_date >= 
DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), IN [...]
+          "rawSql": "with _developers as(\n  select\n    
DATE_ADD(date(c.authored_date), INTERVAL -DAY(date(c.authored_date))+1 DAY) as 
time,\n    count(distinct author_name) as developer_count\n  from\n    commits 
c\n    join repo_commits rc on c.sha = rc.commit_sha\n    join project_mapping 
pm on rc.repo_id = pm.row_id and pm.table = 'repos' \n  where\n    
$__timeFilter(c.authored_date)\n    and pm.project_name in (${project})\n  
group by time\n)\n\nselect\n  date_format(time,'%M %Y')  [...]
           "refId": "A",
           "select": [
             [
@@ -981,7 +981,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "with _num_issues_with_sprint_updated as (\n  select\n    
DATE_ADD(date(i.created_date), INTERVAL -DAY(date(i.created_date))+1 DAY) as 
time,\n    NULLIF(COUNT(DISTINCT i.id), 0) AS num_issues_with_sprint_updated\n  
from\n    issues i\n    join board_issues bi on i.id = bi.issue_id\n\t  join 
boards b on bi.board_id = b.id\n\t  join project_mapping pm on b.id = 
pm.row_id\n    join issue_changelogs c on i.id = c.issue_id\n  where\n    
pm.project_name in (${project}) and\ [...]
+          "rawSql": "with _num_issues_with_sprint_updated as (\n  select\n    
DATE_ADD(date(i.created_date), INTERVAL -DAY(date(i.created_date))+1 DAY) as 
time,\n    NULLIF(COUNT(DISTINCT i.id), 0) AS num_issues_with_sprint_updated\n  
from\n    issues i\n    join board_issues bi on i.id = bi.issue_id\n\t  join 
boards b on bi.board_id = b.id\n\t  join project_mapping pm on b.id = 
pm.row_id\n    join issue_changelogs c on i.id = c.issue_id\n  where\n    
pm.project_name in (${project}) and\ [...]
           "refId": "A",
           "select": [
             [
@@ -1231,7 +1231,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(distinct pr.id) as pr_merged_count\n  from\n    pull_requests 
pr\n    join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 
'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 -D [...]
+          "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(distinct pr.id) as pr_merged_count\n  from\n    pull_requests 
pr\n    join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 
'repos' \n  where\n    pm.project_name in (${project})\n    and pr.merged_date 
is not null\n    and $__timeFilter(pr.merged_date)\n  group by 
time\n)\n\nselect\n  date_format(time,'%M %Y') as month,\n  [...]
           "refId": "A",
           "select": [
             [
@@ -1483,7 +1483,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*count(distinct case when pr.id 
in (select pull_request_id from pull_request_issues) then pr.id else null 
end)/count(distinct pr.id) as unlinked_pr_rate\nfrom 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})\nand $__timeFilter(created_date)\nand 
created_date >= DATE_ADD(DATE_ADD($__timeFr [...]
+          "rawSql": "select\n  DATE_ADD(date(created_date), INTERVAL 
-DAY(date(created_date))+1 DAY) as time,\n  100*count(distinct case when pr.id 
in (select pull_request_id from pull_request_issues) then pr.id else null 
end)/count(distinct pr.id) as unlinked_pr_rate\nfrom 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})\nand $__timeFilter(created_date)\ngroup 
by time\n\n",
           "refId": "A",
           "select": [
             [
@@ -1717,7 +1717,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "with _commits_groupby_name_and_date as (\n  select\n    
author_name,\n    date(authored_date) as _day,\n    count(distinct c.sha)\n  
from\n    commits c\n    join repo_commits rc on c.sha = rc.commit_sha\n    
join project_mapping pm on rc.repo_id = pm.row_id\n  where\n    pm.project_name 
in (${project}) and\n    (WEEKDAY(authored_date) between 0 and 4)\n    and 
$__timeFilter(authored_date)\n    and authored_date >= 
DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__ti [...]
+          "rawSql": "with _commits_groupby_name_and_date as (\n  select\n    
author_name,\n    date(authored_date) as _day,\n    count(distinct c.sha)\n  
from\n    commits c\n    join repo_commits rc on c.sha = rc.commit_sha\n    
join project_mapping pm on rc.repo_id = pm.row_id\n  where\n    pm.project_name 
in (${project}) and\n    (WEEKDAY(authored_date) between 0 and 4)\n    and 
$__timeFilter(authored_date)\n  group by 1,2\n)\n\nselect\n  DATE_ADD(_day, 
INTERVAL -DAY(_day)+1 DAY) as t [...]
           "refId": "A",
           "select": [
             [
@@ -1969,7 +1969,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_time_to_merge_in_days\nfrom\n  
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( [...]
+          "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_time_to_merge_in_days\nfrom\n  
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)\ngroup by 
time\norder by time",
           "refId": "A",
           "select": [
             [
diff --git a/grafana/dashboards/EngineeringThroughputAndCycleTime.json 
b/grafana/dashboards/EngineeringThroughputAndCycleTime.json
index a9f1c9e48..6f393a728 100644
--- a/grafana/dashboards/EngineeringThroughputAndCycleTime.json
+++ b/grafana/dashboards/EngineeringThroughputAndCycleTime.json
@@ -1149,7 +1149,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.merged_date 
as pr_merged_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.merged_date)\n    and pr.create [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.merged_date 
as pr_merged_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.merged_date)\n    and pm.projec [...]
           "refId": "A",
           "select": [
             [
@@ -1285,7 +1285,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.merged_date 
as pr_merged_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.merged_date)\n    and pr.merge [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.merged_date 
as pr_merged_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.merged_date)\n    and pm.proje [...]
           "refId": "A",
           "select": [
             [
@@ -1452,7 +1452,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.merged_date 
as pr_merged_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.merged_date)\n    and pr.merge [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.merged_date 
as pr_merged_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.merged_date)\n    and pm.proje [...]
           "refId": "A",
           "select": [
             [
@@ -1619,7 +1619,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.merged_date 
as pr_merged_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.merg [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.merged_date 
as pr_merged_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 pm.proj [...]
           "refId": "A",
           "select": [
             [
@@ -1786,7 +1786,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.merged_date 
as pr_merged_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.merged_date)\n    and pr.merge [...]
+          "rawSql": "with _prs as(\n  SELECT\n    pr.id,\n    pr.merged_date 
as pr_merged_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.merged_date)\n    and pm.proje [...]
           "refId": "A",
           "select": [
             [
diff --git a/grafana/dashboards/WorkLogs.json b/grafana/dashboards/WorkLogs.json
index ba2da4761..d2392927c 100644
--- a/grafana/dashboards/WorkLogs.json
+++ b/grafana/dashboards/WorkLogs.json
@@ -1121,7 +1121,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "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_prs as (\n  SELECT \n    DATE_ADD(date(created_date), INTERVAL 
-DAY(date(created_date))+1 DAY) as time,\n    count(distinct pr.id) as 
pr_count\n  FROM pull_requests pr\n  join _accounts a on pr.author_id = 
a.account_id\n  where \n    $__timeFilter(created [...]
+          "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_prs as (\n  SELECT \n    DATE_ADD(date(created_date), INTERVAL 
-DAY(date(created_date))+1 DAY) as time,\n    count(distinct pr.id) as 
pr_count\n  FROM pull_requests pr\n  join _accounts a on pr.author_id = 
a.account_id\n  where \n    $__timeFilter(created [...]
           "refId": "A",
           "select": [
             [

Reply via email to