You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifically, in the main select statement, the first column definition (and the subsequent group by) should have INTERVAL -$interval(date(pr_issued_date))+1 DAY as the second function parameter in the DATE_ADD function call.
WITH _prs AS (
SELECTpr.id
, pr.created_dateAS pr_issued_date
-- convert null to 0 if a PR has no cycle_time to make sure cycle_time equals the sum of the four metrics below
, COALESCE(prm.pr_cycle_time/60,0) AS cycle_time
FROM pull_requests pr
LEFT JOIN project_pr_metrics prm ONpr.id=prm.idINNER JOIN project_mapping pm ONpr.base_repo_id=pm.row_idANDpm.table='repos'WHERE $__timeFilter(pr.created_date)
ANDpr.created_date>= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)
ANDpm.project_namein (${project:sqlstring}+'')
GROUP BYpr.id
, pr.created_date
, COALESCE(prm.pr_cycle_time/60,0)
)
SELECT
DATE_ADD(date(pr_issued_date), INTERVAL -DAYOFMONTH(date(pr_issued_date))+1 DAY) AStime
, AVG(cycle_time) AS'PR Cycle Time(h)'FROM _prs
GROUP BY DATE_ADD(date(pr_issued_date), INTERVAL -DAYOFMONTH(date(pr_issued_date))+1 DAY)
ORDER BYtime
Search before asking
What happened
Working:
Not Working:
What do you expect to happen
I expect that when the time interval option in the board changes that the PR Cycle Time graph respects that change.
How to reproduce
Anything else
Problem is here: https://github.com/apache/incubator-devlake/blob/main/grafana/dashboards/EngineeringThroughputAndCycleTime.json#L1161
Specifically, in the main select statement, the first column definition (and the subsequent group by) should have
INTERVAL -$interval(date(pr_issued_date))+1 DAY
as the second function parameter in theDATE_ADD
function call.Version
Latest: v0.19.0
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: