summaryrefslogtreecommitdiff
path: root/app/models
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'new-merge-requests-commit-tab-active' into 'master' Fatih Acet2016-10-061-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MergeRequest new form load diff asynchronously ## What does this MR do? Don't return diff tab content from the server when request for a new merge request ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? To avoid 502 errors due to this controller action takes to much time ## What are the relevant issue numbers? Relates #13912 ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - ~~[ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - ~~[ ] API support added~~ - Tests - [x] Added for this feature/bug - [x] All builds are passing - [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) See merge request !5844
| * MergeRequest new form load diff asynchronouslynew-merge-requests-commit-tab-activePaco Guzman2016-10-061-2/+2
| |
* | Merge branch 'mahcsig/gitlab-ce-17350-multi-file-commit'Rémy Coutable2016-10-061-0/+46
|\ \ | |/ |/| | | See !6096.
| * multi-file commitMarc Siegfriedt2016-10-051-0/+46
| | | | | | | | | | | | add docs and tests - add additional validation allow move without content updated response
* | Merge branch 'feature/improve-async-pipeline-processing' into 'master' Kamil Trzciński2016-10-062-8/+12
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve asynchronous pipeline processing ## What does this MR do? This MR improves asynchronous processing of pipeline. ## Why was this MR needed? It eliminates some race conditions and improves performance. ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] Added for this feature/bug - [x] All builds are passing ## What are the relevant issue / merge request numbers? Related merge request: !6410 Extracted from !6411 See merge request !6650
| * Do not return false in commit status transitionfeature/improve-async-pipeline-processingGrzegorz Bizon2016-10-041-1/+1
| |
| * Fix hipchat service specs after changes in pipelineGrzegorz Bizon2016-10-041-3/+2
| |
| * Update order of build transition callbacksGrzegorz Bizon2016-10-041-12/+13
| |
| * Extract updating pipeline status to async workerGrzegorz Bizon2016-10-041-4/+8
| |
| * Use internal commit status API to check if finishedGrzegorz Bizon2016-10-041-2/+2
| |
| * Fix async pipeline and remove unrelated changesGrzegorz Bizon2016-10-043-15/+2
| |
| * Make pipeline processing asynchronousKamil Trzcinski2016-10-033-7/+20
| | | | | | | | | | | | Conflicts: app/models/ci/pipeline.rb app/models/commit_status.rb
* | Merge branch 'trending-caching' into 'master' Rémy Coutable2016-10-051-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor TrendingProjectsFinder to support caching ## What does this MR do? This refactors `TrendingProjectsFinder` so it can support caching of the data. See cb7d398972d786ba7133418266fa34ae641b2497 for more details. ## Why was this MR needed? Trending projects is quite slow, easily taking seconds to load the entire page. https://gitlab.com/gitlab-org/gitlab-ce/issues/22164 https://gitlab.com/gitlab-com/infrastructure/milestones/4, in particular the section "Trending page under 2s" See merge request !6672
| * | Exclude system notes from Project.trendingYorick Peterse2016-10-041-0/+1
| | | | | | | | | | | | | | | | | | | | | Having many system notes isn't really an indication of a project being trending. Including these notes would lead to projects with lots of commit cross references (for example) showing up in the trending projects list.
* | | Merge branch 'test-improve-gitlab-identifier' into 'master' Rémy Coutable2016-10-051-0/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor Gitlab::Identifier ## What does this MR do? This refactors `Gitlab::Identifier` so that it: 1. Has tests 2. Caches output in an instance variable to reduce queries 3. Uses only a single query to find a user by an SSH key, instead of 2 ## Why was this MR needed? This code was untested and would execute more SQL queries than needed. See merge request !6680
| * | | Refactor Gitlab::IdentifierYorick Peterse2016-10-051-0/+5
| |/ / | | | | | | | | | | | | | | | This refactors Gitlab::Identifier so it uses fewer queries and is actually tested. Queries are reduced by caching the output as well as using 1 query (instead of 2) to find a user using an SSH key.
* | | Merge branch 'update-runner-information' into 'master' Rémy Coutable2016-10-051-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update runner version only when updating contacted_at ## What does this MR do? Improves how we update runners table, especially the version. This is another round of improvements to reduce number of `ci_runners` updates. I did make `contacted_at` to be updated more often (on average every 15 minutes). We will also update version information in one go to solve: https://gitlab.com/gitlab-org/gitlab-ce/issues/22206 Improves: https://gitlab.com/gitlab-org/gitlab-ce/issues/22590 Solves: https://gitlab.com/gitlab-org/gitlab-ce/issues/22206 See merge request !6537
| * | | Update runner version only when updating contacted_atKamil Trzcinski2016-10-031-1/+1
| | | |
* | | | Merge branch 'all-skipped-equals-success' into 'master' Rémy Coutable2016-10-053-15/+34
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Skipped jobs should be considered successful ## What does this MR do? If all jobs in previous stage are all skipped, the next stage should consider previous stage succeeded. ## Why was this MR needed? Since for now we consider all manual jobs if skipped, should not block the next stage from running. Closes #22598 See also #20342 (because this merge request conflicts with it) See merge request !6604
| * | | | Introduce all_state_names so that we could avoid NOT INLin Jen-Shin2016-10-052-2/+6
| | | | |
| * | | | Merge remote-tracking branch 'upstream/master' into all-skipped-equals-successLin Jen-Shin2016-10-0412-25/+53
| |\ \ \ \ | | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream/master: (55 commits) Restrict failed login attempts for users with 2FA Update RuboCop to 0.43.0 and update configuration Use SELECT 1, instead SELECT COUNT(*) to ask for notes existency Simplify Mentionable concern instance methods Fix issues importing services via Import/Export deployment refs in own folder, new method for creating refs Update method name Save a fetchable ref per deployement GrapeDSL for Namespace endpoint Remove SCSS rules for short hex chars. Fix bug when trying to cache closed issues from external issue trackers Upgrade acts-as-taggable-on from 3.5.0 to 4.0.0. Remove useless code now that Member#add_user handles it Combine requestFileSuccess arguments into `opts` Append issue template to existing description Invert method's naming Fix a few things after the initial improvment to Members::DestroyService Improve Members::DestroyService Add Container Registry on/off status to admin area Enable Lint/StringConversionInInterpolation cop and autocorrect offenses ...
| * | | | We don't need self. there. (sorry, can't resist anymore)Lin Jen-Shin2016-10-031-1/+1
| | | | |
| * | | | Merge branch 'master' into all-skipped-equals-successLin Jen-Shin2016-10-0310-92/+139
| |\ \ \ \ | | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (103 commits) Fixes sidebar navigation. Convert "SSH Keys" Spinach features to RSpec Enable import/export back for non-admins Update gitlab-shell to 3.6.3 Updated artwork of empty group state. Better empty state for Groups view. Members::RequestAccessService is tricter on permissions Add a /wip slash command Link to the "What requires downtime?" page from the Migration Style Guide Fix RuboCop failure in app/services/notification_service.rb Add word-wrap to issue title on issue and milestone boards Fix page scrolling to top on sidebar toggle Changed zero padded days to no padded days in date_format GrapeDSL for Keys endpoint Remove duplicate test Add a spec to verify comparison context inclusion in path when a version is chosen to compare against Add flash containers and broadcast messages below subnav Add white background to create MR banner Move create MR banner below subnav Remove contianer from last push widget ...
| * | | | Fix tests. Check 'success' first (default status)Lin Jen-Shin2016-10-031-1/+1
| | | | |
| * | | | Add test for CommitStatus.exclude_ignoredLin Jen-Shin2016-10-031-1/+0
| | | | |
| * | | | Remove dead codeLin Jen-Shin2016-10-031-2/+0
| | | | |
| * | | | Style/EmptyLinesAroundBlockBodyLin Jen-Shin2016-10-031-0/+3
| | | | |
| * | | | Specify 3 cases we want them to be excluded. [ci skip]Lin Jen-Shin2016-10-031-0/+1
| | | | |
| * | | | Rename ignored to failed_but_allowed, introduce exclude_ignoredLin Jen-Shin2016-10-033-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | which merges previous exclude_ignored_jobs and failed_but_allowed, so that we don't treat ignored a special case in HasStatus.
| * | | | Add a test for on_failure jobs in the middleLin Jen-Shin2016-10-011-0/+1
| | | | |
| * | | | on_failure should also be ignored, and status_sql shouldLin Jen-Shin2016-10-011-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | also respect this ignorance. Address feedback from: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6604#note_16273363
| * | | | Or we could simply ignore skipped manual jobsLin Jen-Shin2016-09-301-1/+1
| | | | |
| * | | | We consider skipped = success, fixes #22598Lin Jen-Shin2016-09-301-1/+1
| | | | |
* | | | | Merge branch 'remove-reset-project-activity-lease' into 'master' Rémy Coutable2016-10-051-12/+7
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove lease from Event#reset_project_activity ## What does this MR do? This removes the exclusive lease used by `Event#reset_project_activity` in favour of conditional UPDATE queries. See dbcc623a901cb3fb725976217416bafad73dbf69 for more information. ## Why was this MR needed? Obtaining the lease can, for whatever reason, be _really_ slow. See https://gitlab.com/gitlab-org/gitlab-ce/issues/22473 for more information. https://gitlab.com/gitlab-org/gitlab-ce/issues/22473 See merge request !6678
| * | | | | Remove lease from Event#reset_project_activityremove-reset-project-activity-leaseYorick Peterse2016-10-041-12/+7
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per GitLab.com's performance metrics this method could take up to 5 seconds of wall time to complete, while only taking 1-2 milliseconds of CPU time. Removing the Redis lease in favour of conditional updates allows us to work around this. A slight drawback is that this allows for multiple threads/processes to try and update the same row. However, only a single thread/process will ever win since the UPDATE query uses a WHERE condition to only update rows that were not updated in the last hour. Fixes gitlab-org/gitlab-ce#22473
* | | | | Fix project deletion when feature visibility is set to privatesh-fix-project-deletion-private-visibilityStan Hu2016-10-041-1/+4
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects that are destroyed are put in the pending_delete state. The ProjectDestroyWorker checks whether the current user has access, but since the ProjectFeature class uses the default scope of the Project, it will not be able to find the right project. This was a regression in 8.12 that caused the following stack trace: ``` NoMethodError: undefined method `team' for nil:NilClass from app/models/project_feature.rb:62:in `get_permission' from app/models/project_feature.rb:34:in `feature_available?' from app/models/project.rb:21:in `feature_available?' from app/policies/project_policy.rb:170:in `disabled_features!' from app/policies/project_policy.rb:29:in `rules' from app/policies/base_policy.rb:82:in `block in abilities' from app/policies/base_policy.rb:113:in `collect_rules' from app/policies/base_policy.rb:82:in `abilities' from app/policies/base_policy.rb:50:in `abilities' from app/models/ability.rb:64:in `uncached_allowed' from app/models/ability.rb:58:in `allowed' from app/models/ability.rb:49:in `allowed?' from app/services/base_service.rb:11:in `can?' from lib/gitlab/metrics/instrumentation.rb:155:in `block in can?' from lib/gitlab/metrics/method_call.rb:23:in `measure' from lib/gitlab/metrics/instrumentation.rb:155:in `can?' from app/services/projects/destroy_service.rb:18:in `execute' ``` Closes #22948
* | | | Merge branch 'restrict-failed-2fa-attempts' into 'master' Rémy Coutable2016-10-041-0/+16
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restrict failed login attempts from users with 2FA enabled. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/19799. See merge request !6668
| * | | | Restrict failed login attempts for users with 2FASean McGivern2016-10-041-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copy logic from `Devise::Models::Lockable#valid_for_authentication?`, as our custom login flow with two pages doesn't call this method. This will increment the failed login counter, and lock the user's account once they exceed the number of failed attempts. Also ensure that users who are locked can't continue to submit 2FA codes.
* | | | | Merge branch 'zj-save-environment-deployment-refs' into 'master' Kamil Trzciński2016-10-043-3/+17
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Save a fetchable ref per deployement cc @DouweM @ayufan See merge request !6618
| * | | | | deployment refs in own folder, new method for creating refszj-save-environment-deployment-refsZ.J. van de Weg2016-10-043-3/+7
| | | | | |
| * | | | | Update method nameZeger-Jan van de Weg2016-10-041-1/+1
| | | | | |
| * | | | | Save a fetchable ref per deployementZ.J. van de Weg2016-10-042-2/+12
| | | | | |
* | | | | | Merge branch 'issue_22446' into 'master' Sean McGivern2016-10-041-0/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix bug when trying to cache closed issues from external issue trackers fixes #22446 See merge request !6619
| * \ \ \ \ \ Merge branch 'master' into issue_22446Sean McGivern2016-10-041-0/+1
| |\ \ \ \ \ \ | | | |/ / / / | | |/| | | |
| * | | | | | Fix bug when trying to cache closed issues from external issue trackersissue_22446Felipe Artur2016-10-031-0/+4
| | |/ / / / | |/| | | |
* | | | | | Merge branch 'cleanup-mentionable-methods-arguments' into 'master' Douwe Maan2016-10-041-17/+10
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify Mentionable concern instance methods ## What does this MR do? Simplify arguments received by the instance methods on the concern so in the closer future will be easy to understand and change ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !6596
| * | | | | Simplify Mentionable concern instance methodsPaco Guzman2016-10-041-17/+10
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We remove some arguments that are rarely used or used just to simplify setups on specs. Modified Mentionable#create_new_cross_references method we don’t need to calculate previous references to avoid the duplication because we do that at database level when creating references extracted from the current entity state. MergeRequests won’t create cross_references for commits that are included so we change a spec to use a different merge request to make references to commits to other branches
* | | | | Fix issues importing services via Import/ExportJames Lopez2016-10-041-0/+1
|/ / / /
* | | | Merge branch 'rs-string-conversion-in-interpolation' into 'master' Rémy Coutable2016-10-031-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Lint/StringConversionInInterpolation cop and autocorrect offenses See merge request !6654
| * | | | Enable Lint/StringConversionInInterpolation cop and autocorrect offensesrs-string-conversion-in-interpolationRobert Speicher2016-10-031-1/+1
| | |/ / | |/| |