Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-05-17Use CTEs for nested groups and authorizationsYorick Peterse
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.
2017-05-10Merge branch 'snippets-finder-visibility' into 'security'Douwe Maan
Refactor snippets finder & dont return internal snippets for external users See merge request !2094
2017-05-09Robustify environment policy specs to pass on EEGrzegorz Bizon
2017-05-08Add confirm delete protected branch modalSam Rose
2017-05-06Merge branch 'feature/gb/manual-actions-protected-branches-permissions' into ↵Kamil Trzciński
'master' Check access to a branch when user triggers manual action Closes #20261 See merge request !10494
2017-05-05Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into mia_backort[ci ↵Valery Sizov
skip]
2017-05-05Use update build policy instead of new play policyGrzegorz Bizon
2017-05-05Merge commit '3a2b60f7' from 'master'Grzegorz Bizon
* commit '3a2b60f7a0109cdb84e8727a2625318a746e84dc': (151 commits) Fixed Karma spec Reject EE reserved namespace paths in CE as well Updated webpack config Include the bundler:audit job into the static-analysis job Document serializers Add artifact file page that uses the blob viewer Pipeline table mini graph dropdown remains open when table is refreshed Adds off for event hub Compile gitlab-shell go executables Allow to create new branch and empty WIP merge request from issue page Moved to a view spec Improving copy of CONTRIBUTING.md, PROCESS.md, and code_review.md Convert seconds to minutes and hours on chat notifations Disable navigation to Pages config if Pages is disabled Sort the network graph both by commit date and topographically. Add tooltips to note action buttons Add breadcrumb, build header and pipelines submenu to artifacts browser Update todos screenshots removes the possibility of commit messages having carriage returns Handle incoming emails from aliases correctly ...
2017-05-05Fix specsClement Ho
2017-05-02Support uploaders for personal snippets commentsJarka Kadlecova
2017-05-02Fix environment policy class name in specsGrzegorz Bizon
2017-05-02Merge branch 'master' into ↵Grzegorz Bizon
feature/gb/manual-actions-protected-branches-permissions * master: (314 commits) Better Explore Groups view Update Carrierwave and fog-core Add specs for Gitlab::RequestProfiler Add scripts/static-analysis to run all the static analysers in one go Shorten and improve some job names Group static-analysis jobs into a single job Don't blow up when email has no References header Update CHANGELOG.md for 9.1.2 Add changelog Add changelog Show Raw button as Download for binary files Use blob viewers for snippets Fix typo Fixed transient failure related to dropdown animations Revert "Merge branch 'tc-no-todo-service-select' into 'master'" fix link to MR 10416 Another change from .click -> .trigger('click') to make spec pass Change from .click -> .trigger('click') to make spec pass Disable AddColumnWithDefaultToLargeTable cop for pre-existing migrations Add AddColumnWithDefaultToLargeTable cop ... Conflicts: spec/requests/api/jobs_spec.rb
2017-05-01Add new ability check for stopping environmentGrzegorz Bizon
2017-04-26Enable RSpec/FilePath copSean McGivern
- Ignore JS fixtures - Ignore qa directory - Rewrite concern specs to put concern name first
2017-04-13Merge branch 'master' into ↵Grzegorz Bizon
feature/gb/manual-actions-protected-branches-permissions * master: (641 commits) Revert "Fix registry for projects with uppercases in path" Fix registry for projects with uppercases in path Move event icons into events_helper Reset New branch button when issue state changes Add link to environments on kubernetes.md Indent system notes on desktop screens Improve webpack-dev-server compatibility with non-localhost setups. Add changelog entry Fix recent searches icon alignment in Safari Use preload to avoid Rails using JOIN Fix NUMBER_OF_TRUNCATED_DIFF_LINES re-definition error Prepare for zero downtime migrations Fix filtered search input width for IE Fix the `gitlab:gitlab_shell:check` task Fixed random failures with Poll spec Include CONTRIBUTING.md file when importing .gitlab-ci.yml templates Let uses hide verbose output by default Separate examples for each other Collapse similar sibling scenarios Use empty_project for resources that are independent of the repo ... Conflicts: app/views/projects/ci/builds/_build.html.haml
2017-04-12Implement new rule for manual actions in policiesGrzegorz Bizon
2017-04-12Merge branch 'siemens/gitlab-ce-fix/subgroup-hide-button' into 'master' Rémy Coutable
Hide new subgroup button if user has no permission to create one Closes #30139 See merge request !10627
2017-04-11Move permission to create subgroup into GroupPolicyDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-03-28Use `:empty_project` where possible in policy specsRobert Speicher
2017-03-09spec the new behavior of .class_forhttp://jneen.net/
and more robustly spec the ancestor behavior
2017-03-07Improve pipeline triggers UIKamil Trzciński
2017-02-24Don't allow deleting a ghost user.Timothy Andrew
- Add a `destroy_user` ability. This didn't exist before, and was implicit in other abilities (only admins could access the admin area, so only they could destroy all users; a user can only access their own account page, and so can destroy only themselves). - Grant this ability to admins, and when the current user is trying to destroy themselves. Disallow destroying ghost users in all cases. - Modify the `Users::DestroyService` to check this ability. Also check it in views to decide whether or not to show the "Delete User" button. - Add a short summary of the Ghost User to the bio.
2017-02-07More backportDouwe Maan
2017-01-23Fix build access policies when pipelines are publicGrzegorz Bizon
2017-01-18More improvements to presentersRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-18Handle presenters in BasePolicyRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-26Include group parents into read access for project and groupDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-15Add missing group policy specDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-04Update effected testsZ.J. van de Weg
2016-12-04Guests can read builds if those are publicZ.J. van de Weg
Fixes #18448
2016-11-30Improve ProjectPolicy spec to check permissions when wiki is disabledDouglas Barbosa Alexandre
2016-11-07Added tests for IssuePolicyYorick Peterse
2016-11-01Allow owners to fetch source code in CI buildsKamil Trzcinski
Due to different way of handling owners of a project, they were not allowed to fetch CI sources for project.
2016-10-28Add specs for a user from a group linkSean McGivern
2016-10-28Fix project member access for group linksSean McGivern
`ProjectTeam#find_member` doesn't take group links into account. It was used in two places: 1. An admin view - it can stay here. 2. `ProjectTeam#member?`, which is often used to decide if a user has access to view something. This second part broke confidential issues viewing. `IssuesFinder` ends up delegating to `Project#authorized_for_user?`, which does consider group links, so users with access to the project via a group link could see confidential issues on the index page. However, `IssuesPolicy` used `ProjectTeam#member?`, so the same user couldn't view the issue when going to it directly.
2016-10-11Make guests unable to view MRsValery Sizov
2016-10-07Improve project policy specAlejandro Rodríguez
2016-09-20Test if issue authors can access private projectsFelipe Artur
2016-08-30add project_policy_spec to replace .project_abilities spechttp://jneen.net/