summaryrefslogtreecommitdiff
path: root/app/models
Commit message (Collapse)AuthorAgeFilesLines
* Improve how MergeCommit#merge_commit_message builds the messageRobert Speicher2016-09-271-7/+5
| | | | | | | | | | | | | | | Now a merge request with a blank description will no longer produce a merge commit message like this: ``` Merge branch 'foo' into 'master' Bring the wonders of foo into the world See merge request !7283 ``` What an improvement! :tada:
* Merge branch '22578-cycle-analytics-incorrect-commit-count'Douwe Maan2016-09-271-5/+23
|\
| * Fix the "Commits" section of the cycle analytics summary.Timothy Andrew2016-09-261-5/+23
| | | | | | | | | | | | | | | | | | - The commit count was capped at 10, due to `Gitlab::Git::Repository#log` enforcing a limit, with the default set to 10. - Reimplement a small portion of this `log` function to get just the data we need.
* | Improve project_with_board factory to create the default listsimprovement/project-with-board-factoryDouglas Barbosa Alexandre2016-09-261-0/+8
|/
* Fixes issue with rails reserved keyword type exporting/importing services. ↵James Lopez2016-09-261-0/+4
| | | | Also fixed CustomIssueTrackerService title setter and added relevant specs.
* Merge branch 'fix/database-seeds' into 'master' Rémy Coutable2016-09-231-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix database seeds for development environment ## What does this MR do? This MR fixes database seeds for development environment and adds CI test for it. ## Why was this MR needed? Database seeds for development environment are often broken, and we are not able to catch that when someone modified `db/fixtures` and forgets to reseed database. Closes #22422 See merge request !6475
| * Fix pipeline fixtures for development environmentGrzegorz Bizon2016-09-221-1/+1
| |
* | Use select(:foo) instead of map(&:foo) in GlobalMilestoneAhmad Sherif2016-09-231-3/+3
| |
* | Ensure milestones passed to GlobalMilestone is an ActiveRecord::RelationAhmad Sherif2016-09-231-13/+4
| |
* | Reduce number of queries when calling GlobalMilestone#{labels,participants}Ahmad Sherif2016-09-231-2/+12
| |
* | Eager-load assignee and labels associations for GlobalMilestore issuablesAhmad Sherif2016-09-231-2/+2
| |
* | So that st_commits could never be nilLin Jen-Shin2016-09-221-4/+6
| |
* | For empty merge_request_diff st_commits would be nilfix-pipeline-for-empty-merge-request-diffLin Jen-Shin2016-09-221-1/+3
|/ | | | Closes #22438
* Merge branch 'zj-default-setting-features' into 'master' Robert Speicher2016-09-211-0/+6
|\ | | | | | | | | Add default values for ProjectFeature See merge request !6447
| * Remove duplicate default_value_level entryzj-default-setting-featuresZeger-Jan van de Weg2016-09-211-1/+0
| |
| * Add default values for ProjectFeatureZ.J. van de Weg2016-09-211-0/+7
| | | | | | | | Closes gitlab-org/gitlab-ce#22330
* | Merge branch 'and-you-get-awards' into 'master' Rémy Coutable2016-09-214-8/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And Snippets get awards ## What does this MR do? Makes snippets more awesome, by making them awardables ## Why was this MR needed? Because Snippets were left behind. ## What are the relevant issue numbers? Closes #17878 See merge request !4456
| * | Start Frontend work, fix routing problemZ.J. van de Weg2016-09-193-8/+6
| | |
| * | Snippets get award emoji! :thumbsup:Z.J. van de Weg2016-09-191-0/+1
| | |
* | | Merge branch 'rs-simplify-fetch_members' into 'master' Rémy Coutable2016-09-211-32/+40
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify ProjectTeam#fetch_members to satisfy flog ## What does this MR do? - Add specs for ProjectTeam#fetch_members - Simplify ProjectTeam#fetch_members to satisfy flog ## What are the relevant issue numbers? Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/22200 See merge request !6431
| * | | Simplify invited_group_members filter-by-levelRobert Speicher2016-09-211-6/+6
| | | |
| * | | Use `public_send` over `send` in ProjectTeamRobert Speicher2016-09-211-3/+3
| | | |
| * | | Improve clarity of variable names in ProjectTeam#fetch_invited_membersrs-simplify-fetch_membersRobert Speicher2016-09-201-14/+12
| | | |
| * | | Fix a logic error in ProjectTeam#fetch_invited_membersRobert Speicher2016-09-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We were calling `.where` and `.send` on the relation, but never doing anything with the return value, resulting in proper access-level filtering never being of any consequence.
| * | | Simplify ProjectTeam#fetch_members to satisfy flogRobert Speicher2016-09-201-30/+40
| | | |
* | | | Merge branch 'show-all-pipelines-from-all-diffs' into 'master' Rémy Coutable2016-09-212-4/+25
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Show all pipelines from all merge_request_diffs This way we could also show pipelines from commits which were discarded due to a force push. Closes #21889 See merge request !6414
| * | | | If merge request wasn't persisted yet, we show only 1 pipeline:Lin Jen-Shin2016-09-201-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | However, if MergeRequest#all_commits_sha would want to handle non-persisted merge request, by judging its name, it should not just give 1 SHA, but all of them. But we don't really care all_commits_sha for non-persisted merge request anyway. So I think we should just ignore that case. Better to not implementing something than implementing it in a wrong and confusing way.
| * | | | slightly tweak about the comment, feedback:Lin Jen-Shin2016-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6414#note_15750250
| * | | | Introduce MergeRequest#all_commits_sha, feedback:Lin Jen-Shin2016-09-201-8/+9
| | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6414#note_15746083
| * | | | Show all pipelines from all merge_request_diffs:Lin Jen-Shin2016-09-192-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | This way we could also show pipelines from commits which were discarded due to a force push.
* | | | | Merge branch 'limit-number-of-shown-environments' into 'master' Rémy Coutable2016-09-212-3/+22
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Limit number of shown environments ## What does this MR do? This MR limits in context of Merge Request a list of shown environments. Previously we would show all environments containing the SHA of the head commit of Merge Request. However, with introducing of dynamically created environments this lead to a cases that we would show multiple review apps, for different branches, because these branches would contain a new questioned commit. This MR changes what environments we test against presence of the commit, to: 1. We look for environments with deployments to source_branch of source_project: used for deployments to per-branch environments, 2. We look for environments with deployments to target_branch of target_project: used for deployments to staging / production environments, 3. We look for environments with deployments for tags on target_project: used for staging / production environments. ## Why was this MR needed? To improve a list of returned environments when we introduced ability to create dynamic environments for review apps: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6323 See merge request !6438
| * | | | | Scope environments to projectlimit-number-of-shown-environmentsKamil Trzcinski2016-09-211-1/+1
| | | | | |
| * | | | | Add tests to verify the correctness of returned environmentsKamil Trzcinski2016-09-212-4/+4
| | | | | |
| * | | | | Limit number of shown environments for Merge RequestsKamil Trzcinski2016-09-212-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - For target project show only environments for target branch or with tags - For source project show only environments for source branch
* | | | | | Merge branch 'add_spec_for_committer_hash' into 'master' Rémy Coutable2016-09-211-1/+1
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | |
* | | | | | Merge branch 'post-merge-improve-of-ci-permissions' into 'master' Rémy Coutable2016-09-211-2/+5
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Post-merge improve of CI permissions Improves code from !6409 See merge request !6432
| * | | | | Post-merge improve of CI permissionsKamil Trzcinski2016-09-201-2/+5
| | |_|/ / | |/| | |
* | | | | Merge branch '21170-cycle-analytics' into 'master' Stan Hu2016-09-2111-1/+248
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | Use the `IssuableBaseService` lifecycle hooks to cache ↵Timothy Andrew2016-09-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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-217-89/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-201-1/+0
| | | | | | | | | | | | | | | | | | | | And `scss_lint`
| * | | | Implement (some) comments from @DouweM's review.Timothy Andrew2016-09-207-101/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move things common to `Issue` and `MergeRequest` into `Issuable` - Move more database-specific functions into `Gitlab::Database` - Indentation changes and other minor refactorings.
| * | | | Fix spec failures.Timothy Andrew2016-09-201-1/+5
| | | | |
| * | | | Implement review comments from @yorickpeterseTimothy Andrew2016-09-2010-188/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Change multiple updates to a single `update_all` 2. Use cascading deletes 3. Extract an average function for the database median. 4. Move database median to `lib/gitlab/database` 5. Use `delete_all` instead of `destroy_all` 6. Minor refactoring
| * | | | Merge remote-tracking branch 'origin/master' into 21170-cycle-analyticsTimothy Andrew2016-09-2023-141/+387
| |\ \ \ \ | | |/ / /
| * | | | Implement a database median strategy for MySQL.Timothy Andrew2016-09-202-23/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Dispatch between the two strategies automatically based on the current database type. 2. The MySQL version needs to run multiple statements, so the `cycle_analytics` model is modified to support this.
| * | | | Miscellaneous cycle-analytics-related changes.Timothy Andrew2016-09-201-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Add indexes to `CreateMergeRequestsClosingIssues` columns. 2. Remove an extraneous `check_if_open` check that is redundant now. It would've been better to rebase this in, but that's not possible because more people are working on this branch.
| * | | | CycleAnalytics operates on merge requests that have been deployed.Timothy Andrew2016-09-201-23/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Look for merge requests (and issues that they close) that have been deployed to production in the last X days (where X is given by the `from` parameter). 2. Cycle analytics queries only operate on this fitered set of merge requests and issues.
| * | | | Add a uniqueness constraint to `MergeRequestsClosingIssues`Timothy Andrew2016-09-201-0/+5
| | | | |