dosubot[bot] commented on issue #8144:
URL: 
https://github.com/apache/incubator-devlake/issues/8144#issuecomment-2413571118

   <!-- Greeting -->
   Hey @vshulga-sift, I'm here to help you with any bugs, questions, or 
contributions! Let's work together to solve this issue.
   
   <!-- Answer -->
   The issue you're encountering is related to the second condition in the SQL 
query for filtering `created_date` in the Grafana dashboard. This condition is 
designed to ensure that only pull requests created after the start of the month 
following the `__timeFrom()` date are considered. However, as you've observed, 
this can lead to incorrect filtering, especially for date ranges less than one 
month, as it effectively compares `created_date` with a future date.
   
   The second condition is:
   
   ```sql
   created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL 
-DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)
   ```
   
   This logic is intended to filter out pull requests that were created before 
the start of the next month from the `__timeFrom()` date. However, it seems to 
be causing issues with shorter date ranges, as it excludes PRs that should be 
included based on the selected time range.
   
   To address this, you might consider revising or removing this condition to 
ensure that the `created_date` is filtered correctly according to the selected 
date range in Grafana. This would help in accurately calculating the average 
metrics for the specified period.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
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: dev-unsubscr...@devlake.apache.org

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

Reply via email to