Commit Graph

539 Commits

Author SHA1 Message Date
GitLab Bot 1219a9dce9 Add latest changes from gitlab-org/gitlab@master 2020-04-01 15:07:45 +00:00
GitLab Bot 8f9beefac3 Add latest changes from gitlab-org/gitlab@master 2020-03-23 12:09:47 +00:00
GitLab Bot 1635eacd2a Add latest changes from gitlab-org/gitlab@master 2020-03-23 06:09:28 +00:00
GitLab Bot f2dfd9ee81 Add latest changes from gitlab-org/gitlab@master 2020-03-22 15:09:49 +00:00
GitLab Bot dc889678d1 Add latest changes from gitlab-org/gitlab@master 2020-03-12 15:09:39 +00:00
GitLab Bot a8de96bff5 Add latest changes from gitlab-org/gitlab@master 2020-03-05 18:08:19 +00:00
GitLab Bot 77237c5a6b Add latest changes from gitlab-org/gitlab@master 2020-03-05 00:07:49 +00:00
GitLab Bot 951616a26a Add latest changes from gitlab-org/gitlab@master 2020-02-25 18:09:02 +00:00
GitLab Bot a8c82a6395 Add latest changes from gitlab-org/gitlab@master 2020-02-25 03:08:49 +00:00
GitLab Bot a6c2be7cd2 Add latest changes from gitlab-org/gitlab@master 2020-02-21 21:08:57 +00:00
GitLab Bot 55733b19c5 Add latest changes from gitlab-org/gitlab@master 2020-02-11 06:09:46 +00:00
GitLab Bot a89cb5cbdd Add latest changes from gitlab-org/gitlab@master 2020-02-06 21:08:48 +00:00
GitLab Bot 0d6fa03312 Add latest changes from gitlab-org/gitlab@master 2020-02-06 18:08:54 +00:00
GitLab Bot 76623c12c1 Add latest changes from gitlab-org/gitlab@master 2020-02-05 21:09:02 +00:00
GitLab Bot 50ae406553 Add latest changes from gitlab-org/gitlab@master 2020-01-30 12:08:54 +00:00
GitLab Bot fedf978f9a Add latest changes from gitlab-org/gitlab@master 2020-01-28 15:08:36 +00:00
GitLab Bot bbf6581214 Add latest changes from gitlab-org/gitlab@master 2020-01-28 06:09:01 +00:00
GitLab Bot 7873bb3c1a Add latest changes from gitlab-org/gitlab@master 2020-01-11 00:08:28 +00:00
GitLab Bot b5571e6e22 Add latest changes from gitlab-org/gitlab@master 2019-12-19 18:07:48 +00:00
GitLab Bot 69d6d3ca20 Add latest changes from gitlab-org/gitlab@master 2019-12-16 21:08:00 +00:00
GitLab Bot a19a376bf3 Add latest changes from gitlab-org/gitlab@master 2019-12-02 21:06:51 +00:00
GitLab Bot eac0da9a47 Add latest changes from gitlab-org/gitlab@master 2019-11-29 15:06:43 +00:00
GitLab Bot ef326e805a Add latest changes from gitlab-org/gitlab@master 2019-10-28 21:06:24 +00:00
GitLab Bot ad1e4b8fb8 Add latest changes from gitlab-org/gitlab@master 2019-10-21 15:05:58 +00:00
GitLab Bot 5c521d1f9b Add latest changes from gitlab-org/gitlab@master 2019-10-18 15:06:05 +00:00
GitLab Bot 25989ab7ef Add latest changes from gitlab-org/gitlab@master 2019-10-18 11:11:44 +00:00
GitLab Bot 7b8ec6e718 Add latest changes from gitlab-org/gitlab@master 2019-10-15 18:06:01 +00:00
GitLab Bot 3d13802bc2 Add latest changes from gitlab-org/gitlab@master 2019-10-15 09:06:09 +00:00
GitLab Bot 185f428fa5 Add latest changes from gitlab-org/gitlab@master 2019-10-07 12:06:18 +00:00
GitLab Bot d46287cc16 Add latest changes from gitlab-org/gitlab@master 2019-09-20 12:05:52 +00:00
Ash McKenzie 124bad7bd8
Use stub_rails_env for Rails.env stubbing
RailsHelpers.stub_rails_env takes care of
stubbing Rails.env
2019-09-05 12:54:03 +10:00
Hordur Freyr Yngvason d3c5ff7b72 Squash project templates on update
As per https://gitlab.com/gitlab-org/gitlab-ce/issues/46043, project
templates should be squashed before updating, so that repositories
created from these templates don't include the full history of the
backing repository.
2019-08-15 20:20:08 +00:00
Sean McGivern 930026f49b Remove mail_google_schema_whitelisting spec
This task was removed in 2014! The spec wasn't, probably because it
didn't fail as it was never executed. See
0fc5c80207.
2019-08-01 11:07:28 +01:00
Sean McGivern c4a8f45f7d Rename broken spec files
RSpec only executes files ending in _spec.rb.
2019-08-01 11:07:27 +01:00
Hordur Freyr Yngvason 012fe3141e Fix broken update_project_templates rake task
This rake task had been broken for a while. This fixes the breakages,
adds a test to help avoid future breakages, and adds a few ergonomic
improvements to the task itself.
2019-07-30 13:52:28 +00:00
Imre Farkas 313f145b55
Rake task to cleanup expired ActiveSession lookup keys
In some cases ActiveSession.cleanup was not called after authentication,
so for some user ActiveSession lookup keys grew without ever cleaning
up. This Rake task manually iterates over the lookup keys and removes
ones without existing ActiveSession.
2019-07-22 17:15:57 +02:00
Gabriel Mazetto d8cad8837c Display the amount for Hashed Storage migration/rollback correctly
Rake script considers the specified range, if present, to calculate
the affected amount of projects correctly.
2019-07-10 22:14:50 +01:00
Toon Claes dabd91b2c8 Add rake task to clean orphan artifact files
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.
2019-06-28 10:02:18 +02:00
Drew Blessing 05d5504d07 Sanitize LDAP output in Rake tasks
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
2019-06-21 05:49:56 -05:00
Bob Van Landuyt 9a8955d3c0 Merge branch 'gitaly-version-v1.43.0' into 'master'
Upgrade Gitaly to v1.43.0

