summaryrefslogtreecommitdiff
path: root/spec/factories
Commit message (Collapse)AuthorAgeFilesLines
* Introduce source to pipeline entitytrigger-sourceKamil Trzcinski2017-05-311-0/+1
|
* Merge branch 'rework-authorizations-performance' into 'master'Douwe Maan2017-05-291-0/+12
|\ | | | | | | | | Rework project authorizations and nested groups for better performance See merge request !10885
| * Use CTEs for nested groups and authorizationsYorick Peterse2017-05-171-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'fix-kubernetes-namespace' into 'master'Grzegorz Bizon2017-05-251-1/+0
|\ \ | | | | | | | | | | | | | | | | | | Fix terminals support for Kubernetes service Closes #31754 See merge request !11653
| * | Fix terminals support for Kubernetes serviceKamil Trzcinski2017-05-251-1/+0
| | | | | | | | | | | | It was broken, because we introduced a default namespace, which was not used by terminal methods.
* | | Merge branch '17848-web-hook-logging' into 'master'Dmitriy Zaporozhets2017-05-251-0/+14
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Implement Web Hooks calls logging Closes #17848 See merge request !11027
| * | Implement web hooks loggingAlexander Randa2017-05-251-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | * implemented logging of project and system web hooks * implemented UI for user area (project hooks) * implemented UI for admin area (system hooks) * implemented retry of logged webhook * NOT imeplemented log remover
* | | create User#rss_token in user factory explicitelyAlexis Reigel2017-05-241-0/+4
| | | | | | | | | | | | | | | otherwise we'll have to use `user.reload` in the specs to get the current rss_token value.
* | | Merge branch 'issue_32225' into 'master'Robert Speicher2017-05-231-0/+9
|\ \ \ | | | | | | | | | | | | | | | | Add transient head_pipeline_of to pipeline factories See merge request !11566
| * | | Add transient head_pipeline_of to pipeline factoriesissue_32225Felipe Artur2017-05-221-0/+9
| | | |
* | | | Add feature test with unicode traceadd-unicode-trace-feature-testShinya Maeda2017-05-231-0/+10
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 43e5bba774e9e383dd55c665e82f6fcfc4ebfc4f Author: Shinya Maeda <gitlab.shinyamaeda@gmail.com> Date: Mon Apr 17 17:28:44 2017 +0900 Add fix commit 09610eebdf22ad048812bb86022504b2ad917e19 Author: Shinya Maeda <gitlab.shinyamaeda@gmail.com> Date: Mon Apr 17 17:03:49 2017 +0900 Add trace test
* | | Merge branch 'fix_removing_invited_member' into 'master'Rémy Coutable2017-05-182-0/+12
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix: Deleting an invited member causes 500 error Closes #32504 See merge request !11481
| * | | Fix: Deleting an invited member causes 500 errorValery Sizov2017-05-182-0/+12
| |/ /
* | | If TestEnv#set_repo_refs fails, clean test repos and retryRémy Coutable2017-05-181-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, new references are not retrieved when a `git fetch` is called in a bare repos. The easiest solution is to cleanup the test repos and retry in this case. This only happens when a new ref is added to TestEnv::BRANCH_SHA or TestEnv::FORKED_BRANCH_SHA. Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Factorize TestEvent#copy_repoRémy Coutable2017-05-181-1/+1
|/ / | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'bvl-rename-build-events-to-job-events' into 'master' cherry-pick-0663458cDouwe Maan2017-05-161-1/+1
| | | | | | | | | | | | | | Rename `build_events` to `job_events` Closes #31620 See merge request !11287
* | Revert "Merge branch 'bvl-rename-build-events-to-job-events' into 'master'"Douwe Maan2017-05-151-1/+1
| | | | | | This reverts merge request !11287
* | Rename `build_events` to `job_events` in codeBob Van Landuyt2017-05-151-1/+1
|/
* Remove rails dependent: :destroy statementZ.J. van de Weg2017-05-111-0/+2
| | | | | | | Enforced by the database, and no callbacks need to be called. Combined with 7b9b2c6099 and 294a8b8a6d this resolves gitlab-org/gitlab-ce#31799
* Enable the Style/TrailingCommaInLiteral copRémy Coutable2017-05-101-1/+1
| | | | | | Use the EnforcedStyleForMultiline: no_comma option. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Add Pipeline Schedules that supersedes experimental Trigger ScheduleZeger-Jan van de Weg2017-05-071-6/+7
|
* Merge branch 'feature/gb/manual-actions-protected-branches-permissions' into ↵Kamil Trzciński2017-05-061-2/+8
|\ | | | | | | | | | | | | | | | | | | 'master' Check access to a branch when user triggers manual action Closes #20261 See merge request !10494
| * Merge branch 'master' into ↵Grzegorz Bizon2017-05-032-1/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/gb/manual-actions-protected-branches-permissions * master: (103 commits) Include missing project attributes to Import/Export Create the rest of the wiki docs Fill in information about creating the wiki Home page Move wiki doc to its own index page Create initial file for Wiki documentation Default to null user when asignee is unselected Re-enable ref operations with gitaly after not-found fix #31560 Add repo parameter to gitaly:install and workhorse:install Remove N+1 queries when checking nodes visible to user Don't validate reserved words if the format doesn't match Revert "Shorten and improve some job names" Remove unused initializer DRY the `<<: *except-docs` a bit in `.gitlab-ci.yml` Make the static-analysis job be run for docs branches too Add download_snippet_path helper Refresh the markdown cache if it was `nil` Add some documentation for the new migration helpers Update comments Display comments for personal snippets Update docs on creating a project ...
| * \ Merge branch 'master' into ↵Grzegorz Bizon2017-05-025-0/+40
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * \ \ Merge branch 'master' into ↵Grzegorz Bizon2017-04-221-0/+4
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/gb/manual-actions-protected-branches-permissions * master: (274 commits) Update VERSION to 9.2.0-pre Update CHANGELOG.md for 9.1.0 Update Auto Deploy documentation Disable import URL field in New project form since it's hidden by default Remove reference to burndown charts since they don't exist for ce. Use master_password for Sentinel Refactor Discussions docs Start versioning cached markdown fields Refactor add_users method for project and group Improved the spec Now correctly tests against different forms Refactor environments components into vue files - part 3 Adding animation for all dropdown fix placeholder visibility submodule_links: handle urls that don't end with .git Add help regarding vue resource and where to include it Append .json to ajax endpoint to prevent browser to display raw json Fixed the preview keyboard shortcut focusing wrong tab Fix broken link Added new discussions docs Started on resolvable discussions docs ...
| * \ \ \ Merge branch 'master' into ↵Grzegorz Bizon2017-04-138-6/+125
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | Take branch access into account when stopping environmentGrzegorz Bizon2017-04-061-1/+5
| | | | | |
| * | | | | Fix specs related to new manual actions permissionsGrzegorz Bizon2017-04-061-1/+3
| | | | | |
* | | | | | Merge branch '12910-personal-snippets-notes' into 'master' Sean McGivern2017-05-051-0/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support comments for personal snippets Closes #12910 See merge request !11090
| * | | | | | Support comments for personal snippetsJarka Kadlecova2017-05-051-0/+2
| | |_|_|_|/ | |/| | | |
* | | | | | Backport avatar-related spec changes from gitlab-org/gitlab-ee@4b464eaaeebackport-ee-4b464eaaeeRémy Coutable2017-05-042-0/+8
|/ / / / / | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | | Merge branch '12910-personal-snippets-notes-show' into 'master' Sean McGivern2017-05-021-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Display comments for personal snippets See merge request !10974
| * | | | | Display comments for personal snippets12910-personal-snippets-notes-showJarka Kadlecova2017-05-021-1/+1
| | |_|_|/ | |/| | |
* | | | | Merge branch '19364-webhook-edit' into 'master' Dmitriy Zaporozhets2017-05-021-0/+2
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | Implement ability to update hooks Closes #19364 See merge request !10816
| * | | | Implement ability to update hooksAlexander Randa2017-04-281-0/+2
| | | | |
* | | | | Update Carrierwave and fog-coreZeger-Jan van de Weg2017-05-011-0/+4
|/ / / /
* | | | Resolve "Add more tests for spec/controllers/projects/builds_controller_spec.rb"Dosuken shinya2017-04-281-0/+13
| | | |
* | | | Merge branch 'remove-invalid-services' into 'master' Douwe Maan2017-04-271-0/+13
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Remove invalid services with nil or empty type See merge request !10847
| * | | | tadds migration to remove invalid servicesTiago Botelho2017-04-271-0/+13
| | | | |
* | | | | Merge branch '26437-closed-by' into 'master' Rémy Coutable2017-04-261-0/+6
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | Add issues/:iid/closed_by api endpoint Closes #26437 See merge request !10511
| * | | | Add issues/:iid/closed_by api endpointmhasbini2017-04-121-0/+6
| | | | |
* | | | | Skip issuable without a project in IssuableExtractor#extractLin Jen-Shin2017-04-251-0/+4
| |_|_|/ |/| | | | | | | | | | | Closes #31280
* | | | Don't delete a branch involved in an open merge request in "Delete all ↵sh-issue-29247-fixStan Hu2017-04-191-0/+4
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | merged branches" service Customers were surprised by the previous behavior, which destroyed branches even though an open merge request existed for it. Closes #29427
* | | Add specsDouwe Maan2017-04-101-1/+2
|/ /
* | Merge branch 'master' into new-resolvable-discussionDouwe Maan2017-04-071-0/+4
|\ \
| * \ Merge branch 'adam-finish-5993-closed-issuable' into 'master' Douwe Maan2017-04-071-0/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Add indication for closed or merged issuables in GFM Closes #1369 See merge request !9462
| | * | Add indication for closed or merged issuables in GFMadam-finish-5993-closed-issuableAdam Buckland2017-04-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example: for issues that are closed, the links will now show '[closed]' following the issue number. This is done as post-process after the markdown has been loaded from the cache as the status of the issue may change between the cache being populated and the content being displayed. In order to avoid N+1 queries problem when rendering notes ObjectRenderer populates the cache of referenced issuables for all notes at once, before the post processing phase. As a part of this change, the Banzai BaseParser#grouped_objects_for_nodes method has been refactored to return a Hash utilising the node itself as the key, since this was a common pattern of usage for this method.
* | | | Merge branch 'master' into new-resolvable-discussionLuke "Jared" Bennett2017-04-072-1/+25
|\ \ \ \ | |/ / /
| * | | Merge branch ↵Sean McGivern2017-04-071-1/+3
| |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | 'dosuken123/gitlab-ce-2989-run-cicd-pipelines-on-a-schedule-idea1-basic-backend-implementation-with-quick-ui' into 'master' Add "engineering" UI for Pipeline Schedule See merge request !10533
| | * | Update tests to cover trigger scheduleKamil Trzcinski2017-04-071-1/+3
| | | |