summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'add_spec_for_committer_hash' into 'master' Rémy Coutable2016-09-211-0/+45
|\ | | | | | | | | | | | | Add spec covering 'committer_hash' Adds a missing spec from changes added in !5822 See merge request !6433
| * Add spec covering 'committer_hash'Dan Dunckel2016-09-201-0/+45
| |
* | Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ceDmitriy Zaporozhets2016-09-21111-892/+3324
|\ \
| * \ Merge branch 'post-merge-improve-of-ci-permissions' into 'master' Rémy Coutable2016-09-213-7/+15
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Post-merge improve of CI permissions Improves code from !6409 See merge request !6432
| | * | Improve JwtController implementationpost-merge-improve-of-ci-permissionsKamil Trzcinski2016-09-201-3/+5
| | | |
| | * | Post-merge improve of CI permissionsKamil Trzcinski2016-09-203-7/+13
| | | |
| * | | Merge branch '21170-cycle-analytics' into 'master' Stan Hu2016-09-2121-1/+1044
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | Fix `CreateDeploymentService` spec.Timothy Andrew2016-09-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. The spec tests that if: - The merge request is merged - The target branch is deployed to production - The `first_deployed_to_production_at` metric is `nil` (for some reason) - The target branch is deployed to production again - The `first_deployed_to_production_at` metric stays as `nil` (and is not overwritten). 2. Failure only on MySQL due to some datetime weirdness.
| | * | | Reload issues in spec to ensure label<->issue mapping properly loaded21170-cycle-analyticsStan Hu2016-09-201-0/+2
| | | | |
| | * | | Fix build.Timothy Andrew2016-09-213-8/+8
| | | | |
| | * | | Add a spec for merge request metric caching while refreshing a merge request ↵Timothy Andrew2016-09-213-11/+37
| | | | | | | | | | | | | | | | | | | | from a forked project.
| | * | | Use the `IssuableBaseService` lifecycle hooks to cache ↵Timothy Andrew2016-09-213-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `MergeRequestsClosingIssues` - Instead of overriding `create` and `update` in `MergeRequests::BaseService` - Get all merge request service specs passing
| | * | | Implement a second round of review comments from @DouweM.Timothy Andrew2016-09-2111-96/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't use `TableReferences` - using `.arel_table` is shorter! - Move some database-related code to `Gitlab::Database` - Remove the `MergeRequest#issues_closed` and `Issue#closed_by_merge_requests` associations. They were either shadowing or were too similar to existing methods. They are not being used anywhere, so it's better to remove them to reduce confusion. - Use Rails 3-style validations - Index for `MergeRequest::Metrics#first_deployed_to_production_at` - Only include `CycleAnalyticsHelpers::TestGeneration` for specs that need it. - Other minor refactorings.
| | * | | Fix rubocop spec.Timothy Andrew2016-09-202-3/+7
| | | | | | | | | | | | | | | | | | | | And `scss_lint`
| | * | | Fix spec failures.Timothy Andrew2016-09-205-11/+11
| | | | |
| | * | | Merge remote-tracking branch 'origin/master' into 21170-cycle-analyticsTimothy Andrew2016-09-20163-1414/+4292
| | |\ \ \
| | * | | | Fix all cycle analytics specs.Timothy Andrew2016-09-207-16/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of failures were introduced due to performance improvements (like pre-calculating metrics).
| | * | | | Test the `CycleAnalytics::Summary` model.Timothy Andrew2016-09-203-4/+78
| | | | | |
| | * | | | Test all cycle analytics pre-calculation code.Timothy Andrew2016-09-198-0/+333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the code that pre-calculates metrics for use in the cycle analytics page. - Ci::Pipeline -> build start/finish - Ci::Pipeline#merge_requests - Issue -> record default metrics after save - MergeRequest -> record default metrics after save - Deployment -> Update "first_deployed_to_production_at" for MR metrics - Git Push -> Update "first commit mention" for issue metrics - Merge request create/update/refresh -> Update "merge requests closing issues"
| | * | | | Merge remote-tracking branch 'origin/master' into 21170-cycle-analyticsTimothy Andrew2016-09-07111-716/+2864
| | |\ \ \ \
| | * | | | | Fix rubocop spec.Timothy Andrew2016-09-071-2/+2
| | | | | | |
| | * | | | | Consolidate all cycle analytics helper methods.Timothy Andrew2016-09-078-264/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Move the test generation to `CycleAnalyticsHelpers::TestGeneration` 2. Move all helper methods (previously placed in each individual spec file) to `CycleAnalyticsHelpers`
| | * | | | | Add a test case for "end condition happens before start condition".Timothy Andrew2016-09-071-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - In the cycle analytics specs.
| | * | | | | Test the `test` cycle analytics phase.Timothy Andrew2016-09-071-0/+90
| | | | | | |
| | * | | | | Test the `production` cycle analytics phase.Timothy Andrew2016-09-072-1/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a `before_end_fn` option to the code that generates cycle analytics specs. `before_end_fn` is called before the end conditions are. Used for data setup that needs to be called after the start conditions and before the end conditions.
| | * | | | | Test the `staging` cycle analytics phase.Timothy Andrew2016-09-072-4/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove overlap from the "start + end" durations in the happy test case. For the `staging` phase, the end time is the _first_ deployment that happens after the MR merge. If we have 5 MRs where the `start_time`s (merge time) are the same, and all the `end_time`s (deploy to production) a few days from now, only the earliest deploy will get picked up, because that consitutes a deploy for _all_ the MRs. We fix this by removing overlap. Every `start_time` is now generated to be _after_ the preceding `end_time`.
| | * | | | | Generate branch/file names more randomly to avoid failures.Timothy Andrew2016-09-074-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Tests would randomly fail because of naming conflicts. - Use a `random_git_name` method instead of using `FFaker` directly.
| | * | | | | Test the 'review' cycle analytics phase.Timothy Andrew2016-09-071-0/+45
| | | | | | |
| | * | | | | Test the `code` cycle analytics phase.Timothy Andrew2016-09-074-25/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move the "data belongs to other project" test case into the generated tests, and remove the explicit tests from the `code` and `plan` phases.
| | * | | | | Refactor cycle analytics specs.Timothy Andrew2016-09-023-180/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Generalise the specs that will be common across all cycle analytics phases. 2. Rewrite specs `issue` and `plan` to use this abstracted testing strategy. 3. Specs that are specific to a given phase, or unwieldy to test in an abstracted manner, are added to each phase's spec.
| | * | | | | Add tests for the `plan` cycle analytics phase.Timothy Andrew2016-09-022-63/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up the `issue` tests as well
| | * | | | | Fetch cycle analytics data for a specific date range.Timothy Andrew2016-08-261-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Supported date ranges are 30 / 90 days ago. The default is 90 days ago. 2. All issues created before "x days ago" are filtered out, even if they have other related data (test runs, merge requests) within the filter range.
| | * | | | | Scope Cycle Analytics queries to a projectTimothy Andrew2016-08-261-8/+13
| | | | | | |
| | * | | | | Add a spec for the `CycleAnalytics#issue` method.Timothy Andrew2016-08-261-0/+80
| | | | | | |
| * | | | | | Merge branch 'issue_20078' into 'master' Yorick Peterse2016-09-201-0/+13
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test if issue authors can access private projects See merge request !6419
| | * | | | | | Test if issue authors can access private projectsFelipe Artur2016-09-201-0/+13
| | | | | | | |
| * | | | | | | Merge branch 'slash-commands-load-fix' into 'master' Robert Speicher2016-09-201-0/+21
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed slash commands not loading ## What does this MR do? Fixes an issue with slash commands not working when the autocomplete source is loading & then the new issue button is clicked. This also fixes an issue where the autocomplete source is loaded on pages where it isn't actually needed. ## What are the relevant issue numbers? Closes #21774, #21807 See merge request !6207
| | * | | | | | | Use admin user in testsPhil Hughes2016-09-161-3/+1
| | | | | | | | |
| | * | | | | | | Correctly loads gfm autocomplete source on pages where it is requiredPhil Hughes2016-09-161-0/+23
| | | | | | | | |
| * | | | | | | | Merge branch 'update_issues_mr_counter' into 'master' Rémy Coutable2016-09-204-10/+67
| |\ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix issues with wrong issues/merge request counts when filters are selected Closes #15356 plus counter for issues and MR are now displayed for the these paths `https://gitlab.com/groups/group-name/issues` `https://gitlab.com/groups/group-name/merge_requests` `https://gitlab.com/dashboard/issues` and `https://gitlab.com/dashboard/merge_requests` See merge request !4960
| | * | | | | | | fix issues mr counterbarthc2016-09-204-10/+67
| | | |_|_|_|_|/ | | |/| | | | |
| * | | | | | | Merge branch 'add_optional_author_for_commits' into 'master' Rémy Coutable2016-09-202-2/+209
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add optional 'author' param when making commits This fulfills https://gitlab.com/gitlab-org/gitlab-ce/issues/20789 by adding the ability to specify a user's ID to be used as the author of a commit. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20789 See merge request !5822
| | * | | | | | | Add optional 'author' param when making commitsDan Dunckel2016-09-192-2/+209
| | | | | | | | |
| * | | | | | | | Merge branch '22218-fix-note-form-footer' into 'master' Robert Speicher2016-09-202-0/+105
| |\ \ \ \ \ \ \ \ | | |_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix note form hint showing slash commands supported for commits ## What are the relevant issue numbers? Closes #22218 See merge request !6368
| | * | | | | | | Add a view spec for projects/notes/_formRémy Coutable2016-09-202-16/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| | * | | | | | | Ensure we have a user before checking for their permission in ↵Rémy Coutable2016-09-201-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes::SlashCommandsService Signed-off-by: Rémy Coutable <remy@rymai.me>
| | * | | | | | | Fix note form hint showing slash commands supported for commitsRémy Coutable2016-09-201-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | | | | | | Merge branch 'feature/github-edit-path' into 'master' Rémy Coutable2016-09-202-13/+35
| |\ \ \ \ \ \ \ \ | | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lets the user choose a namespace and name on Github imports Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/14971 See merge request !5728
| | * | | | | | | modify github import JS and controller so we can now specify a namespace ↵James Lopez2016-09-202-13/+35
| | | |_|_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and/or name for a project. - Fixed and added specs. - Added different namespace options depending on user privilages - Updated docs.
| * | | | | | | Merge branch 'merge-request-push-compare-ui' into 'master' Jacob Schatz2016-09-201-3/+11
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Frontend for Merge Request Diff This merge request improves the UX for the merge request diff feature which was recently implemented here (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6127). Specifically, it styles various parts of the diff feature to match the designs, it disables comment-related buttons in states where comments are disabled, and it adds a 'Show latest version' button for convenience. ## Are there points in the code the reviewer needs to double check? I could use feedback on this MR's fidelity to the design. ## Why was this MR needed? Neccessary styling improvements for basic UX of this feature, and enabled comment buttons are not functional and thus need to be disabled in certain states. ## Screenshots (if relevant) ![57dd0755f0b14342305909](/uploads/318a44a3bc8b7fc5c9c6ef92ba92e511/57dd0755f0b14342305909.gif) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/21427 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6127 cc: @jschatz1 See merge request !6343