See merge request gitlab-org/gitlab-ce!28867
2019-05-31 14:16:54 +00:00
Shinya Maeda 387a4f4b2c Remove legacy artifact related code
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.
2019-05-31 10:49:17 +07:00
Zeger-Jan van de Weg 951afba624
Remove hook directory requirement from Shell
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
2019-05-30 20:04:08 +02:00
Dominic Renner ad29681cab Replaced config access
Replaced Settings with Gitlab.config for uniformity
2019-03-18 17:26:18 +00:00
Gabriel Mazetto 523712d116 Fix storage migration check for non-empty queues
The previous code works fine when running specs, but the API
does not exist outside that environment.
2019-03-17 00:27:38 +01:00
Gabriel Mazetto 337977776a Prevent storage migration and rollback running at the same time
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.
2019-03-12 17:51:05 +01:00
Jacob Vosmaer 078f11a6b9 Prepare test suite for switch to Gitaly-embedded Git hooks 2019-02-27 10:58:21 +00:00
Rémy Coutable 5c583c8e87 Merge branch 'master' into '46448-add-timestamps-for-each-stage-of-gitlab-rake-gitlab-backup-restore'
# Conflicts:
#   spec/tasks/gitlab/backup_rake_spec.rb
2019-02-04 14:11:04 +00:00
Gabriel Mazetto 7bc16889df Refactor Storage Migration
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.
2019-01-25 20:26:35 +01:00
Gabriel Mazetto c2c34eba62 Prepare rake task for storage rollback
We are keeping compatibility with existing scheduled jobs.
2019-01-25 20:26:35 +01:00
Michael Kozono 9f80f04059 Prevent admins from attempting hashed storage migration on read only DB 2018-12-19 21:10:00 +00:00
Zeger-Jan van de Weg 89a407dc3b
Restore Object Pools when restoring an object pool
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
2018-12-13 09:00:03 +01:00
Nick Thomas 7329480412
Fix gitlab:web_hook tasks 2018-12-06 18:37:05 +00:00
Michael Kozono 6855e6b586 Extract system check rake task logic
These changes make the code more reusable, testable, and most
importantly, overrideable.
2018-12-03 13:51:46 -08:00
Gabriel Mazetto fe2e6c6dc0 Remove Site Statistic
This approach caused many different problems as we tightened
the query execution timeout.
2018-11-26 23:39:05 +01:00
Toon Claes 1c481b7aac Enhance performance of counting local Uploads
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
2018-11-07 11:29:31 +01:00
George Tsiolis 733ae94921 Fix typos in comments and specs 2018-11-01 08:59:20 +02:00
Valery Sizov 15d011d64d Geo: sync disabled wikis. Stage 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.
2018-09-25 17:49:39 +03:00
Yorick Peterse ec33016bcd Include post migrations when loading the schema
See merge request gitlab-org/gitlab-ce!21689
2018-09-19 12:29:25 +00:00
DJ Mountney 60747672bb Fix the schema load test
And added changelog
2018-09-12 15:55:26 -07:00
DJ Mountney 76cfe4f1fd Ensure the schema is loaded with post_migrations included
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.
2018-09-11 18:41:14 -07:00
Zeger-Jan van de Weg 3aedccb17a
Port cleanup tasks to use Gitaly
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
2018-09-07 13:58:31 +02:00
Gabriel Mazetto 1a54986c16 Refactor SiteStatistics to extract refresh logic into a rake task 2018-08-16 21:31:19 +02:00
Shinya Maeda 63091cfe64 Add rake command to migrate archived traces from local storage to object storage 2018-08-16 14:28:47 +00:00
Douwe Maan d9614e701a Merge branch 'gitaly-install-path' into 'master'
Remove storage path dependency of gitaly install task

