gitlab-org--gitlab-foss/spec/services
Stan Hu 5416ab8a0d Merge branch '21170-cycle-analytics' into 'master'
Cycle Analytics: first iteration

## What does this MR do?

- Implement the first iteration of the "Cycle Analytics" feature.

## What are the relevant issue numbers?

- Closes #21170 

## Screenshots

![cycle_analytics_screencast.gif](/uploads/d23c3c912caa6935fd47b53ca3a56b97/cycle_analytics.gif)

## Backend Tasks

- [x]  Implementation
    - [x]  Phases
        - [x]  Issue (Tracker)
        - [x]  Plan (Board)
        - [x]  Code (IDE)
        - [x]  Test (CI)
        - [x]  Review (MR)
        - [x]  Staging (CD)
        - [x]  Production (Total)
    - [x]  Make heuristics more modular
    - [x]  Scope to project
    - [x]  Date range (30 days, 90 days)
    - [x]  Access restriction
- [x]  Test
    - [x]  Find a better way to test these phases
    - [x]  Phases
        - [x]  Issue (Tracker)
        - [x]  Plan (Board)
        - [x]  Code (IDE)
        - [x]  Test (CI)
        - [x]  Review (MR)
        - [x]  Staging (CD)
        - [x]  Production (Total)
    - [x]  Test for "end case happens before start case"
    - [x]  Consolidate helper
- [x]  Miniboss review
- [x]  Performance testing with mock data
- [x]  Improve performance
    - [x]  Pre-calculate "merge requests closing issues
    - [x]  Pre-calculate everything else
- [x]  Test performance against 10k issues
- [x]  Test all pre-calculation code
    - [x]  Ci::Pipeline -> build start/finish
    - [x]  Ci::Pipeline#merge_requests
    - [x]  Issue -> record default metrics after save
    - [x]  MergeRequest -> record default metrics after save
    - [x]  Deployment -> Update "first_deployed_to_production_at" for MR metrics
    - [x]  Git Push -> Update "first commit mention" for issue metrics
    - [x]  Merge request create/update/refresh -> Update "merge requests closing issues"
- [x]  Remove `MergeRequestsClosingIssues` when necessary
- [x]  Changes to unblock Fatih
    - [x]  Add summary data
    - [x]  `stats` should be array
    - [x]  Let `stats` be `null` if all `stats` are null
- [x]  Indexes for "merge requests closing issues"
- [x]  Test summary data
- [x]  Scope everything to project
    - [x]  Find out why tests were passing
- [x]  Filter should include issues/MRs which have made it to production within the range
- [x]  Don't create duplicate `MergeRequestsClosingIssues`
- [x]  Fix tests
- [x]  MySQL median
- [x]  Assign to Douwe for review
- [x]  Fix conflicts
- [x]  Implement suggestions from Yorick's review
    - [x]  Test on PG
    - [x]  Test on MySQL
- [x]  Refactor
    - [x]  Cleanup
        - [x]  What happens if we have no data at all?
        - [x]  Extract common queries to methods / scopes
    - [x]  Remove unused queries
    - [x]  Downtime for foreign key migrations
    - [x]  Find a way around "if issue.metrics.present?" all over the place
    - [x]  Find a way around "if merge_request.metrics.present?" all over the place
    - [x]  Test migrations on a fresh database
        - [x]  MySQL
        - [x]  Pg
- [x]  Access issues
    - While the project is public and the visibility is set to "Everyone with access", you cannot visit the cycle analytics page when signed out.
- [x]  CHANGELOG
- [x]  Implement suggestions from Douwe's review
    - [x]  First set of comments
    - [x]  Second set of comments
    - [x]  Third set of comments
    - [x]  Fourth set of comments
- [x]  Make sure build is green
- [ ]  Make issue for "polish"
- [ ]  EE MR


See merge request !5986
2016-09-21 05:05:02 +00:00
..
auth Rename capabilities to authentication_abilities 2016-09-16 11:12:21 +02:00
boards Fix issue boards leak private label names and descriptions 2016-08-29 16:04:28 -03:00
ci Project tools visibility level 2016-09-01 11:47:59 -03:00
files Prevents accidental overwrites of commits from UI 2016-08-15 02:34:55 +00:00
groups Update tests for the current_application_settings request store changes 2016-05-27 19:05:52 -07:00
issuable Add bulk update support for merge requests list 2016-09-08 11:52:20 +03:00
issues Add bulk update support for merge requests list 2016-09-08 11:52:20 +03:00
members Raise a new Gitlab::Access::AccessDeniedError when permission is not enough to destroy a member 2016-06-18 06:06:34 +02:00
merge_requests Add a spec for merge request metric caching while refreshing a merge request from a forked project. 2016-09-21 02:15:02 +05:30
milestones Avoid describe-ing symbols in specs 2016-07-12 10:27:58 -05:00
notes Ensure we have a user before checking for their permission in Notes::SlashCommandsService 2016-09-20 13:58:14 +02:00
projects Reset pushes_since_gc counter before specs run to ensure starting point is 0 2016-09-18 21:21:43 -07:00
protected_branches Add missing spec for ProtectedBranches::CreateService 2016-09-18 13:44:34 -07:00
search Fix visibility of private project snippets for members when searching 2016-06-22 20:09:19 -03:00
slash_commands Remove unneeded aliases 2016-08-18 14:29:48 -05:00
create_deployment_service_spec.rb Fix CreateDeploymentService spec. 2016-09-21 09:17:00 +05:30
create_release_service_spec.rb Tag service specs 2015-12-09 11:55:49 +01:00
create_snippet_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
create_tag_service_spec.rb Better message for git hooks and file locks 2016-07-04 15:31:49 +03:00
delete_tag_service_spec.rb Delete tags via rugged 2016-04-15 16:05:04 +02:00
delete_user_service_spec.rb Fix bug where destroying a namespace would not always destroy projects 2016-08-11 15:36:35 -07:00
destroy_group_service_spec.rb Fix bug where destroying a namespace would not always destroy projects 2016-08-11 15:36:35 -07:00
event_create_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
git_hooks_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
git_push_service_spec.rb Fix build. 2016-09-21 02:59:17 +05:30
git_tag_push_service_spec.rb Expire branch/tag git data when needed. 2016-06-30 16:17:38 +02:00
import_export_clean_up_service_spec.rb fix spec 2016-08-04 13:39:38 +02:00
notification_service_spec.rb Reload issues in spec to ensure label<->issue mapping properly loaded 2016-09-20 19:40:37 -07:00
repair_ldap_blocked_user_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
repository_archive_clean_up_service_spec.rb Extract helper methods to clean up RepositoryArchiveCleanUpService spec 2016-07-21 11:47:28 -03:00
search_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
system_hooks_service_spec.rb Merge branch 'add_username_to_user_system_hooks' of https://github.com/tbeadle/gitlabhq 2016-01-13 10:12:30 +01:00
system_note_service_spec.rb Capitalize mentioned issue timeline notes 2016-08-25 10:47:40 -05:00
test_hook_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
todo_service_spec.rb Refresh todos count cache when an Issue/MR is deleted 2016-09-08 15:50:07 -03:00
update_release_service_spec.rb Tag service specs 2015-12-09 11:55:49 +01:00
update_snippet_service_spec.rb Fix more specs 2016-03-20 23:09:33 +01:00