You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/08/03 16:31:35 UTC

[GitHub] [incubator-devlake] asterix314 opened a new issue, #2674: [Feature][Dashboard] Use month of merged_date to group for "mean time to merge pull requests"

asterix314 opened a new issue, #2674:
URL: https://github.com/apache/incubator-devlake/issues/2674

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar feature requirement.
   
   
   ### Description
   
   In the "GitHub Basic Metrics" dashboard, the calculation of "mean time to merge pull requests" is anchored on the PR _creation date_,  as per Inspect/Query, or in simplified SQL:
   
   ```sql
   SELECT TRUNCATE_MONTH(created_date) AS created_month, AVG(merged_date - created_date) AS time_to_merge
   FROM pull_requests
   GROUP BY created_month
   ```
   
   The resulting bar chart most likely would have a downward trend towards the right end, such as the following:
   
   <img width="797" alt="image" src="https://user-images.githubusercontent.com/10952409/182653088-1eda2251-7c6b-4191-b7a0-e29518fc6333.png">
   
   It is because the time to merge must by necessity be smaller than the PR's age, so young PR's appear to be merged sooner than old ones on average. A bias on the PR's age is thus introduced.
   
   This feature request asks that the same calculation be anchored on the PR _merge date_ instead:
   
   ```sql
   SELECT TRUNCATE_MONTH(merged_date) AS merged_month, AVG(merged_date - created_date) AS time_to_merge
   FROM pull_requests
   GROUP BY merged_month
   ```
   
   which should get rid of the bias.
   
   Note the same bias also manifests in "mean time to close pull requests", and potentially in other dashboards, too, where an average of some interval is calculated anchoring on the beginning time.
   
   
   ### Use case
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscribe@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] github-actions[bot] closed issue #2674: [Feature][Dashboard] Use month of merged_date to group for "mean time to merge pull requests"

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #2674: [Feature][Dashboard] Use month of merged_date to group for "mean time to merge pull requests"
URL: https://github.com/apache/incubator-devlake/issues/2674


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] github-actions[bot] commented on issue #2674: [Feature][Dashboard] Use month of merged_date to group for "mean time to merge pull requests"

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #2674:
URL: https://github.com/apache/incubator-devlake/issues/2674#issuecomment-1280108844

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] Startrekzky commented on issue #2674: [Feature][Dashboard] Use month of merged_date to group for "mean time to merge pull requests"

Posted by GitBox <gi...@apache.org>.
Startrekzky commented on issue #2674:
URL: https://github.com/apache/incubator-devlake/issues/2674#issuecomment-1208831956

   Good catch @asterix314 . I noticed this problem and got it fixed in v0.12.0. May I know the version number you're using?


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] asterix314 closed issue #2674: [Feature][Dashboard] Use month of merged_date to group for "mean time to merge pull requests"

Posted by GitBox <gi...@apache.org>.
asterix314 closed issue #2674: [Feature][Dashboard] Use month of merged_date to group for "mean time to merge pull requests"
URL: https://github.com/apache/incubator-devlake/issues/2674


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] github-actions[bot] commented on issue #2674: [Feature][Dashboard] Use month of merged_date to group for "mean time to merge pull requests"

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #2674:
URL: https://github.com/apache/incubator-devlake/issues/2674#issuecomment-1288247912

   This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] asterix314 commented on issue #2674: [Feature][Dashboard] Use month of merged_date to group for "mean time to merge pull requests"

Posted by GitBox <gi...@apache.org>.
asterix314 commented on issue #2674:
URL: https://github.com/apache/incubator-devlake/issues/2674#issuecomment-1217802337

   > Good catch @asterix314 . I noticed this problem and got it fixed in v0.12.0. May I know the version number you're using?
   
   Great then. I noticed the issue in v0.11.


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] asterix314 commented on issue #2674: [Feature][Dashboard] Use month of merged_date to group for "mean time to merge pull requests"

Posted by GitBox <gi...@apache.org>.
asterix314 commented on issue #2674:
URL: https://github.com/apache/incubator-devlake/issues/2674#issuecomment-1219182319

   Hi @Startrekzky 
   
   I just had a quick check at the default and release-v0.12 branches. In both cases the relevant code snippet (in grafana/dashboards/Gitlab.json ) was:
   
   ```sql
   with _prs as(
     SELECT
       DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,
       avg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440) as time_to_merge
     FROM pull_requests
     WHERE
       $__timeFilter(created_date)
       and base_repo_id in ($repo_id)
       and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)
     group by 1
   )
   ```
   
   which is till grouping by the month of `create_date`. Did I look at the wrong file?


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org