See merge request gitlab-org/gitlab-ce!21101
2018-08-14 08:59:10 +00:00
Alejandro Rodríguez eb1a3798ad Remove storage path dependency of gitaly install task 2018-08-12 18:52:44 -03:00
Michael Kozono a4351ac077 Add object storage related tests for `gitlab:cleanup:project_uploads` task 2018-08-03 04:36:43 +00:00
Sean McGivern 056025f78e Merge branch 'zj-backup-migration-done' into 'master'
Remove feature flags from lib/backup

Closes gitaly#749, gitaly#1212, and gitaly#1195

See merge request gitlab-org/gitlab-ce!20854
2018-08-02 12:35:35 +00:00
Michael Kozono 3cbd8b1343 Add local project uploads cleanup task 2018-07-31 11:09:42 -07:00
Zeger-Jan van de Weg d7afed34c4
Remove feature flags from lib/backup
Moved to OPT_OUT in 7d14b725a0, 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
2018-07-31 15:24:19 +02:00
Zeger-Jan van de Weg f1f7bfc06f
Remove git rake tasks
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: 54e6c0045b

Closes https://gitlab.com/gitlab-org/gitaly/issues/768
2018-07-31 14:31:50 +02:00
Robert Speicher f5da4815a5
Speed up spec/tasks/gitlab/git_rake_spec.rb
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.
2018-07-03 17:20:51 -05:00
DJ Mountney 2efe4a13b6 Fix static analysis failure 2018-06-27 14:09:06 -07:00
DJ Mountney 1ef3b3efbd Update tests for gitlab:db:configure 2018-06-27 13:42:22 -07:00
Will Chandler cc41a77183 Add timestamps to gitlab-rake gitlab:backup:restore
Adds a new method 'puts_time' that prepends the time of a
message when printing it.  All instances of 'progress.puts'
in the gitlab:backup:restore tasks are replaced with puts_time.
Example output:
  2018-06-03 16:33:25 -0400 -- Restoring uploads ..
Closes #46448
2018-06-14 23:03:15 -04:00
Jacob Vosmaer f376347f24 Find and mark more Git disk access locations, part 2 2018-06-12 14:33:37 +02:00
Gabriel Mazetto 36c3376475 Resolve "Hashed Storage: Make possible to migrate single project" 2018-06-07 15:40:44 +00:00
Jacob Vosmaer (GitLab) a0808df0b6 Find and mark more Git disk access locations 2018-06-05 15:51:14 +00:00
Gabriel Mazetto 8c5ce1b07c Specs covering listing all gitlab:storage:* types 2018-05-29 02:53:21 +02:00
Stan Hu e6fca03bbd Fix backup creation and restore for specific Rake tasks 2018-05-24 14:58:25 +00:00
Zeger-Jan van de Weg ec4423665c
Gitlab::Shell works on shard name, not path
Direct disk access is done through Gitaly now, so the legacy path was
deprecated. This path was used in Gitlab::Shell however. This required
the refactoring in this commit.

Added is the removal of direct path access on the project model, as that
lookup wasn't needed anymore is most cases.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1111
2018-04-25 13:36:22 +02:00
Micaël Bergeron 4f24a65e45 fix the rake task from being to strict about Group 2018-04-02 08:19:34 -04:00
Micaël Bergeron 316eb6ef60 apply feedback 2018-03-30 08:39:12 -04:00
Micaël Bergeron da4fc5b899 fix a future conflict 2018-03-29 12:26:55 -04:00
Micaël Bergeron ef10679418 fix rake migration task from ignoring Upload(store: nil) 2018-03-29 11:05:05 -04:00
Sean McGivern 835fe4d324 Merge branch '40781-os-to-ce' into 'master'
Bring Object Storage to CE

Closes #4171, #4163, #3370, #2841, and #29203

See merge request gitlab-org/gitlab-ce!17358
2018-03-27 08:20:03 +00:00
Micaël Bergeron b08a1cd2c4 fix the failing specs 2018-03-22 14:37:47 -04:00
Micaël Bergeron 764b5fdd16 Backport EE changes 2018-03-22 13:35:42 -04:00
Micaël Bergeron 9c6663ea07 Merge remote-tracking branch 'origin/master' into 40781-os-to-ce 2018-03-22 09:06:10 -04:00
Jacob Vosmaer 008a6a6ce6 Route path lookups through legacy_disk_path 2018-03-21 18:18:32 +01:00
Micaël Bergeron 6466739e2e Merge remote-tracking branch 'origin/master' into 40781-os-to-ce 2018-03-08 10:55:47 -05:00
Sean McGivern edbcde8877 [cherry-pick] '4862-verify-file-checksums'
See merge request gitlab-org/gitlab-ee!4753
2018-03-08 10:20:40 -05:00
Nick Thomas 4419d7ea1f
Implement foreground verification of CI artifacts 2018-03-07 17:28:15 +00:00
Shinya Maeda 0ac1322045 Fix tests by latest proposal changes 2018-03-06 21:44:15 +09:00
Shinya Maeda 824af79d64 Fix rake task to use corrrect SQL 2018-03-06 21:43:19 +09:00
Nick Thomas 6f945f20b4
Foreground verification of uploads and LFS objects 2018-03-02 14:16:17 +00:00
Micaël Bergeron a8df653fae another round of fixes 2018-03-01 10:36:24 -05:00
Kamil Trzciński a2f375e8f7 Merge remote-tracking branch 'origin/master' into object-storage-ee-to-ce-backport 2018-02-28 21:28:43 +01:00
Kamil Trzciński 729391fbfc Merge commit '8af23def1d6' into object-storage-ee-to-ce-backport 2018-02-28 21:11:53 +01:00
Sean McGivern a7dae52e9d Merge branch '4163-move-uploads-to-object-storage' into 'master'
Move uploads to object storage

