summaryrefslogtreecommitdiff
path: root/spec/services/projects
Commit message (Collapse)AuthorAgeFilesLines
* Ignore Gitaly errors if cache flushing fails on project destructionStan Hu2019-07-291-1/+16
| | | | | | | We should just ignore these errors and move along with the deletion since the repositories are going to be trashed anyway. Closes https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31164
* Write out sham_rack gemThong Kuah2019-07-291-7/+2
| | | | | | | This means we have one less Net::HTTP monkeypatch. sham_rack cannot handle IPv6 addresses which means it breaks Net::HTTP connections because it monkey-patches Net::HTTP
* Remove code related to object hierarchy in MySQLremove-nested-groups-checksHeinrich Lee Yu2019-07-251-1/+1
| | | | | These are not required because MySQL is not supported anymore
* Fix factory default for pages_access_levelVladimir Shushlin2019-07-171-2/+2
| | | | | Pages access level currently depends on project visibilty which is ignored by factory, this commit fixes that
* Disable Rails SQL query cache when applying service templatessh-service-template-bugStan Hu2019-06-251-1/+1
| | | | | | | | | | When the SQL query cache is active, the SELECT query for finding projects to apply service templates returns the same values. This causes an infinite loop because even though bulk INSERT queries are made, the cached results never reflect that progress. To fix this, we call `Project.uncached` around the query to ensure new data is retrieved. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63595
* Hashed Storage is enabled by default on new installationshashed-storage-enabled-defaultGabriel Mazetto2019-06-173-2/+4
| | | | updated documentation for Geo
* Fix inability to set visibility_level on project via APIsh-fix-issue-63158Stan Hu2019-06-141-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | Consider the scenario: 1. The default visibility level is set to internal 2. A user attempts to create a private project within a private group Previously this would always fail because default_value_for would overwrite the private visibility setting, no matter what visibility_level were specified. This was happening because default_value_for was confused by the default value of 0 specified by the database schema. default_value_for attempts to assign the default value in the block by checking whether the attribute has changed. The problem is that since the default value by the database was 0, and the user requested 0, this appeared as though no changes were made. As a result, default_value_for would always overwrite the user's preference. To fix this, we remove the use of default_value_for and only set the visibility level to the default application setting when no preference has been given at creation time. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63158
* Expose ci_default_git_depth via project APIexpose-project-git-depth-via-apiFabio Pitino2019-06-121-4/+4
| | | | | | | | | | Enable Get and Update of ci_default_git_depth for Project API. Renaming Project#default_git_depth to :ci_default_git_depth to give more context through the API usage. Add API documentation
* Forks get default_git_depth 0 if the origin is nilKrasimir Angelov2019-06-061-4/+20
| | | | | If the origin project has no default_git_depth set (i.e. nil) set the fork's default_git_depth to 0
* Add project level git depth settingKrasimir Angelov2019-06-061-0/+8
| | | | | | | | | | | | | | | | | | | | Introduce default_git_depth in project's CI/CD settings and set it to 50. Use it if there is no GIT_DEPTH variable specified. Apply this default only to newly created projects and keep it nil for old ones in order to not break pipelines that rely on non-shallow clones. default_git_depth can be updated from CI/CD Settings in the UI, must be either nil or integer between 0 and 1000 (incl). Inherit default_git_depth from the origin project when forking projects. MR pipelines are run on a MR ref (refs/merge-requests/:iid/merge) and it contains unique commit (i.e. merge commit) which doesn't exist in the other branch/tags refs. We need to add it cause otherwise it may break pipelines for old projects that have already enabled Pipelines for merge results and have git depth 0. Document new default_git_depth project CI/CD setting
* Delete unauthorized Todos when project is privateissue_49897Felipe Artur2019-06-051-0/+1
| | | | | Delete Todos for guest users when project visibility level is updated to private.
* Merge dev.gitlab.org master into GitLab.com masterYorick Peterse2019-06-031-8/+11
|\
| * Protect Gitlab::HTTP against DNS rebinding attackDouwe Maan2019-05-301-8/+11
| | | | | | | | | | | | Gitlab::HTTP now resolves the hostname only once, verifies the IP is not blocked, and then uses the same IP to perform the actual request, while passing the original hostname in the `Host` header and SSL SNI field.
* | Remove legacy artifact related coderemove-legacy-artifacts-related-codeShinya Maeda2019-05-311-56/+3
| | | | | | | | | | | | We've already migrated all the legacy artifacts to the new realm, which is ci_job_artifacts table. It's time to remove the old code base that is no longer used.
* | Add wiki size to project statisticsPeter Marko2019-05-291-11/+1
|/
* Add GitDeduplicationService for deduplication housekeepingjc-git-deduplication-serviceJohn Cai2019-05-211-0/+90
| | | | | GitDeduplicationService performs idempotent operations on deduplicated projects.
* Stop configuring group clusters on creation60379-remove-ci-preparing-state-feature-flagTiger2019-05-162-54/+0
| | | | | | | | | | | Immediate configuration is not ideal for group and instance level clusters as projects that may never be deployed would still have Kubernetes namespaces and service accounts created for them. As of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25586 we now create only the resources that are required for the project being deployed, at the time of deployment.
* Merge branch 'sh-fix-lfs-download-errors' into 'master'Douglas Barbosa Alexandre2019-05-101-1/+19
|\ | | | | | | | | | | | | Properly handle LFS Batch API response in project import Closes #61624 See merge request gitlab-org/gitlab-ce!28223
| * Properly handle LFS Batch API response in project importsh-fix-lfs-download-errorsStan Hu2019-05-091-1/+19
| | | | | | | | | | | | | | | | | | | | Project imports were failing with `undefined method each_with_object for String` because the import was attempting to parse the LFS Batch API and failing due to the fact that the Content-Type wasn't a supported format (e.g. application/vnd.git-lfs+json instead of application/json). We now parse the body as JSON. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/61624
* | Don't run full gc in AfterImportServicesh-revert-full-gc-after-importStan Hu2019-05-101-1/+1
|/ | | | | | | | | Pull mirrors would run the `Projects::AfterImportService`, which would force a `git gc` each time it finished. This is overkill and not necessary now that we have refs packed more frequently (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/27826). Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/11556
* Change DetectRepositoryLanguagesWorker to not receive userDiego Silva2019-05-092-3/+3
| | | | Fixes #60425
* Remove cleaned up OIDs from database and cacheNick Thomas2019-05-061-4/+85
|
* Use git_garbage_collect_worker to run pack_refsJan Provaznik2019-05-021-0/+3
| | | | | | | | PackRefs is not an expensive gitaly call - we want to call it more often (than as part of full `gc`) because it helps to keep number of refs files small - too many refs file may be a problem for deployments with slow storage.
* Refactored LfsImportService and ImportServiceFrancisco Javier López2019-04-306-140/+211
| | | | | | In order to make `LfsImportService` more reusable, we need to extract the logic inside `ImportService` and encapsulate it into the service.
* Add ProjectMetricsDashboardSetting model and tableReuben Pereira2019-04-261-0/+50
| | | | | | This new table will be used to store the external_dashboard_url which allows users to add a link to their external dashboards (ex Grafana) to the Metrics dashboard.
* Fix project auto dev ops failureHeinrich Lee Yu2019-04-231-0/+2
|
* Add frozen_string_literal to spec/servicesfrozen_string_literal_spec_servicesThong Kuah2019-04-1248-0/+96
| | | | Probably useful as we often move these files to "new" files.
* Move Contribution Analytics related spec in ↵Imre Farkas2019-04-092-0/+78
| | | | spec/features/groups/group_page_with_external_authorization_service_spec to EE
* Merge branch 'delay-update-statictics' into 'master'Douwe Maan2019-04-091-0/+40
|\ | | | | | | | | Fix the bug that the project statistics is not updated See merge request gitlab-org/gitlab-ce!26854
| * Refactor: extract duplicate steps to a service classHiroyuki Sato2019-04-051-0/+40
| |
* | Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"Andreas Brandl2019-04-052-78/+0
| | | | | | This reverts merge request !26823
* | Move Contribution Analytics related spec in ↵Imre Farkas2019-04-052-0/+78
| | | | | | | | spec/features/groups/group_page_with_external_authorization_service_spec to EE
* | Autocorrect with RSpec/ExampleWording copThong Kuah2019-04-052-7/+7
|/ | | | | | | - rewords examples starting with 'should' - rewords examples starting with 'it' Note: I had to manually fixup "onlies" to "only"
* Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ↵jarv/dev-to-gitlab-2019-04-02John Jarvis2019-04-022-0/+58
|\ | | | | | | jarv/dev-to-gitlab-2019-04-02
| * Merge branch 'security-id-potential-denial-languages' into 'master'GitLab Release Tools Bot2019-04-022-0/+58
| |\ | | | | | | | | | | | | Return cached languages if they've been detected before See merge request gitlab/gitlabhq!2998
| | * Return cached languages if they've been detected beforeIgor Drozdov2019-03-202-0/+58
| | |
* | | Force a full GC after importing a projectsh-force-gc-after-importStan Hu2019-04-012-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During a project import, it's possible that new branches are created by the importer to handle pull requests that have been created from forked projects, which would increment the `pushes_since_gc` value via `HousekeepingService.increment!` before a full garbage collection gets to run. This causes HousekeepingService to skip the full `git gc` and move to the incremental repack mode. To ensure that a garbage collection is run to pack refs and objects, explicitly execute the task. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59477
* | | Remove N+1 queries from users autocompleteSean McGivern2019-03-251-13/+40
|/ / | | | | | | | | | | | | | | | | | | | | Both of these were related to groups: 1. We need to preload routes (using the `with_route` scope) if we're going to get the group's path. 2. We were counting each group's members separately. They're in the same commit because the spec for N+1 detection wouldn't pass with only one of these fixes.
* | Add feature flag for build preparing stateTiger2019-03-202-0/+2
|/ | | | | The flag is on by default, but allows us to revert back to the old behaviour if we encounter any problems.
* Run rubocop -aNick Thomas2019-03-131-4/+2
|
* Merge branch '56618-hashed-storage-skip-validation' into 'master'Stan Hu2019-03-074-0/+24
|\ | | | | | | | | | | | | Resolve "Hashed storage migration should not be attempted if project does not validate" Closes #56618 See merge request gitlab-org/gitlab-ce!25753
| * Skip project validation when switching storage layoutsGabriel Mazetto2019-03-054-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a fix for the Hashed Storage migration and Rollback procedure to ignore any project-level validation error that can happen in a long-running instance. There are many situations where defaults and acceptable values changed but, because we didn't provide a migration to "valid" attributes, it can happen that project will not be `valid? => true`. Because the changes we are making are limited to setting a project as read_only or changing the storage_level, it's safe to bypass validation.
* | Merge dev master into GitLab.com masterYorick Peterse2019-03-041-0/+8
|\ \ | |/ |/|
| * Change policy regarding group visibilityMałgorzata Ksionek2019-02-201-0/+8
| |
* | Merge branch '53966-make-hashed-storage-migration-safer-and-more-inviting' ↵Douglas Barbosa Alexandre2019-03-015-3/+283
|\ \ | | | | | | | | | | | | | | | | | | into 'master' Hashed Storage rollback mechanism See merge request gitlab-org/gitlab-ce!23955
| * | Extract duplicated code into BaseAttachmentServiceGabriel Mazetto2019-03-012-4/+4
| | | | | | | | | | | | Exceptions were also simplified from 2 to 1.
| * | Extract and simplify more code into BaseRepositoryService`Gabriel Mazetto2019-03-012-2/+2
| | | | | | | | | | | | | | | `try_to_set_repository_read_only!` is now on the Base class. Simplified Exception classes from 2 to 1 with a more descriptive name.
| * | Edge case: upgrade/downgrade when repository doesn't existGabriel Mazetto2019-03-012-0/+20
| | | | | | | | | | | | | | | | | | This change takes the case where repository doesn't exist on disk and make it ignore but succeed the step, increasing or decreasing the version depending on the operation.
| * | Added Rollbacker workers and support on the rake taskGabriel Mazetto2019-03-013-1/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rollback is done similar to Migration for the Hashed Storage. It also shares the same ExclusiveLease key to prevent both happening at the same time. All Hashed Storage related workers now share the same queue namespace which allows for assigning dedicated workers easily.
| * | Adds Rollback functionality to HashedStorage migrationGabriel Mazetto2019-03-012-0/+158
| | | | | | | | | | | | | | | | | | | | | We are adding sidekiq workers and service classes to allow to rollback a hashed storage migration. There are some refactoring involved as well as part of the code can be reused by both the migration and the rollback logic.