summaryrefslogtreecommitdiff
path: root/spec/factories/projects.rb
Commit message (Collapse)AuthorAgeFilesLines
* Create idea of read-only databasetc-geo-read-only-ideaToon Claes2017-10-061-1/+1
| | | | | | | | | | | | In GitLab EE, a GitLab instance can be read-only (e.g. when it's a Geo secondary node). But in GitLab CE it also might be useful to have the "read-only" idea around. So port it back to GitLab CE. Also having the principle of read-only in GitLab CE would hopefully lead to less errors introduced, doing write operations when there aren't allowed for read-only calls. Closes gitlab-org/gitlab-ce#37534.
* Add support to migrate existing projects to Hashed Storage asynchashed-storage-migration-pathGabriel Mazetto2017-09-281-1/+7
|
* [Backported from EE] Readonly flag for ProjectsGabriel Mazetto2017-09-281-0/+4
| | | | | This is used in EE for the storage migration, and we want to use this in CE as well to be able to migrate projects to hashed_storage.
* Prevent new / renamed project from using a repository path that already ↵Gabriel Mazetto2017-08-251-2/+0
| | | | | | | | | | exists on disk There are some redundancies in the validation steps, and that is to preserve current error messages behavior Also few specs have to be changed in order to fix madness in validation logic.
* Make sure repository's removal work for legacy and hashed storages28283-uuid-storageGabriel Mazetto2017-08-221-1/+1
|
* New storage is now "Hashed" instead of "UUID"Gabriel Mazetto2017-08-221-0/+4
|
* Improve the Project factory to make `creator` defaults to namespace.ownerRémy Coutable2017-08-101-52/+47
| | | | | | | | Also improves the `create_templates` transient attribute and use `project.project_feature.update_columns` instead of `project.project_feature.update_attributes!` since it's faster. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Add a Circuitbreaker for storage pathsBob Van Landuyt2017-08-041-0/+6
|
* Change all `:empty_project` to `:project`rs-empty_project-defaultRobert Speicher2017-08-021-3/+1
|
* Remove `:empty_project` factory, implement `:repository` traitRobert Speicher2017-08-021-48/+43
|
* Rename path_with_namespace -> disk_path when dealing with the filesystemGabriel Mazetto2017-08-011-2/+2
|
* Fix the :project factory by not copying the test repo twicerc/fix-tests-factoriesRémy Coutable2017-07-271-4/+0
| | | | | | | Also, fixing some calls to the :project factory with the :test_repo trait since this trait is already included in the :project factory. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Improve support for external issue referencesadam-external-issue-references-spikeAdam Niedzielski2017-06-301-1/+1
|
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-2/+2
|
* Merge branch 'pull-mirror-overhaul-ce-backport' into 'master'Douwe Maan2017-06-051-0/+16
|\ | | | | | | | | 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-0/+16
| |
* | Lint our factories creation in addition to their build33139-lint-our-factoriesRémy Coutable2017-06-021-0/+2
|/ | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* 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.
* | 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>
* Update Carrierwave and fog-coreZeger-Jan van de Weg2017-05-011-0/+4
|
* Raise an exception if creating a test repository failsNick Thomas2017-03-081-2/+2
|
* Added Prometheus Service and Prometheus graphsKamil Trzciński2017-03-071-0/+11
|
* DRY up {jira,kubernets}_project factoriesfix-mentioned-issues-for-external-trackersSean McGivern2017-03-061-21/+2
|
* Delete hooks from project with empty repositorydm-fix-api-create-file-on-empty-repoDouwe Maan2017-03-021-0/+4
|
* Rename commit_file, commit_dir and remove_file and update specsDouwe Maan2017-02-241-9/+6
|
* Add traits for ProjectFeatures to Project factorySemyon Pupkov2017-02-051-0/+19
| | | | https://gitlab.com/gitlab-org/gitlab-ce/issues/24007
* Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2017-01-261-0/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix-git-hooks-when-creating-file * upstream/master: (1122 commits) Update CHANGELOG.md for 8.16.2 Display project ID in project settings (!8572) fixed points from comments to improve code quality Update CHANGELOG.md for 8.14.8 Statisfy eslint Add CHANGELOG entry Fix access to the wiki code via HTTP when repository feature disabled Display fullscreen button on small screens (!5302) Prevent removing fields from dropdowns on input elements fix for all themes Return struct instead of multiple values Fix race conditions for AuthorizedProjectsWorker Add User#nested_groups and User#nested_projects methods Fix spec failure due to timestamp ordering issue in mySQL Fixed error with filter keyboard tests `can?` already includes the `feature_available?` check Test there is no Merge Request button when MRs are disabled Ensure the correct Merge Request button is found Add 409 conflict tests Add CHANGELOG ...
| * Add a `:repository` trait to the `:empty_project` factoryRobert Speicher2017-01-171-0/+4
| | | | | | | | | | | | | | Right now this is a no-op. We're going to add it as a trait argument to all existing usages of the `:project` factory, so that later we can flip `:empty_project` to just be `:project`, forcing developers to opt-in to the slower option when their tests truly require it.
| * Move dashboard archived projects spinach tests to rspecSemyon Pupkov2017-01-041-0/+4
| | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
* | Merge branch 'master' into fix-git-hooks-when-creating-fileLin Jen-Shin2017-01-041-0/+21
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (1031 commits) Add changelog entry for renaming API param [ci skip] Add missing milestone parameter Refactor issues filter in API Fix project hooks params Gitlab::LDAP::Person uses LDAP attributes configuration Don't delete files from spec/fixtures Copy, don't move uploaded avatar files Minor improvements to changelog docs Rename logo, apply for Slack too Fix Gemfile.lock for the octokit update Fix cross-project references copy to include the project reference Add logo in public files Use stable icon for Mattermost integration rewrite the item.respond_to?(:x?) && item.x? to item.try(:x?) API: extern_uid is a string Increases pipeline graph drowdown width in order to prevent strange position on chrome on ubuntu Removed bottom padding from merge manually from CLI because of repositioning award emoji's Make haml_lint happy Improve spec Add feature tests for Cycle Analytics ...
| * Add terminal UI and controller actionsFatih Acet2016-12-191-3/+7
| |
| * Add terminals to the Kubernetes deployment serviceNick Thomas2016-12-191-1/+1
| |
| * Introduce deployment services, starting with a KubernetesServiceNick Thomas2016-12-141-0/+13
| |
* | Fix tests to use the new APILin Jen-Shin2016-12-081-1/+33
|/
* Make access request specs explicitly enable or disable access requests as ↵Nick Thomas2016-11-111-0/+4
| | | | required
* Merge branch 'fix-unathorized-cloning' into 'security'Douwe Maan2016-11-091-3/+7
| | | | | | | | | | Ensure external users are not able to clone disabled repositories. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/23788 See merge request !2017 Signed-off-by: Rémy Coutable <remy@rymai.me>
* Finish updates to use JIRA gemFelipe Artur2016-10-261-4/+3
| | | | Code improvements, bug fixes, finish documentation and specs
* Add visibility level to project repositoryissue_19734_2Felipe Artur2016-10-171-0/+2
|
* Update Boards::CreateService to handle with the has_many associationDouglas Barbosa Alexandre2016-10-111-8/+0
|
* Add markdown cache columns to the database, but don't use them yetNick Thomas2016-10-071-0/+7
| | | | | | | | | | | | This commit adds a number of _html columns and, with the exception of Note, starts updating them whenever the content of their partner fields changes. Note has a collision with the note_html attr_accessor; that will be fixed later A background worker for clearing these cache columns is also introduced - use `rake cache:clear` to set it off. You can clear the database or Redis caches separately by running `rake cache:clear:db` or `rake cache:clear:redis`, respectively.
* fix broken repo 500 errors in UI and added relevant specsJames Lopez2016-09-291-0/+15
|
* Improve project_with_board factory to create the default listsimprovement/project-with-board-factoryDouglas Barbosa Alexandre2016-09-261-0/+2
|
* Project tools visibility levelFelipe Artur2016-09-011-1/+20
|
* Add service to create a new board for a projectDouglas Barbosa Alexandre2016-08-171-0/+6
|
* Fix typo in factory for projects.rbYatish Mehta2016-07-051-1/+1
|
* Remove deprecated issues_tracker and issues_tracker_id from projectDouglas Barbosa Alexandre2016-06-131-6/+0
|
* Remove the annotate gem and delete old annotationsJeroen van Baarsen2016-05-091-39/+0
| | | | | | | | | In 8278b763d96ef10c6494409b18b7eb541463af29 the default behaviour of annotation has changes, which was causing a lot of noise in diffs. We decided in #17382 that it is better to get rid of the whole annotate gem, and instead let people look at schema.rb for the columns in a table. Fixes: #17382
* Merge branch 'rs-backport-ee-372' into 'master' Rémy Coutable2016-05-091-3/+7
|\ | | | | | | | | | | | | Backport changes from gitlab-org/gitlab-ee!372 Mostly replaces several Spinach tests with RSpec Feature tests. See merge request !4043