Closes #4163

See merge request gitlab-org/gitlab-ee!3867
2018-02-28 20:58:15 +01:00
Kamil Trzciński 45d2c31643 Merge commit '4b92efd90cedaa0aff218d11fdce279701128bea' into object-storage-ee-to-ce-backport 2018-02-28 20:46:53 +01:00
Grzegorz Bizon 6ca02a4150 Merge branch 'zj-multiple-artifacts-ee' into 'master'
Multiple artifacts ee

See merge request gitlab-org/gitlab-ee!3276
2018-02-28 20:44:09 +01:00
Kamil Trzciński 965dc28691 Merge commit '7fabc892f251740dbd9a4755baede662e6854870' into object-storage-ee-to-ce-backport 2018-02-28 20:36:55 +01:00
Kamil Trzciński e3fafa7632 Merge commit 'f2f58a60b76acd479e37bdbc9246ec9f9b2bea82' into object-storage-ee-to-ce-backport 2018-02-28 20:36:07 +01:00
Kamil Trzciński e0401df121 Merge commit '11c67e7c2f992299ff5918ce67995b73d1e0be6d' into object-storage-ee-to-ce-backport 2018-02-28 20:35:22 +01:00
Douwe Maan bc76062774 Merge branch 'jej/lfs-object-storage' into 'master'
Can migrate LFS objects to S3 style object storage

Closes #2841

See merge request !2760
2018-02-28 20:29:37 +01:00
Horatiu Eugen Vlad 1ad5df49b1 Moved o_auth/saml/ldap modules under gitlab/auth 2018-02-28 16:53:02 +01:00
Ken c5e385bd5a 36847 - update toml-rb to 1.0.0
36847 - add changelog
2018-02-21 22:09:15 +10:30
Takuya Noguchi 2b6307f6ad Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
Robert Speicher 1f309b69df Merge branch '41972-make-sure-no-warnings' into 'master'
Fail static-analysis if there's output to stderr

Closes #41972

See merge request gitlab-org/gitlab-ce!16648
2018-01-29 21:09:09 +00:00
Lin Jen-Shin ac3d56e0ff Pass BUNDLE_PATH to install to the same path for test 2018-01-26 21:24:57 +08:00
Lin Jen-Shin 8e87ecbf30 Eliminate the warnings from task helpers 2018-01-26 19:42:48 +08:00
Douglas Barbosa Alexandre 9afb77b6d4 Refactoring spec for the gitlab:uploads:check rake task 2018-01-08 19:43:53 -02:00
Douglas Barbosa Alexandre a75bbbd92a Make Rubocop happy 2018-01-08 19:40:23 -02:00
Douglas Barbosa Alexandre 4b1546159c Add spec for gitlab:uploads rake tasks 2018-01-08 19:25:32 -02:00
James Lopez de36a8e279 refactor spec, add docs 2018-01-04 11:22:43 +01:00
James Lopez 5b9e777376 add lock specs 2018-01-04 11:22:43 +01:00
James Lopez f8e1b44dc5 add locks chek 2018-01-04 11:22:43 +01:00
James Lopez 7721e8dfca fix spec 2018-01-04 11:22:43 +01:00
James Lopez 260935868a add new git fsck rake task and spec 2018-01-04 11:22:43 +01:00
Zeger-Jan van de Weg 03ac8d5d0b Remove Rugged::Repository#empty? 2017-12-07 15:33:30 +00:00
digitalMoksha 02dd3b4ed1 static analysis fix 2017-11-24 21:10:00 +01:00
digitalMoksha 17069a9547 ignore hashed repositories when doing rake gitlab:cleanup:dirs 2017-11-24 19:29:25 +01:00
Jacob Vosmaer (GitLab) 571f1dda17 Add FetchSourceBranch Gitaly call 2017-11-22 10:19:42 +00:00
Brett Walker 5e861a0525 ignore hashed repos (for now) when using `rake gitlab:cleanup:repos` 2017-11-21 20:26:53 +00:00
Alejandro Rodríguez c33ca9d807 Use `make install` for Gitaly setups in non-test environments 2017-11-21 17:45:36 +00:00
Jacob Vosmaer (GitLab) 6f1e9f7ef7 Fix slow gitaly dev test bundle 2017-11-21 12:28:02 +00:00
Douwe Maan cd3b4ba4ab Remove gitlab:users:clear_all_authentication_tokens rake task 2017-11-02 11:39:02 +01:00
Rémy Coutable 4774b6cfd2 Stub ENV in the LDAP task spec file
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-18 18:42:09 +02:00
Rémy Coutable 91553ae833 Stub ENV in the Gitaly task spec file
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-18 18:42:09 +02:00
Rémy Coutable 8b8bab118e Stub ENV in the backup task spec file
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-18 18:42:09 +02:00
Zeger-Jan van de Weg 4656283c5c
Gitaly namespace service enabled for GitLab 2017-10-05 14:11:32 +02:00
Gabriel Mazetto f4de14d71f
Add support to migrate existing projects to Hashed Storage async 2017-09-28 16:32:14 +01:00
Gabriel Mazetto c505a52347 Fixed few gitlab:check tasks that were failing with exception 2017-09-25 00:34:12 +02:00
Robert Speicher 4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Rémy Coutable 004d335f26 Merge branch 'gitaly-test-bundle-path' into 'master'
Use existing BUNDLE_PATH for gitaly in local tests

