summaryrefslogtreecommitdiff
path: root/spec/models
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'feature/improve-async-pipeline-processing' into 'master' Kamil Trzciński2016-10-061-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix hipchat service specs after changes in pipelineGrzegorz Bizon2016-10-041-1/+1
| |
* | Merge commit 'dev/security' into 'master'Rémy Coutable2016-10-061-0/+1
|\ \ | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | Enforce the fork_project permission in Projects::CreateServiceNick Thomas2016-09-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects::ForkService delegates to this service almost entirely, but needed one small change so it would propagate create errors correctly. CreateService#execute needs significant refactoring; it is now right at the complexity limit set by Rubocop. I avoided doing so in this commit to keep the diff as small as possible. Several tests depend on the insecure behaviour of ForkService, so fi them up at the same time.
* | | Merge branch 'trending-caching' into 'master' Rémy Coutable2016-10-051-0/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+17
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+17
| |/ / / | | | | | | | | | | | | | | | | | | | | 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 'all-skipped-equals-success' into 'master' Rémy Coutable2016-10-053-40/+62
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * \ \ \ Merge remote-tracking branch 'upstream/master' into all-skipped-equals-successLin Jen-Shin2016-10-049-28/+87
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 ...
| * | | | Merge branch 'master' into all-skipped-equals-successLin Jen-Shin2016-10-038-64/+312
| |\ \ \ \ | | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-23/+20
| | | | |
| * | | | Add test for CommitStatus.exclude_ignoredLin Jen-Shin2016-10-031-15/+40
| | | | |
| * | | | Rename ignored to failed_but_allowed, introduce exclude_ignoredLin Jen-Shin2016-10-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | which merges previous exclude_ignored_jobs and failed_but_allowed, so that we don't treat ignored a special case in HasStatus.
* | | | | Remove lease from Event#reset_project_activityremove-reset-project-activity-leaseYorick Peterse2016-10-042-8/+4
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge branch 'zj-save-environment-deployment-refs' into 'master' Kamil Trzciński2016-10-041-0/+10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-041-0/+10
| | | | |
* | | | | Merge branch 'issue_22446' into 'master' Sean McGivern2016-10-041-0/+24
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+17
| |\ \ \ \ \
| * | | | | | Fix bug when trying to cache closed issues from external issue trackersissue_22446Felipe Artur2016-10-031-0/+24
| | |/ / / / | |/| | | |
* | | | | | Merge branch 'cleanup-mentionable-methods-arguments' into 'master' Douwe Maan2016-10-042-8/+16
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-042-8/+16
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+17
|/ / / /
* | | | Merge branch 'master' into 'master' Rémy Coutable2016-10-035-20/+20
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | Changed Slack service user referencing from full name to username Closes #22737 See merge request !6624
| * | | Changed Slack service user referencing from full name to usernamesecustor2016-10-035-20/+20
| | | |
* | | | Merge branch '21225-wip-slash-command-for-mrs' into 'master' Rémy Coutable2016-10-031-0/+40
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a /wip slash command to toggle the 'WIP' prefix in the MR title ## Why was this MR needed? As explained in #21225, it prevents you from having to click through the entire edit form just to mark an MR as WIP. Closes #21225 See merge request !6259
| * | | | Add a /wip slash commandThomas Balthazar2016-10-031-0/+40
| |/ / / | | | | | | | | | | | | It toggles the 'WIP' prefix in the MR title.
* | | | Members::RequestAccessService is tricter on permissionsRémy Coutable2016-10-031-1/+1
|/ / / | | | | | | | | | | | | | | | Fortunately, only specs needed to be fixed, so that's good! Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch ↵Robert Speicher2016-10-025-58/+266
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '21983-member-add_user-doesn-t-detect-existing-members-that-have-requested-access' into 'master' Resolve "`Member.add_user`doesn't detect existing members that have requested access" ## What does this MR do? This merge request handle the case when an access requester is added to a group or project (via the members page or the API). In `Member.add_user`, if an access requester already exists, we simply accept their request (and set the `created_by`, `access_level` and `expires_at` attributes if given). ## Are there points in the code the reviewer needs to double check? I've taken the opportunity to cleanup the whole `{Group,Project}Member.add_user*` methods since it was quite a mess. ## What are the relevant issue numbers? Closes #21983 See merge request !6393
| * | | Allow Member.add_user to handle access requestersRémy Coutable2016-09-285-58/+266
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes include: - Ensure Member.add_user is not called directly when not necessary - New GroupMember.add_users_to_group to have the same abstraction level as for Project - Refactor Member.add_user to take a source instead of an array of members - Fix Rubocop offenses - Always use Project#add_user instead of project.team.add_user - Factorize users addition as members in Member.add_users_to_source - Make access_level a keyword argument in GroupMember.add_users_to_group and ProjectMember.add_users_to_projects - Destroy any requester before adding them as a member - Improve the way we handle access requesters in Member.add_user Instead of removing the requester and creating a new member, we now simply accepts their access request. This way, they will receive a "access request granted" email. - Fix error that was previously silently ignored - Stop raising when access level is invalid in Member, let Rails validation do their work Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch 'rc-new-members-request-access-service' into 'master' Robert Speicher2016-10-023-4/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | New `Members::RequestAccessService` Part of #21979. See merge request !6265
| * | | Re-add the AccessRequestable concernRémy Coutable2016-09-223-15/+40
| | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | Fix specs that requires an access requestRémy Coutable2016-09-223-4/+4
| | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | New Members::RequestAccessServiceRémy Coutable2016-09-223-40/+15
| | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | Allowing ">" to be used for Milestone models's title and storing the value ↵Makoto Scott-Hinkle2016-09-291-2/+2
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in db as unescaped. Updating test value for milestone title Adding API test for title with reserved HTML characters. Updating changelog Adding the MR number for fixing bug #22452. removing duplicate line Updating MR number.
* | | Improve how MergeCommit#merge_commit_message builds the messageRobert Speicher2016-09-271-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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:
* | | Fix the "Commits" section of the cycle analytics summary.Timothy Andrew2016-09-261-0/+6
| |/ |/| | | | | | | | | | | | | | | - 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.
* | added more specsJames Lopez2016-09-261-0/+16
| |
* | Ensure milestones passed to GlobalMilestone is an ActiveRecord::RelationAhmad Sherif2016-09-231-2/+3
| |
* | Add test for MergeRequestDiff#commits_sha, feedback:Lin Jen-Shin2016-09-221-0/+22
| | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6470#note_15856755
* | For empty merge_request_diff st_commits would be nilfix-pipeline-for-empty-merge-request-diffLin Jen-Shin2016-09-221-6/+21
|/ | | | Closes #22438
* Merge branch 'and-you-get-awards' into 'master' Rémy Coutable2016-09-211-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Snippets get award emoji! :thumbsup:Z.J. van de Weg2016-09-191-0/+2
| |
* | Merge branch 'rs-simplify-fetch_members' into 'master' Rémy Coutable2016-09-211-0/+62
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Fix a logic error in ProjectTeam#fetch_invited_membersRobert Speicher2016-09-201-0/+1
| | | | | | | | | | | | | | | | | | 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.
| * | Add specs for ProjectTeam#fetch_membersRobert Speicher2016-09-201-0/+61
| | |
* | | Merge branch 'show-all-pipelines-from-all-diffs' into 'master' Rémy Coutable2016-09-211-6/+53
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Use factory instead of using new directly. Feedback:show-all-pipelines-from-all-diffsLin Jen-Shin2016-09-211-9/+2
| | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6414#note_15765156
| * | | Add a test for non-persisted merge requestLin Jen-Shin2016-09-201-0/+22
| | | |
| * | | Test against MergeRequest#all_commits_sha, feedback:Lin Jen-Shin2016-09-201-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6414#note_15750344 So that we could just use it in testing for MergeRequest#all_pipelines