diff --git a/app/assets/javascripts/application/bugs_by_stage.coffee b/app/assets/javascripts/application/bugs_by_stage.coffee new file mode 100644 index 0000000000000000000000000000000000000000..e1edfb49c8b6423da6ee58f8fa3207e00a39ef6f --- /dev/null +++ b/app/assets/javascripts/application/bugs_by_stage.coffee @@ -0,0 +1,56 @@ +StageCumulativeBugsCreatedPerMonthChart = (element) -> + query = @queries.ScopedQuery(@queries.CumulativeIssuablesCreatedPerMonthQuery( + 'Open', + @query_strings.Bugs, + @query_strings.Stages, + @query_strings.IssuesScope + )) + @charts.LineChart(element, query.query_string, query.view_string) + +StageBugsCreatedPerMonthChart = (element) -> + query = @queries.ScopedQuery(@queries.IssuablesCreatedPerMonthQuery( + 'Open', + @query_strings.Bugs, + @query_strings.Stages, + @query_strings.IssuesScope + )) + @charts.LineChart(element, query.query_string, query.view_string) + +StageBugsCreatedPerDayChart = (element) -> + query = @queries.ScopedQuery(@queries.IssuablesCreatedPerDayQuery( + 'Open', + @query_strings.Bugs, + @query_strings.Stages, + @query_strings.IssuesScope + )) + @charts.StackedBarChart(element, query.query_string, query.view_string) + +StageBugsClosedPerMonthChart = (element) -> + query = @queries.ScopedQuery(@queries.IssuablesClosedPerMonthQuery( + 'Closed', + @query_strings.Bugs, + @query_strings.Stages, + @query_strings.IssuesScope + )) + @charts.LineChart(element, query.query_string, query.view_string) + +StageBugsClosedPerDayChart = (element) -> + query = @queries.ScopedQuery(@queries.IssuablesClosedPerDayQuery( + 'Closed', + @query_strings.Bugs, + @query_strings.Stages, + @query_strings.IssuesScope + )) + @charts.StackedBarChart(element, query.query_string, query.view_string) + +$(document).ready () -> + if document.getElementById('cumulative-bugs-created-per-month-stage') + StageCumulativeBugsCreatedPerMonthChart(document.getElementById('cumulative-bugs-created-per-month-stage')) + if document.getElementById('bugs-created-per-month-stage') + StageBugsCreatedPerMonthChart(document.getElementById('bugs-created-per-month-stage')) + if document.getElementById('bugs-created-per-day-stage') + StageBugsCreatedPerDayChart(document.getElementById('bugs-created-per-day-stage')) + if document.getElementById('bugs-closed-per-month-stage') + StageBugsClosedPerMonthChart(document.getElementById('bugs-closed-per-month-stage')) + if document.getElementById('bugs-closed-per-day-stage') + StageBugsClosedPerDayChart(document.getElementById('bugs-closed-per-day-stage')) diff --git a/app/assets/javascripts/application/feature_proposals_by_stage.coffee b/app/assets/javascripts/application/feature_proposals_by_stage.coffee new file mode 100644 index 0000000000000000000000000000000000000000..596949fe2ade9176b080e490c4c82589fb37a016 --- /dev/null +++ b/app/assets/javascripts/application/feature_proposals_by_stage.coffee @@ -0,0 +1,23 @@ +StageProposalsCreatedPerMonthChart = (element) -> + query = @queries.ScopedQuery(@queries.IssuablesCreatedPerMonthQuery( + 'Open', + @query_strings.FeatureProposals, + @query_strings.Stages, + @query_strings.IssuesScope + )) + @charts.StackedBarChart(element, query.query_string, query.view_string) + +StageProposalsClosedPerMonthChart = (element) -> + query = @queries.ScopedQuery(@queries.IssuablesClosedPerMonthQuery( + 'Closed', + @query_strings.FeatureProposals, + @query_strings.Stages, + @query_strings.IssuesScope + )) + @charts.StackedBarChart(element, query.query_string, query.view_string) + +$(document).ready () -> + if document.getElementById('proposals-created-per-month-stage') + StageProposalsCreatedPerMonthChart(document.getElementById('proposals-created-per-month-stage')) + if document.getElementById('proposals-closed-per-month-stage') + StageProposalsClosedPerMonthChart(document.getElementById('proposals-closed-per-month-stage')) diff --git a/app/assets/javascripts/application/query_strings.coffee b/app/assets/javascripts/application/query_strings.coffee index 3b7f67119b7a2d5aea1ff37812966d95021278cf..131f3065a8567f6001053d73124556bdb2aacea3 100644 --- a/app/assets/javascripts/application/query_strings.coffee +++ b/app/assets/javascripts/application/query_strings.coffee @@ -2,6 +2,7 @@ IssuesScope: 'Issues', MergeRequestsScope: 'MergeRequests', Teams: '["Manage", "Plan", "Create", "Package", "Serverless", "Fulfillment", "Release", "Verify", "Configure", "Monitor", "Secure", "Distribution", "Gitaly", "Geo", "Quality", "security", "gitter", "frontend"]', + Stages: '["devops::manage", "devops::plan", "devops::create", "devops::package", "devops::release", "devops::verify", "devops::configure", "devops::monitor", "devops::secure", "devops::defend", "devops::growth", "devops::enablement"]', Severities: '["S4", "S3", "S2", "S1"]', Priorities: '["P4", "P3", "P2", "P1"]', Bugs: '["bug"]', diff --git a/app/views/groups/bugs_by_stage.html.haml b/app/views/groups/bugs_by_stage.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..96308077b84e0db0bd971579d5aee420f5ef9182 --- /dev/null +++ b/app/views/groups/bugs_by_stage.html.haml @@ -0,0 +1,2 @@ += render partial: 'shared/bugs_by_stage', locals: { source: @group } += render partial: 'shared/project_level_links', locals: { group: @group, name: 'bugs by stage', link: method(:group_project_bugs_by_stage_path) } diff --git a/app/views/groups/feature_proposals_by_stage.html.haml b/app/views/groups/feature_proposals_by_stage.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..48d24c92d591437d7d1b3ade0c2f1f4a2d4208fb --- /dev/null +++ b/app/views/groups/feature_proposals_by_stage.html.haml @@ -0,0 +1,2 @@ += render partial: 'shared/feature_proposals_by_stage', locals: { source: @group } += render partial: 'shared/project_level_links', locals: { group: @group, name: 'feature proposals by stage', link: method(:group_project_feature_proposals_by_stage_path) } diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index 4d9a69577af56d06f1552e947fdcbf6c00db7182..6b0e0c0cce8174a324a7f47e79e750a3ed9e13d1 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -31,11 +31,13 @@ = link_to 'Monthly Merged MRs', group_monthly_merged_mrs_path(@group.path), class: 'list-group-item' = link_to 'Merge Request Throughputs', group_throughputs_path(@group.path), class: 'list-group-item' = link_to 'Average MRs Merged Per Author Per Month', group_average_mrs_per_month_path(@group.path), class: 'list-group-item' + = link_to 'Bugs By Stage', group_bugs_by_stage_path(@group.path), class: 'list-group-item' = link_to 'Bugs By Team', group_bugs_by_team_path(@group.path), class: 'list-group-item' = link_to 'Bugs By Severity', group_bugs_by_severity_path(@group.path), class: 'list-group-item' = link_to 'Bugs By Priority', group_bugs_by_priority_path(@group.path), class: 'list-group-item' = link_to 'Bug Classification', group_bug_classification_path(@group.path), class: 'list-group-item' = link_to 'Feature Proposals by Team', group_feature_proposals_by_team_path(@group.path), class: 'list-group-item' + = link_to 'Feature Proposals by Stage', group_feature_proposals_by_stage_path(@group.path), class: 'list-group-item' = link_to 'Issues by State', group_issues_by_state_path(@group.path), class: 'list-group-item' = link_to 'EXPERIMENTAL - Merge Requests by State', group_mrs_by_state_path(@group.path), class: 'list-group-item' = link_to 'Regressions', group_regressions_path(@group.path), class: 'list-group-item' diff --git a/app/views/projects/bugs_by_stage.html.haml b/app/views/projects/bugs_by_stage.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..afabce757b8723a2cfc2f1d8d07b311c842aac8f --- /dev/null +++ b/app/views/projects/bugs_by_stage.html.haml @@ -0,0 +1 @@ += render partial: 'shared/bugs_by_stage', locals: { source: @project } diff --git a/app/views/projects/feature_proposals_by_stage.html.haml b/app/views/projects/feature_proposals_by_stage.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..1c42787493852ec9e55a7c90aeda6b0eaaa92c1c --- /dev/null +++ b/app/views/projects/feature_proposals_by_stage.html.haml @@ -0,0 +1 @@ += render partial: 'shared/feature_proposals_by_stage', locals: { source: @project } diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index e21449f336792af91ef307e666dc065914946c97..e872319ca304ebead51954a74fd7caebc79e8f1c 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -29,11 +29,13 @@ = link_to 'Monthly Merged MRs', group_project_monthly_merged_mrs_path(@group.path, @project.path), class: 'list-group-item' = link_to 'Merge Request Throughputs', group_project_throughputs_path(@group.path, @project.path), class: 'list-group-item' = link_to 'Average MRs Merged Per Author Per Month', group_project_average_mrs_per_month_path(@group.path, @project.path), class: 'list-group-item' + = link_to 'Bugs By Stage', group_project_bugs_by_stage_path(@group.path, @project.path), class: 'list-group-item' = link_to 'Bugs By Team', group_project_bugs_by_team_path(@group.path, @project.path), class: 'list-group-item' = link_to 'Bugs By Severity', group_project_bugs_by_severity_path(@group.path, @project.path), class: 'list-group-item' = link_to 'Bugs By Priority', group_project_bugs_by_priority_path(@group.path, @project.path), class: 'list-group-item' = link_to 'Bug Classification', group_project_bug_classification_path(@group.path, @project.path), class: 'list-group-item' = link_to 'Feature Proposals by Team', group_project_feature_proposals_by_team_path(@group.path, @project.path), class: 'list-group-item' + = link_to 'Feature Proposals by Stage', group_project_feature_proposals_by_stage_path(@group.path, @project.path), class: 'list-group-item' = link_to 'Issues by State', group_project_issues_by_state_path(@group.path, @project.path), class: 'list-group-item' = link_to 'EXPERIMENTAL - Merge Requests by State', group_project_mrs_by_state_path(@group.path, @project.path), class: 'list-group-item' = link_to 'Regressions', group_project_regressions_path(@group.path, @project.path), class: 'list-group-item' diff --git a/app/views/shared/_bugs_by_stage.html.haml b/app/views/shared/_bugs_by_stage.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..bb8a155a0817f9aa6d8640bb5907277d99e1cf1f --- /dev/null +++ b/app/views/shared/_bugs_by_stage.html.haml @@ -0,0 +1,60 @@ +.container + .page-header + %h1.page-title= "Dashboard: #{source.path}" + .page-header + %h2.page-title Bugs By Stage + .row.row-cards + .col-lg-12 + .card + .card-header + %h3.card-title Cumulative Bugs Created Per Month Per Stage + .card-body + %canvas#cumulative-bugs-created-per-month-stage + .card-body + %div + %div.text-wrap + %p Displays number of open bugs created over time grouped by their stage label + .row.row-cards + .col-lg-12 + .card + .card-header + %h3.card-title Bugs Created Per Month Per Stage + .card-body + %canvas#bugs-created-per-month-stage + .card-body + %div + %div.text-wrap + %p Displays number of open bugs created in a particular month grouped by their stage label + .row.row-cards + .col-lg-12 + .card + .card-header + %h3.card-title Bugs Closed Per Month Per Stage + .card-body + %canvas#bugs-closed-per-month-stage + .card-body + %div + %div.text-wrap + %p Displays number of closed bugs closed in a particular month grouped by their stage label + .row.row-cards + .col-lg-12 + .card + .card-header + %h3.card-title Bugs Created Per Day Per Stage + .card-body + %canvas#bugs-created-per-day-stage + .card-body + %div + %div.text-wrap + %p Displays number of open bugs created on a particular day grouped by their stage label + .row.row-cards + .col-lg-12 + .card + .card-header + %h3.card-title Bugs Closed Per Day Per Stage + .card-body + %canvas#bugs-closed-per-day-stage + .card-body + %div + %div.text-wrap + %p Displays number of bugs closed on a particular day grouped by their stage label diff --git a/app/views/shared/_feature_proposals_by_stage.html.haml b/app/views/shared/_feature_proposals_by_stage.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..769a7170d996938b48d4efe6e2f25a19a4a88291 --- /dev/null +++ b/app/views/shared/_feature_proposals_by_stage.html.haml @@ -0,0 +1,27 @@ +.container + .page-header + %h1.page-title= "Dashboard: #{source.path}" + .page-header + %h2.page-title Feature Proposal by Stage + .row.row-cards + .col-lg-12 + .card + .card-header + %h3.card-title Feature Proposal Created Per Month Per Stage + .card-body + %canvas#proposals-created-per-month-stage + .card-body + %div + %div.text-wrap + %p Displays number of open feature proposals created in a particular month grouped by their stage label + .row.row-cards + .col-lg-12 + .card + .card-header + %h3.card-title Feature Proposals Closed Per Month Per Stage + .card-body + %canvas#proposals-closed-per-month-stage + .card-body + %div + %div.text-wrap + %p Displays number of closed feature proposals closed in a particular month grouped by their stage label diff --git a/config/routes.rb b/config/routes.rb index aafa3326a9b3c4a0d351ef76d34e5d3bdd05f899..dc24fc89dc55b0f5041252b297494746777a2e30 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,10 +1,12 @@ Rails.application.routes.draw do resources :groups, only: [:index, :show], constraints: { id: /[^\/]+/ } do resources :projects, only: [:index, :show], constraints: { id: /\S+/ } do + get :bugs_by_stage get :bugs_by_team get :bugs_by_severity get :bugs_by_priority get :feature_proposals_by_team + get :feature_proposals_by_stage get :issues_by_state get :mrs_by_state get :regressions @@ -18,10 +20,12 @@ Rails.application.routes.draw do resources :teams, only: [:show] end + get :bugs_by_stage get :bugs_by_team get :bugs_by_severity get :bugs_by_priority get :feature_proposals_by_team + get :feature_proposals_by_stage get :issues_by_state get :mrs_by_state get :regressions diff --git a/lib/gitlab_insights.rb b/lib/gitlab_insights.rb index d0264d3e75c2f8c4fd2b056d778a32323899d401..c55f14801122fb9a9555add81093795e3b2c3682 100644 --- a/lib/gitlab_insights.rb +++ b/lib/gitlab_insights.rb @@ -64,6 +64,18 @@ module GitlabInsights "Geo" => COLOR_SCHEME[:lavender], "Quality" => COLOR_SCHEME[:maroon], "gitter" => COLOR_SCHEME[:brown], - "frontend" => COLOR_SCHEME[:mint] + "frontend" => COLOR_SCHEME[:mint], + "devops::manage" => COLOR_SCHEME[:orange], + "devops::plan" => COLOR_SCHEME[:green], + "devops::create" => COLOR_SCHEME[:yellow], + "devops::package" => COLOR_SCHEME[:purple], + "devops::release" => COLOR_SCHEME[:beige], + "devops::verify" => COLOR_SCHEME[:blue], + "devops::configure" => COLOR_SCHEME[:cyan], + "devops::monitor" => COLOR_SCHEME[:magenta], + "devops::secure" => COLOR_SCHEME[:lime], + "devops::defend" => COLOR_SCHEME[:pink], + "devops::growth" => COLOR_SCHEME[:teal], + "devops::enablement" => COLOR_SCHEME[:brown] } end