See merge request !13493
2017-08-14 16:25:23 +00:00
Jacob Vosmaer fab0c1eb80 Use existing BUNDLE_PATH for gitaly in local tests 2017-08-11 15:49:50 +02:00
Robert Speicher c8b802471b Enable the RSpec/HookArgument cop and auto-correct offenses 2017-08-10 19:29:42 -04:00
Robert Speicher 420d835e5f Merge branch '36003-do-not-include-to-kernel' into 'master'
Don't include anything to Kernel only because of tasks

Closes #36003

See merge request !13380
2017-08-09 16:35:33 +00:00
Lin Jen-Shin 77f10d55de Properly set the expectation on the main object 2017-08-09 01:43:33 +08:00
Lin Jen-Shin 5d963fccab We shouldn't include utility methods everywhere 2017-08-08 23:14:29 +08:00
Jacob Vosmaer 5684528081 Unset BUNDLE_GEMFILE when installing Gitaly 2017-08-08 15:34:29 +02:00
Rémy Coutable feb8974cc8 Merge branch '35941-fix-testing-issue-following-gitaly-install-fix' into 'master'
Unset the `RUBYOPT` env variable before installing `gitaly-ruby`

Closes #35941 and #35967

See merge request !13313
2017-08-08 09:39:49 +00:00
Rémy Coutable 21937a157d
Print the setup steps and duration and fix an issue resulting in re-setuping GitLab Shell on each test run
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-04 17:27:50 +02:00
Rémy Coutable 201ce2cb55
Unset the RUBYOPT env variable before installing gitaly-ruby
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-04 16:10:52 +02:00
Rémy Coutable 805a28e6a1 Revert "Merge branch 'fix-gitaly-install' into 'master'"
This reverts commit 23c502b434, reversing
changes made to 1018ab0516.
2017-08-04 15:59:30 +02:00
Kim "BKC" Carlbäcker 4c68f22b0b fix tests 2017-08-04 13:54:41 +02:00
Rémy Coutable 532ad2e56e Don't call load_tasks as this would load the tasks twice
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-02 19:02:01 +02:00
Sean McGivern 90cb2aab38 Merge branch '28283-legacy-storage-format' into 'master'
[CE] Added Legacy Storage format

See merge request !13149
2017-08-01 12:24:24 +00:00
Jacob Vosmaer e99564568b CI fixes for gitaly-ruby 2017-08-01 10:48:46 +02:00
Gabriel Mazetto c6dee99803 Rename path_with_namespace -> disk_path when dealing with the filesystem 2017-08-01 07:26:58 +02:00
Alejandro Rodríguez c9c0606297 Improve version handling on component install tasks
Fixes an issue where, when using branch versions, the component wouldn't
be updated after the first branch checkout. We also save one step, since
checking out the FETCH_HEAD with `-f` already does what `reset --hard`
did.
2017-07-20 17:30:29 -04:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Jacob Vosmaer 218da88e1a Enable gitaly token auth when testing 2017-06-20 17:42:54 +02:00
Alejandro Rodríguez 58821ebbb4 Stop using deprecated `path` field on Gitaly messages
This revealed an error in our configuration generation in
gitlab:gitaly:install rake task. The fix is included
2017-06-14 19:33:43 -04:00
Rémy Coutable bdf5b6adc3
Enable the RSpec/ExpectOutput cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-18 18:56:26 +02:00
Jacob Vosmaer 43f037c903 Don't reuse gRPC channels
It seems that bad things happen when two gRPC stubs share one gRPC
channel so let's stop doing that. The downside of this is that we
create more gRPC connections; one per stub.
2017-05-15 10:52:33 +02:00
Stan Hu d36a409768 Relax rake backup regex to handle CE and EE RCs
See http://rubular.com/r/uTDlT85zW1
2017-05-12 13:00:03 -07:00
Stan Hu 5bed3390aa Fix failing backup filename spec for RCs
See http://rubular.com/r/9oI7K8b773 for more details.
2017-05-11 22:31:20 -07:00
Rémy Coutable d40e1f547e Enable the Style/TrailingCommaInLiteral cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Jacob Vosmaer 3960d974c3 Compile gitlab-shell go executables 2017-05-04 11:21:51 +02:00
Kim "BKC" Carlbäcker 6f89bd3628 Use Gitaly for getting Branch/Tag counts
- Backup-rake-spec fixed. Storage config broken
- Use rugged to compare branch/tag-count in specs
- upgrade gitaly
2017-04-28 13:07:53 +02:00
Achilleas Pipinellis 3bce129570 Fix failing spec
http://rubular.com/r/op7TI9UX6K
2017-04-26 18:30:02 +02:00
Alejandro Rodríguez e61325ff43 Expand components version specification format to allow branches
Currently we specify versions for Gitlab-Shell, Workhorse and Gitaly
using version strings, to which we prepend 'v' and assume are tags.
These changes allow branches or tags with other name formats to be
specified by prepending '=' to the version string (á la govendor).

