Insights: Build GitLab Insights as a native GitLab feature
# Goal
Move GitLab Insights (aka Quality Dashboard) https://quality-dashboard.gitlap.com/groups/gitlab-org into GitLab.
We would like to start with our production ready graphs first. This includes:
* All bug visualizations
* https://quality-dashboard.gitlap.com/groups/gitlab-org/bugs_by_team
* https://quality-dashboard.gitlap.com/groups/gitlab-org/bugs_by_severity
* https://quality-dashboard.gitlap.com/groups/gitlab-org/bugs_by_priority
* https://quality-dashboard.gitlap.com/groups/gitlab-org/bug_classification
* Engineering Productivity metrics
* https://quality-dashboard.gitlap.com/groups/gitlab-org/developer_productivity_metrics
* Throughput graphs for all teams
* https://quality-dashboard.gitlap.com/groups/gitlab-org/teams/plan
# Approach
* Move everything in as is with charts.js.
* Rely heavily on REST/GraphQL APIs for pulling data. GitLab insights currently is a fullstack application with its own database. We are not planing to migrate any database tables as part of this move
* No emphasis on configuration UI. The configuration would be provided in a form of a `gitlab-insights.yml` file that will contain the graph configurations.
* As part of the migration we also need to make sure that additional metrics can be easily added as we go on.
## Mockups
### Insights at the project level

### Insights at the group level

## Notes
### Feature availability
- EE Ultimate
- Group-level
- Behind a feature flag
### Permissions
- https://gitlab.com/gitlab-org/gitlab-ee/issues/9289#note_136129050
#### Page access
- Group level feature available to all that can access the group
- Private group inaccessible to non-group users
#### Resources visualised
- Only resources accessible to the authenticated user should be visualised
- For a public group, and a visiting non-group member, confidential issues should not be included in the chart
- Essentially, if the user was to count the number of issues in the list and in a chart in insights that number should be the same
## Implementation
### Chart configuration
- https://gitlab.com/gitlab-org/gitlab-ee/issues/9486
Configuration of the charts should be pulled from a configuration file
#### Location of the configuration file
- Configuration file will reside within a project beneath the group
- Group level insights setting to dictate the active project from which to pull the config file
#### Config file structure
The config file will dictate the charts available to display in the frontend. The vue app will pull the chart config upon initialization
See: https://gitlab.com/gitlab-org/gitlab-ee/issues/9486
#### Chart types
The first iteration of the feature aims to provide the following charts:
| # | Name | Example | Tracking issue |
| ------ | ------ | ----- | ----- |
| 1 | Bugs by Severity | [Link](https://quality-dashboard.gitlap.com/groups/gitlab-org/bugs_by_severity) | https://gitlab.com/gitlab-org/gitlab-ee/issues/9867 |
| 2 | Bugs by Priority | [Link](https://quality-dashboard.gitlap.com/groups/gitlab-org/bugs_by_priority) | https://gitlab.com/gitlab-org/gitlab-ee/issues/9867 |
| 3 | Bugs by Team | [Link](https://quality-dashboard.gitlap.com/groups/gitlab-org/bugs_by_team) |https://gitlab.com/gitlab-org/gitlab-ee/issues/9867 |
| 4 | Bug Classification | [Link](https://quality-dashboard.gitlap.com/groups/gitlab-org/bug_classification) | https://gitlab.com/gitlab-org/gitlab-ee/issues/9867 |
| 5 | Avg Merged MRs Per Author Per Month | [Link](https://quality-dashboard.gitlap.com/groups/gitlab-org/average_mrs_per_milestone) | https://gitlab.com/gitlab-org/gitlab-ee/issues/9870 |
| 6 | Throughputs for Teams | [Link](https://quality-dashboard.gitlap.com/groups/gitlab-org/teams/plan) | https://gitlab.com/gitlab-org/gitlab-ee/issues/9869 |
#### Frontend
Frontend issue:
- https://gitlab.com/gitlab-org/gitlab-ee/issues/9871
epic