summaryrefslogtreecommitdiff
path: root/spec/tasks
Commit message (Collapse)AuthorAgeFilesLines
* Display the amount for Hashed Storage migration/rollback correctly63667-hashed-storage-migration-count-correctlyGabriel Mazetto2019-07-101-8/+26
| | | | | Rake script considers the specified range, if present, to calculate the affected amount of projects correctly.
* Merge branch 'test_schema_version_check_directly' into 'master'Robert Speicher2019-07-011-7/+5
|\ | | | | | | | | | | | | Test schema_version_check directly Closes #63913 See merge request gitlab-org/gitlab-ce!30209
| * Test schema_version_check directlytest_schema_version_check_directlyThong Kuah2019-07-011-7/+5
| | | | | | | | | | | | Testing via db:migrate causes side-effects like setting ActiveRecord::Base.configurations and also it runs schema dump into db/schema.rb. Rather than keep up, we test schema_version_check directly
* | Merge branch 'tc-rake-orphan-artifacts' into 'master'Dmitriy Zaporozhets2019-07-011-0/+29
|\ \ | |/ |/| | | | | Add rake task to clean orphan artifact files See merge request gitlab-org/gitlab-ce!29681
| * Add rake task to clean orphan artifact filestc-rake-orphan-artifactsToon Claes2019-06-281-0/+29
| | | | | | | | | | | | | | | | | | | | | | This adds the rake task rake gitlab:cleanup:orphan_job_artifact_files. This rake task cleans all orphan job artifact files it can find on disk. It performs a search on the complete folder of all artifacts on disk. Then it filters out all the job artifact ID for which it could not find a record with matching ID in the database. For these, the file is deleted from disk.
* | Quarantine schema_version_check because tests after it failedLin Jen-Shin2019-07-011-1/+1
| |
* | Add the frozen literal to the correct fileDJ Mountney2019-06-252-2/+2
| |
* | Drop the source upgrade changeDJ Mountney2019-06-251-0/+2
| | | | | | | | We no longer need to point people away from using db:migrate
* | Add an flag for skipping the schema version checkDJ Mountney2019-06-252-7/+21
| | | | | | | | | | | | If you chose to use the rollback migration feature on your current version for example, you should still have a way to migrate, being that you are still on a supported migration path.
* | Move min schema version check to db:migrateDJ Mountney2019-06-252-1/+28
| | | | | | | | | | Rather than have it checked only as part of gitlab:db:configure, we will instead have it as a pre-req for every db:migrate command
* | Check supported version when migratingDJ Mountney2019-06-251-0/+7
|/ | | | | | Set the mininum supported migration version to be the schema version as of 11.11.0, and errors you if that is not detected during gitlab:db:configure
* Sanitize LDAP output in Rake tasksDrew Blessing2019-06-211-0/+9
| | | | | | | | | | The various LDAP check Rake tasks have long supported a SANITIZE environment variable. When present, identifiable information is obscured such as user names and project/group names. Until now, the LDAP check did not honor this. Now it will only say how many users were found. This should at least give the indication that the LDAP configuration found something, but will not leak what it is. Resolves #56131
* Merge branch 'gitaly-version-v1.43.0' into 'master'Bob Van Landuyt2019-05-312-19/+3
|\ | | | | | | | | Upgrade Gitaly to v1.43.0 See merge request gitlab-org/gitlab-ce!28867
| * Remove hook directory requirement from Shellgitaly-version-v1.43.0Zeger-Jan van de Weg2019-05-302-19/+3
| | | | | | | | | | | | | | | | | | | | | | | | It used to be the case that GitLab created symlinks for each repository to one copy of the Git hooks, so these ran when required. This changed to set the hooks dynamically on Gitaly when invoking Git. The side effect is that we didn't need all these symlinks anymore, which Gitaly doesn't create anymore either. Now that means that the tests in GitLab-Rails should test for it either. Related: https://gitlab.com/gitlab-org/gitaly/issues/1392#note_175619926
* | Remove legacy artifact related coderemove-legacy-artifacts-related-codeShinya Maeda2019-05-311-55/+0
|/ | | | | | 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.
* Replaced config accessDominic Renner2019-03-181-3/+1
| | | | Replaced Settings with Gitlab.config for uniformity
* Fix storage migration check for non-empty queuesGabriel Mazetto2019-03-171-4/+4
| | | | | The previous code works fine when running specs, but the API does not exist outside that environment.
* Prevent storage migration and rollback running at the same time58739-hashed-storage-prevent-a-migration-and-rollback-running-at-the-same-timeGabriel Mazetto2019-03-121-29/+79
| | | | | | This is a small polishing on the storage migration and storage rollback rake tasks. By aborting a migration while a rollback is already scheduled we want to prevent unexpected consequences.
* Prepare test suite for switch to Gitaly-embedded Git hooksJacob Vosmaer2019-02-271-1/+1
|
* Merge branch 'master' into ↵Rémy Coutable2019-02-0412-177/+519
|\ | | | | | | | | | | '46448-add-timestamps-for-each-stage-of-gitlab-rake-gitlab-backup-restore' # Conflicts: # spec/tasks/gitlab/backup_rake_spec.rb
| * Refactor Storage MigrationGabriel Mazetto2019-01-251-5/+5
| | | | | | | | | | | | | | | | | | Specs were reviewed and improved to better cover the current behavior. There was some standardization done as well to facilitate the implementation of the rollback functionality. StorageMigratorWorker was extracted to HashedStorage namespace were RollbackerWorker will live one as well.
| * Prepare rake task for storage rollbackGabriel Mazetto2019-01-251-2/+2
| | | | | | | | We are keeping compatibility with existing scheduled jobs.
| * Prevent admins from attempting hashed storage migration on read only DBMichael Kozono2018-12-191-2/+12
| |
| * Restore Object Pools when restoring an object poolZeger-Jan van de Weg2018-12-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pool repositories are persisted in the database, and when the DB is restored, the data need to be restored on disk. This is done by resetting the state machine and rescheduling the object pool creation. This is not an exact replica of the state like at the time of the creation of the backup. However, the data is consistent again. Dumping isn't required as internally GitLab uses git bundles which bundle all refs and include all objects in the bundle that they require, reduplicating as more repositories get backed up. This does require more data to be stored. Fixes https://gitlab.com/gitlab-org/gitaly/issues/1355
| * Fix gitlab:web_hook tasksNick Thomas2018-12-061-0/+92
| |
| * Extract system check rake task logicMichael Kozono2018-12-031-29/+79
| | | | | | | | | | These changes make the code more reusable, testable, and most importantly, overrideable.
| * Remove Site Statistic53778-remove-site-statisticsGabriel Mazetto2018-11-261-23/+0
| | | | | | | | | | This approach caused many different problems as we tightened the query execution timeout.
| * Update testsHeinrich Lee Yu2018-11-261-1/+4
| |
| * Enhance performance of counting local UploadsToon Claes2018-11-071-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an index to the `store` column on `uploads`. This makes counting local uploads faster. Also, there is no longer need to check for objects with `store = NULL`. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18557 --- ### Query plans Query: ```sql SELECT COUNT(*) FROM "uploads" WHERE ("uploads"."store" = ? OR "uploads"."store" IS NULL) ``` #### Without index ``` gitlabhq_production=# EXPLAIN ANALYZE SELECT uploads.* FROM uploads WHERE (uploads.store = 1 OR uploads.store IS NULL); QUERY PLAN --------------------------------------------------------------------------------------------------------------- Seq Scan on uploads (cost=0.00..601729.54 rows=578 width=272) (actual time=6.170..2308.256 rows=545 loops=1) Filter: ((store = 1) OR (store IS NULL)) Rows Removed by Filter: 4411957 Planning time: 38.652 ms Execution time: 2308.454 ms (5 rows) ``` #### Add index ``` gitlabhq_production=# create index uploads_tmp1 on uploads (store); CREATE INDEX ``` #### With index ``` gitlabhq_production=# EXPLAIN ANALYZE SELECT uploads.* FROM uploads WHERE (uploads.store = 1 OR uploads.store IS NULL); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------- Bitmap Heap Scan on uploads (cost=11.46..1238.88 rows=574 width=272) (actual time=0.155..0.577 rows=545 loops=1) Recheck Cond: ((store = 1) OR (store IS NULL)) Heap Blocks: exact=217 -> BitmapOr (cost=11.46..11.46 rows=574 width=0) (actual time=0.116..0.116 rows=0 loops=1) -> Bitmap Index Scan on uploads_tmp1 (cost=0.00..8.74 rows=574 width=0) (actual time=0.095..0.095 rows=545 loops=1) Index Cond: (store = 1) -> Bitmap Index Scan on uploads_tmp1 (cost=0.00..2.44 rows=1 width=0) (actual time=0.020..0.020 rows=0 loops=1) Index Cond: (store IS NULL) Planning time: 0.274 ms Execution time: 0.637 ms (10 rows) ``` Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/6070
| * Fix typos in comments and specsGeorge Tsiolis2018-11-011-1/+1
| |
| * Geo: sync disabled wikis. Stage 2follow-up-geo-sync-disabled-wikisValery Sizov2018-09-251-3/+2
| | | | | | | | | | | | | | We started syncing all the wiki regardless of the fact it's disabled or not. We couldn't do that in one stage because of needing of smoth update and deprecating things. This is the second stage that finally removes unused columns in the geo_node_status table.
| * Include post migrations when loading the schemaYorick Peterse2018-09-191-0/+33
| |\ | | | | | | See merge request gitlab-org/gitlab-ce!21689
| | * Fix the schema load testDJ Mountney2018-09-121-11/+15
| | | | | | | | | | | | And added changelog
| | * Ensure the schema is loaded with post_migrations includedDJ Mountney2018-09-111-0/+29
| | | | | | | | | | | | | | | | | | If doing a schema load, the post_migrations should also be marked as up, even if SKIP_POST_DEPLOYMENT_MIGRATIONS was set, otherwise future migration runs will be broken.
| * | Port cleanup tasks to use GitalyZeger-Jan van de Weg2018-09-071-15/+20
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rake tasks cleaning up the Git storage were still using direct disk access, which won't work if these aren't attached. To mitigate a migration issue was created. To port gitlab:cleanup:dirs, and gitlab:cleanup:repos, a new RPC was required, ListDirectories. This was implemented in Gitaly, through https://gitlab.com/gitlab-org/gitaly/merge_requests/868. To be able to use the new RPC the Gitaly server was bumped to v0.120. This is an RPC that will not use feature gates, as this doesn't scale on .com so there is no way to test it at scale. Futhermore, we _know_ it doesn't scale, but this might be a useful task for smaller instances. Lastly, the tests are slightly updated to also work when the disk isn't attached. Eventhough this is not planned, it was very little effort and thus I applied the boy scout rule. Closes https://gitlab.com/gitlab-org/gitaly/issues/954 Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/40529
| * Refactor SiteStatistics to extract refresh logic into a rake taskGabriel Mazetto2018-08-161-0/+24
| |
| * Add rake command to migrate archived traces from local storage to object storageShinya Maeda2018-08-161-27/+85
| |
| * Merge branch 'gitaly-install-path' into 'master'Douwe Maan2018-08-141-51/+16
| |\ | | | | | | | | | | | | Remove storage path dependency of gitaly install task See merge request gitlab-org/gitlab-ce!21101
| | * Remove storage path dependency of gitaly install taskAlejandro Rodríguez2018-08-121-51/+16
| | |
| * | Add object storage related tests for `gitlab:cleanup:project_uploads` taskMichael Kozono2018-08-031-276/+45
| | |
| * | Merge branch 'zj-backup-migration-done' into 'master'Sean McGivern2018-08-021-0/+21
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Remove feature flags from lib/backup Closes gitaly#749, gitaly#1212, and gitaly#1195 See merge request gitlab-org/gitlab-ce!20854
| | * | Remove feature flags from lib/backupZeger-Jan van de Weg2018-07-311-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moved to OPT_OUT in 7d14b725a0da41d1ae7c0a8496b5e66832023e3b, Now, by removing the feature gates, this is an mandatory feature. Related issues: - https://gitlab.com/gitlab-org/gitaly/issues/526 - https://gitlab.com/gitlab-org/gitaly/issues/1194 Closes https://gitlab.com/gitlab-org/gitaly/issues/749 Closes https://gitlab.com/gitlab-org/gitaly/issues/1212 Closes https://gitlab.com/gitlab-org/gitaly/issues/1195
| * | | Add local project uploads cleanup taskMichael Kozono2018-07-311-1/+316
| | |/ | |/|
| * | Remove git rake tasksZeger-Jan van de Weg2018-07-311-28/+2
| |/ | | | | | | | | | | | | | | | | | | These tasks are happening through housekeeping right now, by default ever 10th push. This removes the need for these tasks. Side note, this removes one of my first contributions to GitLab, as back than I introduced these tasks through: 54e6c0045bb13c05cc5478cbdf47d3246bd9fe2b Closes https://gitlab.com/gitlab-org/gitaly/issues/768
| * Speed up spec/tasks/gitlab/git_rake_spec.rbRobert Speicher2018-07-031-6/+11
| | | | | | | | | | | | Because no Git repository was actually created at the temporary path we were using, `git fsck` would traverse up until it found a repository, which in our case was the CE or EE repository.
| * Fix static analysis failureDJ Mountney2018-06-271-1/+1
| |
| * Update tests for gitlab:db:configureDJ Mountney2018-06-271-1/+9
| |
| * Find and mark more Git disk access locations, part 2Jacob Vosmaer2018-06-122-2/+10
| |
| * Resolve "Hashed Storage: Make possible to migrate single project"Gabriel Mazetto2018-06-071-9/+36
| |
| * Find and mark more Git disk access locationsJacob Vosmaer (GitLab)2018-06-051-6/+13
| |