We also simplify the process to reset to the given version (now a
branch or tag): Right now there's a check to supposedly try to avoid
fetching from the remote the version if it already exist locally. But
the previous logic already clones if the directory doesn't exist or
fetches if it does, so this check is pointless. We can safely assume the
version exists once we get to the reset stage.
2017-04-13 17:32:00 -03:00
Ahmad Sherif 62521f20e4 Add rake task that prints TOML storage configuration
Closes gitaly#173
2017-04-04 19:35:35 +02:00
Rémy Coutable 03538558d9 Merge branch 'rs-empty-project-misc' into 'master'
Use `:empty_project` in worker, view, task, serializer, policy, migration, and mailer specs

See merge request !10272
2017-03-30 12:06:23 +00:00
author Jacob Vosmaer jacob@gitlab.com 1490710538 +0200 6b8c2ea866 Allow backup tests to run locally 2017-03-29 14:48:06 +02:00
Jacob Vosmaer eee07f1c7c Expand relative paths in storages 2017-03-29 14:48:05 +02:00
Robert Speicher 02ccf750ee Use Project `:repository` trait where necessary in task specs 2017-03-27 18:45:36 -04:00
Jacob Vosmaer 6c3ce620a9 Remove unnecessary before block 2017-03-21 14:55:41 +01:00
Jacob Vosmaer 3883a5f906 Rake task that can install gitaly at a tag version 2017-03-21 14:55:41 +01:00
Sean McGivern a5db7f5425 Merge branch '28447-hybrid-repository-storages' into 'master'
Update storage settings to allow extra values per shard

See merge request !9597
2017-03-07 16:55:03 +00:00
Rémy Coutable 9533fc355c Merge branch 'add-git-version-to-system-info' into 'master'
Add git version to gitlab:env:info

Closes #25376

See merge request !9128
2017-03-07 10:05:02 +00:00
Pawel Chojnacki d13669c98b Remove remnants of git annex 2017-03-03 18:33:47 +01:00
Alejandro Rodríguez 0b9d56f960 Update storage settings to allow extra values per shard
This will be necessary when adding gitaly settings. This version
doesn't make any functional changes, but allows us to include this
breaking change in 9.0 and add the needed extra settings in the future
with backwards compatibility
2017-03-03 12:13:30 -03:00
Semyon Pupkov e73b68a742 Add git version to gitlab:env:info
https://gitlab.com/gitlab-org/gitlab-ce/issues/25376
2017-02-28 20:42:13 +05:00
James Edwards-Jones 1af3f3b673 Merge branch 'master' into jej-pages-picked-from-ee 2017-02-03 17:25:26 +00:00
Valery Sizov ceb1ebd959 Active tense test coverage
Ports changes from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/642 back into CE
2017-02-01 22:45:41 +00:00
Kamil Trzcinski 120f9abaa1 Add GitLab Pages
- The pages are created when build artifacts for `pages` job are uploaded
- Pages serve the content under: http://group.pages.domain.com/project
- Pages can be used to serve the group page, special project named as host: group.pages.domain.com
- User can provide own 403 and 404 error pages by creating 403.html and 404.html in group page project
- Pages can be explicitly removed from the project by clicking Remove Pages in Project Settings
- The size of pages is limited by Application Setting: max pages size, which limits the maximum size of unpacked archive (default: 100MB)
- The public/ is extracted from artifacts and content is served as static pages
- Pages asynchronous worker use `dd` to limit the unpacked tar size
- Pages needs to be explicitly enabled and domain needs to be specified in gitlab.yml
- Pages are part of backups
- Pages notify the deployment status using Commit Status API
- Pages use a new sidekiq queue: pages
- Pages use a separate nginx config which needs to be explicitly added
2017-01-31 22:50:39 +00:00
Adam Niedzielski 82692ea214 Restore backup correctly when "BACKUP" environment variable is passed 2017-01-09 18:38:53 +01:00
Drew Blessing e0eb86ee80 Add LDAP task to rename a provider
Sometimes admins will change the LDAP configuration, not realizing
that problems will occur if the user's LDAP identities are not
also updated to use the new provider name. This task will give
admins a single command to run to update identities and will
prevent having to run multiple Rails console queries.
2016-12-16 09:57:05 -06:00
Rémy Coutable 2c0bcefdc6
Don't allow to specify a repo or version when installing Workhorse
The task will use the canonical repo and the required version.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-01 19:22:46 +01:00
Douwe Maan 7633e4ae3f Merge branch '23718/backup-rake-task-human-readable' into 'master'
23718/backup rake task human readable

