summaryrefslogtreecommitdiff
path: root/spec/services/projects
Commit message (Collapse)AuthorAgeFilesLines
* Correct RSpec/SingleLineHook cop offensesRobert Speicher2017-06-141-3/+9
|
* Bring in security changes from the 9.2.5 releaseDJ Mountney2017-06-071-2/+2
| | | | | | | | | | | | | Ran: - git format-patch v9.2.2..v9.2.5 --stdout > patchfile.patch - git checkout -b 9-2-5-security-patch origin/v9.2.2 - git apply patchfile.patch - git commit - [Got the sha ref for the commit] - git checkout -b upstream-9-2-security master - git cherry-pick <SHA of the patchfile commit> - [Resolved conflicts] - git cherry-pick --continue
* Translate project & repository pagesBob Van Landuyt2017-06-071-1/+1
|
* Just let the user to create the namespace2563-backport-ee1942Lin Jen-Shin2017-06-061-4/+4
|
* Merge branch 'pull-mirror-overhaul-ce-backport' into 'master'Douwe Maan2017-06-051-5/+3
|\ | | | | | | | | backports changed import logic from pull mirroring feature into CE See merge request !11850
| * backports changed import logic from pull mirroring feature into CETiago Botelho2017-06-051-5/+3
| |
* | Allow manual bypass of auto_sign_in_with_providermabes/gitlab-ce-bypass-auto-loginMaxime Besson2017-06-021-1/+1
|/ | | | | | | | | This commit lets a user bypass the automatic signin on the login form, in order to login with a technical (admin, etc) account Closes #3786 Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge branch 'rework-authorizations-performance' into 'master'Douwe Maan2017-05-291-1/+1
|\ | | | | | | | | Rework project authorizations and nested groups for better performance See merge request !10885
| * Use CTEs for nested groups and authorizationsYorick Peterse2017-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the usage of Common Table Expressions (CTEs) to efficiently retrieve nested group hierarchies, without having to rely on the "routes" table (which is an _incredibly_ inefficient way of getting the data). This requires a patch to ActiveRecord (found in the added initializer) to work properly as ActiveRecord doesn't support WITH statements properly out of the box. Unfortunately MySQL provides no efficient way of getting nested groups. For example, the old routes setup could easily take 5-10 seconds depending on the amount of "routes" in a database. Providing vastly different logic for both MySQL and PostgreSQL will negatively impact the development process. Because of this the various nested groups related methods return empty relations when used in combination with MySQL. For project authorizations the logic is split up into two classes: * Gitlab::ProjectAuthorizations::WithNestedGroups * Gitlab::ProjectAuthorizations::WithoutNestedGroups Both classes get the fresh project authorizations (= as they should be in the "project_authorizations" table), including nested groups if PostgreSQL is used. The logic of these two classes is quite different apart from their public interface. This complicates development a bit, but unfortunately there is no way around this. This commit also introduces Gitlab::GroupHierarchy. This class can be used to get the ancestors and descendants of a base relation, or both by using a UNION. This in turn is used by methods such as: * Namespace#ancestors * Namespace#descendants * User#all_expanded_groups Again this class relies on CTEs and thus only works on PostgreSQL. The Namespace methods will return an empty relation when MySQL is used, while User#all_expanded_groups will return only the groups a user is a direct member of. Performance wise the impact is quite large. For example, on GitLab.com Namespace#descendants used to take around 580 ms to retrieve data for a particular user. Using CTEs we are able to reduce this down to roughly 1 millisecond, returning the exact same data. == On The Fly Refreshing Refreshing of authorizations on the fly (= when users.authorized_projects_populated was not set) is removed with this commit. This simplifies the code, and ensures any queries used for authorizations are not mutated because they are executed in a Rails scope (e.g. Project.visible_to_user). This commit includes a migration to schedule refreshing authorizations for all users, ensuring all of them have their authorizations in place. Said migration schedules users in batches of 5000, with 5 minutes between every batch to smear the load around a bit. == Spec Changes This commit also introduces some changes to various specs. For example, some specs for ProjectTeam assumed that creating a personal project would _not_ lead to the owner having access, which is incorrect. Because we also no longer refresh authorizations on the fly for new users some code had to be added to the "empty_project" factory. This chunk of code ensures that the owner's permissions are refreshed after creating the project, something that is normally done in Projects::CreateService.
* | Fix propagate service spec transient failurefix/transient-service-template-specJames Lopez2017-05-231-4/+8
| |
* | minor adjustments to the specsJose Ivan Vargas2017-05-221-1/+1
| |
* | Renamed some messages and refactored the project_edit class to a functionJose Ivan Vargas2017-05-221-1/+1
| |
* | Prevent project transfer if a new group is not selectedJose Ivan Vargas2017-05-221-0/+1
|/
* Use relative paths for group/project/user avatarsblackst0ne2017-05-101-3/+2
|
* Merge branch 'fix/admin-integrations' into 'master' Sean McGivern2017-05-051-0/+103
|\ | | | | | | | | | | | | Fix new admin integrations not taking effect on existing project Closes #26376 See merge request !11069
| * refactor code based on feedbackfix/admin-integrationsJames Lopez2017-05-051-7/+11
| |
| * refactor code based on feedbackJames Lopez2017-05-051-9/+8
| |
| * add callbacks in bulkJames Lopez2017-05-051-0/+18
| |
| * fixed all issues - not doing bulk create.James Lopez2017-05-051-0/+12
| |
| * refactor a few things based on feedbackJames Lopez2017-05-041-4/+4
| |
| * add more examples for testing SQLJames Lopez2017-05-041-0/+30
| |
| * refactor worker into serviceJames Lopez2017-05-041-0/+40
| |
* | Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into mia_backort[ci ↵Valery Sizov2017-05-051-73/+0
|\ \ | | | | | | | | | skip]
| * \ Merge branch '12910-uploader-pers-snippet' into 'master' Sean McGivern2017-05-041-73/+0
| |\ \ | | | | | | | | | | | | | | | | Prepare uploaders for personal snippets comments See merge request !11022
| | * | Support uploaders for personal snippets comments12910-uploader-pers-snippetJarka Kadlecova2017-05-021-73/+0
| | | |
* | | | Backport of multiple_assignees_feature [ci skip]Valery Sizov2017-05-041-1/+1
|/ / /
* | | Merge branch ↵Rémy Coutable2017-05-031-0/+10
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | '29673-500-internal-server-error-when-enabling-a-deploy-key-more-than-once-through-api' into 'master' Detect already enabled DeployKeys in EnableDeployKeyService Closes #29673 See merge request !11010
| * | Detect already enabled DeployKeys in EnableDeployKeyServiceMark Fletcher2017-05-031-0/+10
| |/ | | | | | | Ensures deploy keys can't be re-added, which causes a validation error
* | Auto-correct `RSpec/DescribedClass` violationsrs-described_class-cop-2Robert Speicher2017-05-011-1/+1
|/
* Make namespace owner master of project upon creationtc-make-user-master-project-by-adminToon Claes2017-04-271-0/+16
| | | | | When an admin creates a project in the namespace of a user, that user automatically gains master access to that project.
* Does not remove the GitHub remote when importing from GitHubDouglas Barbosa Alexandre2017-04-181-0/+9
|
* Improve error messages when a record is unable to be created for a projectStan Hu2017-04-131-0/+14
|
* Merge branch 'master' into feature/multi-level-container-registry-imagesGrzegorz Bizon2017-04-041-30/+53
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (57 commits) Ensure we generate unique usernames otherwise validations fail Fix a Knapsack issue that would load support/capybara.rb before support/env.rb Ensure users have a short username otherwise a click event is triggered ... Enable the `bullet_logger` setting; enable `raise` in test environment Fix Rubocop offenses Set the right timeout for Gitlab::Shell#fetch_remote Refactoring Projects::ImportService Move methods that are not related to mirroring to the repository model Fix GitHub pull request formatter spec Rename skip_metrics to imported on the importable concern Add CHANGELOG Remove unused include from RepositoryImportWorker Skip MR metrics when importing projects from GitHub Fetch GitHub project as a mirror to get all refs at once Make file templates easy to use and discover Ensure user has a unique username otherwise `user10` would match `user1` Ensure the AbuseReport fixtures create unique reported users Don't use FFaker in factories, use sequences instead Fix brittle specs Fix the AbuseReport seeder ... Conflicts: db/schema.rb
| * Refactoring Projects::ImportServiceDouglas Barbosa Alexandre2017-04-031-30/+53
| |
* | Remove legacy registry tags when deleting a projectGrzegorz Bizon2017-04-041-18/+50
| |
* | Refactor container registry repository tag stubsGrzegorz Bizon2017-04-032-2/+2
| |
* | Merge branch 'master' into feature/multi-level-container-registry-imagesGrzegorz Bizon2017-04-038-20/+23
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (230 commits) Fix N+1 query in loading pipelines in merge requests Fix Spinach and Capybara dependencies Prevent users from disconnecting gitlab account from CAS 30276 Move issue, mr, todos next to profile dropdown in top nav Refactor SearchController#show Properly eagerly-load the Capybara server for JS feature specs only Updating documentation to include a missing step in the update procedure Eager-load the Capybara server to prevent timeouts Increase Capybara's timeout Add metrics button to Environment Overview page Fix link to Jira service documentation Handle parsing OpenBSD ps output properly to display sidekiq infos on ... Eliminate unnecessary queries that add ~500 ms of load time for a large issue 20914 Limits line length for project home page Allow users to import GitHub projects to subgroups Update dpl CI example Fix the docs:check:links job Don't clean up the gitlab-test-fork_bare repo Make GitLab use Gitaly for commit_is_ancestor Remove unnecessary ORDER BY clause from `forked_to_project_id` subquery ...
| * Use `:empty_project` where possible in service specsRobert Speicher2017-03-278-20/+23
| |
* | Improve code related to removing container image tagsGrzegorz Bizon2017-03-311-2/+4
| |
* | Merge branch 'master' into feature/multi-level-container-registry-imagesGrzegorz Bizon2017-03-271-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (192 commits) Implement new service for creating user Update sentry-raven 2.0.2 -> 2.4.0 Update webmock 1.21.0 -> 1.24.6 Update spring 1.7.2 -> 2.0.1 Update simplecov 0.12.0 -> 0.14.1 Update pry-rails 0.3.4 -> 0.3.5 Update pry-byebug 3.4.1 -> 3.4.2 Update flay 2.6.1 -> 2.8.1 Remove Tags filter from Projects Explore dropdown Update capybara-screenshot 1.0.11 -> 1.0.14 Update bullet 5.2.0 -> 5.5.1 Update brakeman 3.4.1 -> 3.6.1 Remove web-console gem Update better_errors 1.0.1 -> 2.1.1 Display flash message to unauthenticated user when creating new issue Fix up emoji tests that should have failed :/ Fix RSpec/DescribeSymbol cop violations Add event limit warning all tabs Cycle Analytics Adding non_archived scope for counting projects Resolve "Gitlab administrator cannot create projects in every group" ... Conflicts: db/schema.rb
| * Fix RSpec/DescribeSymbol cop violationsRobert Speicher2017-03-241-2/+2
| |
* | Fix specs for services related to container registryGrzegorz Bizon2017-03-242-2/+2
| |
* | Rename container image to repository in specsGrzegorz Bizon2017-03-232-4/+4
| |
* | Fix some specs using the old ContainerImage constGrzegorz Bizon2017-03-231-2/+2
| |
* | Merge branch 'master' into feature/multi-level-container-registry-imagesGrzegorz Bizon2017-03-214-9/+51
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (1327 commits) Merge branch 'render-json-leak' into 'security' Merge branch 'ssrf' into 'security' Merge branch 'ssrf' into 'security' Merge branch 'fix-links-target-blank' into 'security' Merge branch '28058-hide-emails-in-atom-feeds' into 'security' Fix karma test Reset filters after click Handle Route#name being nil after an update Only add frontend code coverage instrumentation when generating coverage report fix recompile assets step in 9.0 upgrade guide to use yarn Undo explicit conversion to Integer Make level_value accept string integers Make feature spec more robust Removed d3.js from the main application.js bundle Extend compound status for manual actions specs Update css to be nice and tidy. Fix pipeline status for transition between stages add an index to the ghost column Return 404 in project issues API endpoint when project cannot be found Improve rename projects migration ... Conflicts: doc/ci/docker/using_docker_build.md spec/lib/gitlab/import_export/all_models.yml
| * Merge branch 'ssrf' into 'security' Douwe Maan2017-03-201-0/+20
| | | | | | | | | | Protect server against SSRF in project import URLs See merge request !2068
| * Fix Projects::UploadService specRobert Speicher2017-03-061-7/+7
| | | | | | | | | | | | | | | | | | | | | | For reasons unknown, this spec was passing a project's repository as the first argument to `Projects::UploadService`, while it was expecting the project itself. Previously this wasn't a problem because `FileUploader` only needed the object to respond to `path_with_namespace`, which Repository and Project both did. But now because of `Upload` and its polymorphic association, it expects the object to respond to `primary_key`.
| * Improve docs and specs related to pages artifactsGrzegorz Bizon2017-03-061-1/+3
| |
| * Delete artifacts for pages unless expiry date is specifieddelete-pagesKamil Trzcinski2017-03-051-0/+20
| |
| * Revert "Prefer leading style for Style/DotPosition"Douwe Maan2017-02-234-25/+25
| | | | | | | | This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.