This is an automated email from the ASF dual-hosted git repository.
zhangliang2022 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake-website.git
The following commit(s) were added to refs/heads/main by this push:
new e265d941af docs: add bot removal patterns to PR metric docs (#472)
e265d941af is described below
commit e265d941afa30ab6b4cb8a1488bcc9598d929cc8
Author: Louis.z <[email protected]>
AuthorDate: Thu Mar 23 09:50:52 2023 +0800
docs: add bot removal patterns to PR metric docs (#472)
Co-authored-by: Startrekzky <[email protected]>
---
docs/Metrics/PRCount.md | 4 ++++
docs/Metrics/PRMergeRate.md | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/docs/Metrics/PRCount.md b/docs/Metrics/PRCount.md
index cbef92826c..179bcd7dd9 100644
--- a/docs/Metrics/PRCount.md
+++ b/docs/Metrics/PRCount.md
@@ -46,6 +46,8 @@ where
$__timeFilter(created_date)
-- please replace the repo ids with your own, or create a '$repo_id'
variable in Grafana
and base_repo_id in ('repo_1', 'repo_2')
+ -- remove PRs submitted by bots, comment it out if you don't need it
+ and author_name not rlike '^robot-|-robot$|\\[bot\\]|-bot$|-ci$|-testing$'
```
If you want to measure the monthly trend of `PR count` in the screenshot
below, please run the following SQL in Grafana.
@@ -64,6 +66,8 @@ WITH _prs as(
and $__timeFilter(created_date)
-- the following condition will remove the month with incomplete data
and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL
-DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)
+ -- remove PRs submitted by bots, comment it out if you don't need it
+ and author_name not rlike '^robot-|-robot$|\\[bot\\]|-bot$|-ci$|-testing$'
GROUP BY 1
)
diff --git a/docs/Metrics/PRMergeRate.md b/docs/Metrics/PRMergeRate.md
index af4e178460..75f07c0866 100644
--- a/docs/Metrics/PRMergeRate.md
+++ b/docs/Metrics/PRMergeRate.md
@@ -46,6 +46,8 @@ where
$__timeFilter(created_date)
-- please replace the repo ids with your own, or create a '$repo_id'
variable in Grafana
and base_repo_id in ('repo_1', 'repo_2')
+ -- remove PRs submitted by bots, comment it out if you don't need it
+ and author_name not rlike '^robot-|-robot$|\\[bot\\]|-bot$|-ci$|-testing$'
```
If you want to measure the monthly trend of `PR merge rate` in the screenshot
below, please run the following SQL in Grafana.
@@ -61,6 +63,8 @@ WHERE
$__timeFilter(created_date)
-- please replace the repo ids with your own, or create a '$repo_id'
variable in Grafana
and base_repo_id in ('repo_1', 'repo_2')
+ -- remove PRs submitted by bots, comment it out if you don't need it
+ and author_name not rlike '^robot-|-robot$|\\[bot\\]|-bot$|-ci$|-testing$'
GROUP BY 1
```
@@ -79,6 +83,8 @@ WHERE
$__timeFilter(created_date)
and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL
-DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)
and base_repo_id in ('repo_1', 'repo_2')
+ -- remove PRs submitted by bots, comment it out if you don't need it
+ and author_name not rlike '^robot-|-robot$|\\[bot\\]|-bot$|-ci$|-testing$'
GROUP BY 1
```