## What does this MR do?
Add the human readable format to the backup tar file. 
From `1477317140_gitlab_backup.tar` to `1477317140_2016_10_24_gitlab_backup.tar`.

## Are there points in the code the reviewer needs to double check?

## Why was this MR needed?
#23718 issue
## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?
23718

See merge request !7188
2016-12-01 03:39:31 +00:00
Rémy Coutable b193e84974
Move task helpers to a module
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-30 12:20:21 +01:00
David Gerő 0fbb5a86db Add Human Readable Timestamp to backup tar file 2016-11-30 11:41:53 +01:00
Rémy Coutable a9c250eadd Add #run_command! to task helpers to raise a TaskFailedError if status is not 0
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-30 10:35:17 +01:00
Rémy Coutable fbbf177e3b New `gitlab:workhorse:install` rake task
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-30 10:34:59 +01:00
Drew Blessing dc30783057 Introduce better credential and error checking to `rake gitlab:ldap:check`
It was previously possible for invalid credential errors to go unnoticed
in this task. Users would believe everything was configured correctly and
then sign in would fail with 'invalid credentials'. This adds a specific
bind check, plus catches errors connecting to the server. Also, specs :)
2016-11-08 15:46:10 -06:00
Drew Blessing af5322e90b Add Rake task to create/repair GitLab Shell hooks symlinks 2016-11-01 14:52:59 -05:00
tiagonbotelho 96f050fa34 Backups do not fail anymore when using tar on annex and custom_hooks
only.
2016-10-27 11:24:35 +01:00
tiagonbotelho 4eb9056890 fixes build with cache:clear issue 2016-10-24 14:59:20 +01:00
Rémy Coutable ebba491493
Add a new gitlab:users:clear_all_authentication_tokens task
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-11 10:21:18 +02:00
bogdanvlviv 96ebc8c4f7 Use `File::exist?` instead of `File::exists?`
Since version ruby-2.2.0, method `File::exists?` is deprecated.
2016-08-11 13:54:45 +03:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Alejandro Rodríguez 86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00
DJ Mountney 1a7326ba9a Switch the gitlab:db:configure task to use tables.any? instead of looking specifically for the schema_migrations table 2016-05-25 10:47:09 -07:00
DJ Mountney 40d4d8a4e7 Add tests for the gitlab:db:configure rake task 2016-05-25 10:44:22 -07:00
Kamil Trzcinski 12bd781031 Fix backups if registry is disabled 2016-05-23 14:18:39 -05:00
Kamil Trzcinski 143cd58c39 Added backup of container registry 2016-05-16 17:25:38 -05:00
Grzegorz Bizon 6f0cba11da Ensure uploads dir exists when running backup specs 2016-03-30 15:40:49 +02:00
Drew Blessing 5516b6c47f Reload the schema before restoring a database backup 2016-03-21 21:16:34 -05:00
Marin Jankovski 2219743d5c Add lfs to backup specs. 2015-11-19 10:43:45 +01:00
Marin Jankovski d9c4625c6d Specs that failed before the fix. 2015-11-18 13:16:07 +01:00
Kamil Trzcinski d0e3e823a2 Implement Build Artifacts
- Offloads uploading to GitLab Workhorse
- Use /authorize request for fast uploading
- Added backup recipes for artifacts
- Support download acceleration using X-Sendfile
2015-11-10 12:51:50 +01:00
Jacob Vosmaer b847baf8c4 One more backup spec fix
Stop the 'uploads' part from actually running.
2015-10-06 16:11:59 +02:00
Jacob Vosmaer 852526e07f Spec fixes for new backup contents 2015-10-06 16:10:14 +02:00
Guilherme Garnier aed145a9c6 Fix rubocop warnings in spec/lib and spec/tasks 2015-10-03 16:02:21 -05:00
Kamil Trzcinski 2f2b9f67c2 Fix backup tests 2015-09-16 00:06:41 +02:00
Kamil Trzcinski 81d98112d4 Fix: tasks/gitlab/backup_rake_spec.rb 2015-09-15 22:21:51 +02:00
Kamil Trzcinski ed18e04bb3 Cleanup CI backup => migrate with GitLab 2015-09-15 20:14:21 +02:00
Jacob Vosmaer 39a7e210a3 Use a separate backup test directory and nuke its contents 2015-07-24 18:54:06 +02:00
Jacob Vosmaer db0fce322a Create more backups during backup tests
I hope this makes the backup tests more reliable.
2015-07-24 18:34:00 +02:00
Jacob Vosmaer 810ffab4b1 Use a loop when enabling subtasks 2015-07-10 14:44:07 +02:00
Jacob Vosmaer 4612599e5e Remove rake task re-enabling into a method 2015-07-09 12:11:35 +02:00
Jacob Vosmaer 64f6034091 More hacks to get the specs working again 2015-07-08 20:07:56 +02:00
Jacob Vosmaer 0194dd4182 Add tests for custom backup archive file permissions 2015-07-07 19:03:29 +02:00
Dmitriy Zaporozhets 779646ef38
Fix rubocop issues after merge of recent master
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-23 10:46:29 +02:00
Robert Speicher bf71d53f63 Change `to_not` calls to `not_to`
Both work, but now we're consistent across the entire app.
2015-06-22 12:13:49 +02:00
Robert Speicher 5a9ede4721 Update mock and stub syntax for specs 2015-06-22 12:13:46 +02:00
Douwe Maan 9157985cfc Merge branch 'fix-backup-spec-regexp' into 'master'
Improve regexp to prevent false positives

