You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by wa...@apache.org on 2022/06/14 08:17:55 UTC
[incubator-devlake] branch main updated: fix: update number to xxx_key
This is an automated email from the ASF dual-hosted git repository.
warren 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 c6445783 fix: update number to xxx_key
c6445783 is described below
commit c6445783e3b723eb98f4fa7799adbe37fd31c93e
Author: abeizn <zi...@merico.dev>
AuthorDate: Tue Jun 14 15:26:04 2022 +0800
fix: update number to xxx_key
---
...itHubReleaseQualityAndContributionAnalysis.json | 28 ++++++++---------
grafana/dashboards/GithubBasicMetrics.json | 4 +--
...ithubReleaseQualityAndContributionAnalysis.json | 28 ++++++++---------
grafana/dashboards/WeeklyBugRetro.json | 6 ++--
models/domainlayer/code/pull_request.go | 1 -
models/domainlayer/ticket/issue.go | 2 +-
models/migrationscripts/register.go | 2 +-
.../updateSchemas20220613.go} | 35 +++++++++++++++-------
.../updateSchemas20220614.go} | 28 +++++++++++++++--
plugins/github/tasks/issue_convertor.go | 2 +-
plugins/gitlab/tasks/issue_convertor.go | 2 +-
plugins/gitlab/tasks/mr_convertor.go | 2 +-
plugins/jira/tasks/issue_convertor.go | 2 +-
plugins/tapd/tasks/bug_converter.go | 17 ++++++-----
plugins/tapd/tasks/story_converter.go | 9 +++---
plugins/tapd/tasks/task_converter.go | 9 +++---
16 files changed, 109 insertions(+), 68 deletions(-)
diff --git a/grafana/_archive/EeGitHubReleaseQualityAndContributionAnalysis.json b/grafana/_archive/EeGitHubReleaseQualityAndContributionAnalysis.json
index 343cac7a..2b825649 100644
--- a/grafana/_archive/EeGitHubReleaseQualityAndContributionAnalysis.json
+++ b/grafana/_archive/EeGitHubReleaseQualityAndContributionAnalysis.json
@@ -104,7 +104,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the bug distribution in major versions\nwith bugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/tags/', -1) as tag_name, \n\t\tSUBSTRING_INDEX(rid.new_ref_id,':', 3) as repo_id,\n\t\ti.number, i.type, i.title, i.description\n\tfrom\n\t\trefs_issues_diffs rid\n\t\tleft join issues i on rid.issue_id = i.id\n\twhere\n\t\tSUBSTRING_INDEX(rid.new_ref_id,':', 3) in ($repo_id)\n\t\tand i.type = 'BUG'\n)\n\n\nSELECT \n\tconcat(SUBSTRING_INDEX(bi [...]
+ "rawSql": "-- Get the bug distribution in major versions\nwith bugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/tags/', -1) as tag_name, \n\t\tSUBSTRING_INDEX(rid.new_ref_id,':', 3) as repo_id,\n\t\ti.issue_key, i.type, i.title, i.description\n\tfrom\n\t\trefs_issues_diffs rid\n\t\tleft join issues i on rid.issue_id = i.id\n\twhere\n\t\tSUBSTRING_INDEX(rid.new_ref_id,':', 3) in ($repo_id)\n\t\tand i.type = 'BUG'\n)\n\n\nSELECT \n\tconcat(SUBSTRING_INDEX [...]
"refId": "A",
"select": [
[
@@ -385,7 +385,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX( [...]
+ "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX( [...]
"refId": "A",
"select": [
[
@@ -540,7 +540,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1,1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDE [...]
+ "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1,1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDE [...]
"refId": "A",
"select": [
[
@@ -695,7 +695,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 2,1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDE [...]
+ "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 2,1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDE [...]
"refId": "A",
"select": [
[
@@ -856,7 +856,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the number of fixed bugs in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n)\n\t\nselect distinct\n\tb.name as repo_name,\n\tSUBSTRING_INDEX(rid.new_ref_id,'tags/', -1) as tag_nam [...]
+ "rawSql": "-- Get the number of fixed bugs in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n)\n\t\nselect distinct\n\tb.name as repo_name,\n\tSUBSTRING_INDEX(rid.new_ref_id,'tags/', -1) as tag_nam [...]
"refId": "A",
"select": [
[
@@ -942,7 +942,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Component distribution of bugs fixed in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/', -1) as tag_na [...]
+ "rawSql": "-- Component distribution of bugs fixed in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/', -1) as tag_na [...]
"refId": "A",
"select": [
[
@@ -1028,7 +1028,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Component distribution of bugs fixed in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/', -1) as tag_na [...]
+ "rawSql": "-- Component distribution of bugs fixed in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/', -1) as tag_na [...]
"refId": "A",
"select": [
[
@@ -1115,7 +1115,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the % of contributors who fixed 80% of bugs in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect \n\t\ti.number, i.type, i.severity, i.title, i.description, [...]
+ "rawSql": "-- Get the % of contributors who fixed 80% of bugs in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect \n\t\ti.issue_key, i.type, i.severity, i.title, i.descripti [...]
"refId": "A",
"select": [
[
@@ -1212,7 +1212,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the bug fixer distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect \n\t\ti.number, i.type, i.severity, i.title, i.description,\n\t\tpr.id, pr.a [...]
+ "rawSql": "-- Get the bug fixer distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect \n\t\ti.issue_key, i.type, i.severity, i.title, i.description,\n\t\tpr.id, p [...]
"refId": "A",
"select": [
[
@@ -1636,7 +1636,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the bug fixer distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect distinct\n\t b.name,\n\t\tSUBSTRING_INDEX(rid.new_ref_id,'tags/', -1) as ta [...]
+ "rawSql": "-- Get the bug fixer distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect distinct\n\t b.name,\n\t\tSUBSTRING_INDEX(rid.new_ref_id,'tags/', -1) as ta [...]
"refId": "A",
"select": [
[
@@ -1933,7 +1933,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the queue time of all backlog bugs\nselect \n b.name as repo_name,\n i.number as issue_key,\n i.title,\n i.created_date,\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/3600 as queue_time_in_days,\n concat(b.url,'/',i.number) as url\nfrom \n issues i\n left join board_issues bi on i.id = bi.issue_id\n left join boards b on bi.board_id = b.id\nwhere\n i.type = 'BUG'\n and i.status != 'DONE'\n and b.id in ($repo_id)\norder by queue_time_in_days desc",
+ "rawSql": "-- Get the queue time of all backlog bugs\nselect \n b.name as repo_name,\n i.issue_key as issue_key,\n i.title,\n i.created_date,\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/3600 as queue_time_in_days,\n concat(b.url,'/',i.issue_key) as url\nfrom \n issues i\n left join board_issues bi on i.id = bi.issue_id\n left join boards b on bi.board_id = b.id\nwhere\n i.type = 'BUG'\n and i.status != 'DONE'\n and b.id in ($repo_id)\norder by queue_time_in_days desc",
"refId": "A",
"select": [
[
@@ -2306,7 +2306,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1\n),\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_request [...]
+ "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1\n),\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_request [...]
"refId": "A",
"select": [
[
@@ -2391,7 +2391,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1,1\n),\n\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_req [...]
+ "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1,1\n),\n\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_req [...]
"refId": "A",
"select": [
[
@@ -2507,7 +2507,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 2,1\n),\n\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_req [...]
+ "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 2,1\n),\n\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_req [...]
"refId": "A",
"select": [
[
diff --git a/grafana/dashboards/GithubBasicMetrics.json b/grafana/dashboards/GithubBasicMetrics.json
index 6770c8fd..6c53e97b 100644
--- a/grafana/dashboards/GithubBasicMetrics.json
+++ b/grafana/dashboards/GithubBasicMetrics.json
@@ -792,7 +792,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the queue time of all backlog bugs\nwith _outstanding_issues as(\n select \n b.name as repo_name,\n i.number as issue_key,\n i.title,\n i.created_date,\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/1440 as queue_time_in_days,\n concat(b.url,'/',i.number) as url\n from \n issues i\n left join board_issues bi on i.id = bi.issue_id\n left join boards b on bi.board_id = b.id\n where\n b.id in ($repo_id)\n and $__timeFilter(i.c [...]
+ "rawSql": "-- Get the queue time of all backlog bugs\nwith _outstanding_issues as(\n select \n b.name as repo_name,\n i.issue_key as issue_key,\n i.title,\n i.created_date,\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/1440 as queue_time_in_days,\n concat(b.url,'/',i.issue_key) as url\n from \n issues i\n left join board_issues bi on i.id = bi.issue_id\n left join boards b on bi.board_id = b.id\n where\n b.id in ($repo_id)\n and $__timeFilt [...]
"refId": "A",
"select": [
[
@@ -959,7 +959,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the queue time of all backlog bugs\nselect \n b.name as repo_name,\n i.number as issue_key,\n i.title,\n i.created_date,\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/1440 as queue_time_in_days,\n concat(b.url,'/',i.number) as url\nfrom \n issues i\n left join board_issues bi on i.id = bi.issue_id\n left join boards b on bi.board_id = b.id\nwhere\n b.id in ($repo_id)\n and $__timeFilter(i.created_date)\n and i.status != 'DONE'\norder by queue_tim [...]
+ "rawSql": "-- Get the queue time of all backlog bugs\nselect \n b.name as repo_name,\n i.issue_key as issue_key,\n i.title,\n i.created_date,\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/1440 as queue_time_in_days,\n concat(b.url,'/',i.issue_key) as url\nfrom \n issues i\n left join board_issues bi on i.id = bi.issue_id\n left join boards b on bi.board_id = b.id\nwhere\n b.id in ($repo_id)\n and $__timeFilter(i.created_date)\n and i.status != 'DONE'\norder by que [...]
"refId": "A",
"select": [
[
diff --git a/grafana/dashboards/GithubReleaseQualityAndContributionAnalysis.json b/grafana/dashboards/GithubReleaseQualityAndContributionAnalysis.json
index c7b796a2..c12fcdfb 100644
--- a/grafana/dashboards/GithubReleaseQualityAndContributionAnalysis.json
+++ b/grafana/dashboards/GithubReleaseQualityAndContributionAnalysis.json
@@ -104,7 +104,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the bug distribution in major versions\nwith bugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/tags/', -1) as tag_name, \n\t\tSUBSTRING_INDEX(rid.new_ref_id,':', 3) as repo_id,\n\t\ti.number, i.type, i.title, i.description\n\tfrom\n\t\trefs_issues_diffs rid\n\t\tleft join issues i on rid.issue_id = i.id\n\twhere\n\t\tSUBSTRING_INDEX(rid.new_ref_id,':', 3) in ($repo_id)\n\t\tand i.type = 'BUG'\n)\n\n\nSELECT \n\tconcat(SUBSTRING_INDEX(bi [...]
+ "rawSql": "-- Get the bug distribution in major versions\nwith bugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/tags/', -1) as tag_name, \n\t\tSUBSTRING_INDEX(rid.new_ref_id,':', 3) as repo_id,\n\t\ti.issue_key, i.type, i.title, i.description\n\tfrom\n\t\trefs_issues_diffs rid\n\t\tleft join issues i on rid.issue_id = i.id\n\twhere\n\t\tSUBSTRING_INDEX(rid.new_ref_id,':', 3) in ($repo_id)\n\t\tand i.type = 'BUG'\n)\n\n\nSELECT \n\tconcat(SUBSTRING_INDEX [...]
"refId": "A",
"select": [
[
@@ -385,7 +385,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX( [...]
+ "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX( [...]
"refId": "A",
"select": [
[
@@ -540,7 +540,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1,1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDE [...]
+ "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1,1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDE [...]
"refId": "A",
"select": [
[
@@ -695,7 +695,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 2,1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDE [...]
+ "rawSql": "-- Get the severity distribution in bugs\n-- Get the work-type distribution in the last n tags\nwith _last_n_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 2,1\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDE [...]
"refId": "A",
"select": [
[
@@ -856,7 +856,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the number of fixed bugs in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n)\n\t\nselect distinct\n\tb.name as repo_name,\n\tSUBSTRING_INDEX(rid.new_ref_id,'tags/', -1) as tag_nam [...]
+ "rawSql": "-- Get the number of fixed bugs in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n)\n\t\nselect distinct\n\tb.name as repo_name,\n\tSUBSTRING_INDEX(rid.new_ref_id,'tags/', -1) as tag_nam [...]
"refId": "A",
"select": [
[
@@ -942,7 +942,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Component distribution of bugs fixed in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/', -1) as tag_na [...]
+ "rawSql": "-- Component distribution of bugs fixed in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/', -1) as tag_na [...]
"refId": "A",
"select": [
[
@@ -1028,7 +1028,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Component distribution of bugs fixed in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/', -1) as tag_na [...]
+ "rawSql": "-- Component distribution of bugs fixed in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\nbugs_in_each_tag as(\n\tselect \n\t\tSUBSTRING_INDEX(rid.new_ref_id,'refs/', -1) as tag_na [...]
"refId": "A",
"select": [
[
@@ -1115,7 +1115,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the % of contributors who fixed 80% of bugs in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect \n\t\ti.number, i.type, i.severity, i.title, i.description, [...]
+ "rawSql": "-- Get the % of contributors who fixed 80% of bugs in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect \n\t\ti.issue_key, i.type, i.severity, i.title, i.descripti [...]
"refId": "A",
"select": [
[
@@ -1212,7 +1212,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the bug fixer distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect \n\t\ti.number, i.type, i.severity, i.title, i.description,\n\t\tpr.id, pr.a [...]
+ "rawSql": "-- Get the bug fixer distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect \n\t\ti.issue_key, i.type, i.severity, i.title, i.description,\n\t\tpr.id, p [...]
"refId": "A",
"select": [
[
@@ -1636,7 +1636,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the bug fixer distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect distinct\n\t b.name,\n\t\tSUBSTRING_INDEX(rid.new_ref_id,'tags/', -1) as ta [...]
+ "rawSql": "-- Get the bug fixer distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 5\n),\n\n_bugs as(\n\tselect distinct\n\t b.name,\n\t\tSUBSTRING_INDEX(rid.new_ref_id,'tags/', -1) as ta [...]
"refId": "A",
"select": [
[
@@ -1933,7 +1933,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the queue time of all backlog bugs\nselect \n b.name as repo_name,\n i.number as issue_key,\n i.title,\n i.created_date,\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/3600 as queue_time_in_days,\n concat(b.url,'/',i.number) as url\nfrom \n issues i\n left join board_issues bi on i.id = bi.issue_id\n left join boards b on bi.board_id = b.id\nwhere\n i.type = 'BUG'\n and i.status != 'DONE'\n and b.id in ($repo_id)\norder by queue_time_in_days desc",
+ "rawSql": "-- Get the queue time of all backlog bugs\nselect \n b.name as repo_name,\n i.issue_key as issue_key,\n i.title,\n i.created_date,\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/3600 as queue_time_in_days,\n concat(b.url,'/',i.issue_key) as url\nfrom \n issues i\n left join board_issues bi on i.id = bi.issue_id\n left join boards b on bi.board_id = b.id\nwhere\n i.type = 'BUG'\n and i.status != 'DONE'\n and b.id in ($repo_id)\norder by queue_time_in_days desc",
"refId": "A",
"select": [
[
@@ -2306,7 +2306,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1\n),\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_request [...]
+ "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1\n),\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_request [...]
"refId": "A",
"select": [
[
@@ -2391,7 +2391,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1,1\n),\n\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_req [...]
+ "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 1,1\n),\n\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_req [...]
"refId": "A",
"select": [
[
@@ -2507,7 +2507,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 2,1\n),\n\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_req [...]
+ "rawSql": "-- Get the work-type distribution in the last 5 tags\nwith _last_5_tags as(\n SELECT \n -- distinct new_ref_id, old_ref_id\n distinct SUBSTRING_INDEX(new_ref_id,':', -1) as new_ref_id, SUBSTRING_INDEX(old_ref_id,':', -1) as old_ref_id\n FROM \n refs_commits_diffs\n WHERE\n\t\tSUBSTRING_INDEX(new_ref_id,':', 3) in ($repo_id)\n\tORDER BY 1 desc\n\tLIMIT 2,1\n),\n\n\n_combine_pr as (\n select pull_request_id as id, commit_sha, p.pull_request_key as pull_req [...]
"refId": "A",
"select": [
[
diff --git a/grafana/dashboards/WeeklyBugRetro.json b/grafana/dashboards/WeeklyBugRetro.json
index b33bb7a6..e57213a7 100644
--- a/grafana/dashboards/WeeklyBugRetro.json
+++ b/grafana/dashboards/WeeklyBugRetro.json
@@ -201,7 +201,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "select\n i.number,\n i.title,\n i.url\nfrom\n lake.issues as i\n\tjoin lake.board_issues bi on i.id = bi.issue_id\n\tjoin lake.boards b on bi.board_id = b.id\nwhere\n type = 'BUG' \n and date(i.created_date) BETWEEN curdate() - INTERVAL WEEKDAY(curdate())+7 DAY AND curdate() - INTERVAL WEEKDAY(curdate())+1 DAY\n and b.id in ($repo_id)",
+ "rawSql": "select\n i.issue_key,\n i.title,\n i.url\nfrom\n lake.issues as i\n\tjoin lake.board_issues bi on i.id = bi.issue_id\n\tjoin lake.boards b on bi.board_id = b.id\nwhere\n type = 'BUG' \n and date(i.created_date) BETWEEN curdate() - INTERVAL WEEKDAY(curdate())+7 DAY AND curdate() - INTERVAL WEEKDAY(curdate())+1 DAY\n and b.id in ($repo_id)",
"refId": "A",
"select": [
[
@@ -481,7 +481,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "select\n i.number,\n i.title,\n i.url\nfrom\n lake.issues as i\n\tjoin board_issues bi on i.id = bi.issue_id\n\tjoin boards b on bi.board_id = b.id\nwhere\n type = 'BUG'\n and status = 'DONE'\n and date(i.resolution_date) BETWEEN curdate() - INTERVAL WEEKDAY(curdate())+7 DAY AND curdate() - INTERVAL WEEKDAY(curdate())+1 DAY\n and b.id in ($repo_id)",
+ "rawSql": "select\n i.issue_key,\n i.title,\n i.url\nfrom\n lake.issues as i\n\tjoin board_issues bi on i.id = bi.issue_id\n\tjoin boards b on bi.board_id = b.id\nwhere\n type = 'BUG'\n and status = 'DONE'\n and date(i.resolution_date) BETWEEN curdate() - INTERVAL WEEKDAY(curdate())+7 DAY AND curdate() - INTERVAL WEEKDAY(curdate())+1 DAY\n and b.id in ($repo_id)",
"refId": "A",
"select": [
[
@@ -808,7 +808,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "select \n i.number as 'Issue Number',\n i.title as 'Title',\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/1440 as 'Queue Time in Days',\n i.url\nfrom \n lake.issues i\n\tjoin board_issues bi on i.id = bi.issue_id\n\tjoin boards b on bi.board_id = b.id\nwhere\n i.type = 'BUG'\n and i.status != 'DONE'\n and b.id in ($repo_id)\norder by 'Queue Time' desc",
+ "rawSql": "select \n i.issue_key as 'Issue Number',\n i.title as 'Title',\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/1440 as 'Queue Time in Days',\n i.url\nfrom \n lake.issues i\n\tjoin board_issues bi on i.id = bi.issue_id\n\tjoin boards b on bi.board_id = b.id\nwhere\n i.type = 'BUG'\n and i.status != 'DONE'\n and b.id in ($repo_id)\norder by 'Queue Time' desc",
"refId": "A",
"select": [
[
diff --git a/models/domainlayer/code/pull_request.go b/models/domainlayer/code/pull_request.go
index 3a246412..70a84bce 100644
--- a/models/domainlayer/code/pull_request.go
+++ b/models/domainlayer/code/pull_request.go
@@ -28,7 +28,6 @@ type PullRequest struct {
BaseRepoId string `gorm:"index"`
HeadRepoId string `gorm:"index"`
Status string `gorm:"type:varchar(100);comment:open/closed or other"`
- Number int
Title string
Description string
Url string `gorm:"type:varchar(255)"`
diff --git a/models/domainlayer/ticket/issue.go b/models/domainlayer/ticket/issue.go
index ce391698..589f61d1 100644
--- a/models/domainlayer/ticket/issue.go
+++ b/models/domainlayer/ticket/issue.go
@@ -27,7 +27,7 @@ type Issue struct {
domainlayer.DomainEntity
Url string `gorm:"type:varchar(255)"`
IconURL string `gorm:"type:varchar(255);column:icon_url"`
- Number string `gorm:"type:varchar(255)"`
+ IssueKey string `gorm:"type:varchar(255)"`
Title string
Description string
EpicKey string `gorm:"type:varchar(255)"`
diff --git a/models/migrationscripts/register.go b/models/migrationscripts/register.go
index bb0896d7..aaa1beec 100644
--- a/models/migrationscripts/register.go
+++ b/models/migrationscripts/register.go
@@ -26,6 +26,6 @@ func All() []migration.Script {
new(updateSchemas20220505), new(updateSchemas20220507), new(updateSchemas20220510),
new(updateSchemas20220513), new(updateSchemas20220524), new(updateSchemas20220526),
new(updateSchemas20220527), new(updateSchemas20220528), new(updateSchemas20220601),
- new(updateSchemas20220602),
+ new(updateSchemas20220602), new(updateSchemas20220613), new(updateSchemas20220614),
}
}
diff --git a/models/domainlayer/ticket/issue.go b/models/migrationscripts/updateSchemas20220613.go
similarity index 78%
copy from models/domainlayer/ticket/issue.go
copy to models/migrationscripts/updateSchemas20220613.go
index ce391698..362c3b36 100644
--- a/models/domainlayer/ticket/issue.go
+++ b/models/migrationscripts/updateSchemas20220613.go
@@ -15,15 +15,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package ticket
+package migrationscripts
import (
+ "context"
"time"
"github.com/apache/incubator-devlake/models/domainlayer"
+ "gorm.io/gorm"
)
-type Issue struct {
+type Issue20220613 struct {
domainlayer.DomainEntity
Url string `gorm:"type:varchar(255)"`
IconURL string `gorm:"type:varchar(255);column:icon_url"`
@@ -52,12 +54,25 @@ type Issue struct {
Component string `gorm:"type:varchar(255)"`
}
-const (
- BUG = "BUG"
- REQUIREMENT = "REQUIREMENT"
- INCIDENT = "INCIDENT"
+func (Issue20220613) TableName() string {
+ return "issues"
+}
- TODO = "TODO"
- DONE = "DONE"
- IN_PROGRESS = "IN_PROGRESS"
-)
+type updateSchemas20220613 struct{}
+
+func (*updateSchemas20220613) Up(ctx context.Context, db *gorm.DB) error {
+
+ err := db.Migrator().RenameColumn(Issue20220613{}, "number", "issue_key")
+ if err != nil {
+ return err
+ }
+ return nil
+}
+
+func (*updateSchemas20220613) Version() uint64 {
+ return 20220613000005
+}
+
+func (*updateSchemas20220613) Name() string {
+ return "update `number` column to `issue_key` at issues"
+}
diff --git a/models/domainlayer/code/pull_request.go b/models/migrationscripts/updateSchemas20220614.go
similarity index 75%
copy from models/domainlayer/code/pull_request.go
copy to models/migrationscripts/updateSchemas20220614.go
index 3a246412..36876464 100644
--- a/models/domainlayer/code/pull_request.go
+++ b/models/migrationscripts/updateSchemas20220614.go
@@ -15,15 +15,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package code
+package migrationscripts
import (
+ "context"
"time"
"github.com/apache/incubator-devlake/models/domainlayer"
+ "gorm.io/gorm"
)
-type PullRequest struct {
+type PullRequest20220614 struct {
domainlayer.DomainEntity
BaseRepoId string `gorm:"index"`
HeadRepoId string `gorm:"index"`
@@ -47,3 +49,25 @@ type PullRequest struct {
BaseCommitSha string `gorm:"type:varchar(40)"`
HeadCommitSha string `gorm:"type:varchar(40)"`
}
+
+func (PullRequest20220614) TableName() string {
+ return "pull_requests"
+}
+
+type updateSchemas20220614 struct{}
+
+func (*updateSchemas20220614) Up(ctx context.Context, db *gorm.DB) error {
+ err := db.Migrator().DropColumn(&PullRequest20220614{}, "number")
+ if err != nil {
+ return err
+ }
+ return nil
+}
+
+func (*updateSchemas20220614) Version() uint64 {
+ return 20220614110537
+}
+
+func (*updateSchemas20220614) Name() string {
+ return "remove columns number at pull_requests"
+}
diff --git a/plugins/github/tasks/issue_convertor.go b/plugins/github/tasks/issue_convertor.go
index 06c3a51b..f7aa338d 100644
--- a/plugins/github/tasks/issue_convertor.go
+++ b/plugins/github/tasks/issue_convertor.go
@@ -69,7 +69,7 @@ func ConvertIssues(taskCtx core.SubTaskContext) error {
issue := inputRow.(*githubModels.GithubIssue)
domainIssue := &ticket.Issue{
DomainEntity: domainlayer.DomainEntity{Id: issueIdGen.Generate(issue.GithubId)},
- Number: strconv.Itoa(issue.Number),
+ IssueKey: strconv.Itoa(issue.Number),
Title: issue.Title,
Description: issue.Body,
Priority: issue.Priority,
diff --git a/plugins/gitlab/tasks/issue_convertor.go b/plugins/gitlab/tasks/issue_convertor.go
index 2101d328..b8186791 100644
--- a/plugins/gitlab/tasks/issue_convertor.go
+++ b/plugins/gitlab/tasks/issue_convertor.go
@@ -67,7 +67,7 @@ func ConvertIssues(taskCtx core.SubTaskContext) error {
issue := inputRow.(*gitlabModels.GitlabIssue)
domainIssue := &ticket.Issue{
DomainEntity: domainlayer.DomainEntity{Id: issueIdGen.Generate(issue.GitlabId)},
- Number: strconv.Itoa(issue.Number),
+ IssueKey: strconv.Itoa(issue.Number),
Title: issue.Title,
Description: issue.Body,
Priority: issue.Priority,
diff --git a/plugins/gitlab/tasks/mr_convertor.go b/plugins/gitlab/tasks/mr_convertor.go
index 27a90547..c0e76e6b 100644
--- a/plugins/gitlab/tasks/mr_convertor.go
+++ b/plugins/gitlab/tasks/mr_convertor.go
@@ -63,7 +63,7 @@ func ConvertApiMergeRequests(taskCtx core.SubTaskContext) error {
BaseRepoId: domainRepoIdGenerator.Generate(gitlabMr.SourceProjectId),
HeadRepoId: domainRepoIdGenerator.Generate(gitlabMr.TargetProjectId),
Status: gitlabMr.State,
- Number: gitlabMr.Iid,
+ PullRequestKey: gitlabMr.Iid,
Title: gitlabMr.Title,
Description: gitlabMr.Description,
Url: gitlabMr.WebUrl,
diff --git a/plugins/jira/tasks/issue_convertor.go b/plugins/jira/tasks/issue_convertor.go
index f5d316c5..95a52d40 100644
--- a/plugins/jira/tasks/issue_convertor.go
+++ b/plugins/jira/tasks/issue_convertor.go
@@ -74,7 +74,7 @@ func ConvertIssues(taskCtx core.SubTaskContext) error {
},
Url: convertURL(jiraIssue.Self, jiraIssue.IssueKey),
IconURL: jiraIssue.IconURL,
- Number: jiraIssue.IssueKey,
+ IssueKey: jiraIssue.IssueKey,
Title: jiraIssue.Summary,
EpicKey: jiraIssue.EpicKey,
Type: jiraIssue.StdType,
diff --git a/plugins/tapd/tasks/bug_converter.go b/plugins/tapd/tasks/bug_converter.go
index a1fee8c2..05f96acd 100644
--- a/plugins/tapd/tasks/bug_converter.go
+++ b/plugins/tapd/tasks/bug_converter.go
@@ -18,13 +18,14 @@ limitations under the License.
package tasks
import (
+ "reflect"
+ "strconv"
+
"github.com/apache/incubator-devlake/models/domainlayer"
"github.com/apache/incubator-devlake/models/domainlayer/ticket"
"github.com/apache/incubator-devlake/plugins/core"
"github.com/apache/incubator-devlake/plugins/helper"
"github.com/apache/incubator-devlake/plugins/tapd/models"
- "reflect"
- "strconv"
)
func ConvertBug(taskCtx core.SubTaskContext) error {
@@ -56,12 +57,12 @@ func ConvertBug(taskCtx core.SubTaskContext) error {
DomainEntity: domainlayer.DomainEntity{
Id: IssueIdGen.Generate(toolL.ConnectionId, toolL.ID),
},
- Url: toolL.Url,
- Number: strconv.FormatUint(toolL.ID, 10),
- Title: toolL.Title,
- EpicKey: toolL.EpicKey,
- Type: "BUG",
- Status: toolL.StdStatus,
+ Url: toolL.Url,
+ IssueKey: strconv.FormatUint(toolL.ID, 10),
+ Title: toolL.Title,
+ EpicKey: toolL.EpicKey,
+ Type: "BUG",
+ Status: toolL.StdStatus,
//ResolutionDate: (*time.Time)(&toolL.Resolved),
//CreatedDate: (*time.Time)(&toolL.Created),
//UpdatedDate: (*time.Time)(&toolL.Modified),
diff --git a/plugins/tapd/tasks/story_converter.go b/plugins/tapd/tasks/story_converter.go
index 1fc1e147..b4c221fd 100644
--- a/plugins/tapd/tasks/story_converter.go
+++ b/plugins/tapd/tasks/story_converter.go
@@ -18,14 +18,15 @@ limitations under the License.
package tasks
import (
+ "reflect"
+ "strconv"
+ "time"
+
"github.com/apache/incubator-devlake/models/domainlayer"
"github.com/apache/incubator-devlake/models/domainlayer/ticket"
"github.com/apache/incubator-devlake/plugins/core"
"github.com/apache/incubator-devlake/plugins/helper"
"github.com/apache/incubator-devlake/plugins/tapd/models"
- "reflect"
- "strconv"
- "time"
)
func ConvertStory(taskCtx core.SubTaskContext) error {
@@ -58,7 +59,7 @@ func ConvertStory(taskCtx core.SubTaskContext) error {
Id: IssueIdGen.Generate(toolL.ConnectionId, toolL.ID),
},
Url: toolL.Url,
- Number: strconv.FormatUint(toolL.ID, 10),
+ IssueKey: strconv.FormatUint(toolL.ID, 10),
Title: toolL.Name,
Type: toolL.StdType,
Status: toolL.StdStatus,
diff --git a/plugins/tapd/tasks/task_converter.go b/plugins/tapd/tasks/task_converter.go
index e025d0fb..c8a94451 100644
--- a/plugins/tapd/tasks/task_converter.go
+++ b/plugins/tapd/tasks/task_converter.go
@@ -18,14 +18,15 @@ limitations under the License.
package tasks
import (
+ "reflect"
+ "strconv"
+ "time"
+
"github.com/apache/incubator-devlake/models/domainlayer"
"github.com/apache/incubator-devlake/models/domainlayer/ticket"
"github.com/apache/incubator-devlake/plugins/core"
"github.com/apache/incubator-devlake/plugins/helper"
"github.com/apache/incubator-devlake/plugins/tapd/models"
- "reflect"
- "strconv"
- "time"
)
func ConvertTask(taskCtx core.SubTaskContext) error {
@@ -58,7 +59,7 @@ func ConvertTask(taskCtx core.SubTaskContext) error {
Id: IssueIdGen.Generate(toolL.ConnectionId, toolL.ID),
},
Url: toolL.Url,
- Number: strconv.FormatUint(toolL.ID, 10),
+ IssueKey: strconv.FormatUint(toolL.ID, 10),
Title: toolL.Name,
Description: toolL.Description,
Type: toolL.StdType,