If a filename happened to contain "db" and enough "rwx" characters before, then
this test would previously fail. For example:

```
drwxr-xr-x gitlab-runner/gitlab-runner      0 2015-04-02 07:46 uploads/tmp/cassidy.stokes8477/gitlabhq/36d972fa55d6b44810fc6fd843473adb/
```

Adding a space before the "db" match string tightens up the regexp and reduces the
chance of an unintended match.

See merge request !489
2015-04-03 08:49:47 +00:00
Stan Hu b277f23a53 Improve regexp to prevent false positives
If a filename happened to contain "db" and enough "rwx" characters before, then
this test would previously fail. For example:

```
drwxr-xr-x gitlab-runner/gitlab-runner      0 2015-04-02 07:46 uploads/tmp/cassidy.stokes8477/gitlabhq/36d972fa55d6b44810fc6fd843473adb/
```

Adding a space before the "db" match string tightens up the regexp and reduces the
chance of unintended match.
2015-04-02 07:02:47 -07:00
Valery Sizov 67c83489ca ability to skip some items in backup 2015-04-02 15:37:50 +03:00
Vinnie Okada 0f78d92e4c Don't use chmod_R for backup tars
When creating backup tar files, only change permissions on the `db`,
`uploads`, and `repositories` directories, not their contents.
2015-03-28 08:38:48 -06:00
Vinnie Okada 61c06c5e1a Change permissions on backup files
Use more restrictive permissions for backup tar files and for the db,
uploads, and repositories directories inside the tar files.
2015-03-17 19:04:21 -06:00
Dmitriy Zaporozhets 3a324d9c6d Revert "Merge branch 'backup-permissions' into 'master'"
This reverts commit c42262b43b, reversing
changes made to c6586b1283.
2015-03-16 23:51:46 -07:00
Vinnie Okada 8587a29370 Change permissions on backup files
Use more restrictive permissions for backup tar files and for the db,
uploads, and repositories directories inside the tar files.
2015-03-15 13:14:30 -06:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Marin Jankovski cdc62cffcb Add rake task for google schema whitelisting. 2014-12-04 15:22:10 +01:00
Jacob Vosmaer 46b1c63b7a Make backup version blocker test more robust
Assuming that VERSION != VERSION.reverse is not robust. This will fail
at e.g. version 6.6.6.
2014-02-28 12:11:43 +01:00
Jacob Vosmaer b36751c897 Use VERSION contanst in backup specs 2014-02-28 11:57:58 +01:00
Andrew Kumanyaev f9780eeeca Fix deprecation in specs
From https://github.com/gitlabhq/gitlabhq/pull/6053
2014-01-15 14:00:11 +03:00
Dmitriy Zaporozhets fb0b932937 Revert "Fix deprecation in specs"
This reverts commit 414ead57ee.
2014-01-14 23:55:51 +02:00
Andrew Kumanyaev 414ead57ee Fix deprecation in specs
DEPRECATION: `expect { }.not_to raise_error(SpecificErrorClass)` is deprecated. Use `expect { }.not_to raise_error` (with no args) instead. Called from /home/travis/build/gitlabhq/gitlabhq/spec/tasks/gitlab/backup_rake_spec.rb:42:in `block (4 levels) in <top (required)>'.
2014-01-14 20:57:29 +03:00
Johannes Schleifenbaum cd19f82e51 Fix typos 2013-07-29 12:47:06 +02:00
Andrey Kumanyaev 67ccc8b52a Replace old hashes with new 1.9 ruby hashes (rebase) 2013-05-05 18:01:10 +04:00
Dmitriy Zaporozhets c8ba5c2d58 Fix routing issues when navigating over tree, commits etc 2012-12-25 06:14:05 +03:00
Dmitriy Zaporozhets b510f8c496 Fixed tests 2012-12-21 13:37:44 +02:00
Hugo Duksis a9c2500a55 Stub for Dir.chdir as it is not needed 2012-11-20 16:34:58 +02:00
Hugo Duksis a8eb3fe1d2 tests for issue #1984 2012-11-19 22:42:58 +02:00