Commit Graph

1320 Commits

Author SHA1 Message Date
GitLab Bot 571d993b49 Add latest changes from gitlab-org/gitlab@master 2020-01-15 18:08:34 +00:00
GitLab Bot e879335864 Add latest changes from gitlab-org/gitlab@master 2020-01-09 00:07:40 +00:00
GitLab Bot 015663b70f Add latest changes from gitlab-org/gitlab@master 2020-01-06 21:07:43 +00:00
GitLab Bot 898e2cc1df Add latest changes from gitlab-org/gitlab@master 2019-12-20 09:24:38 +00:00
GitLab Bot b5571e6e22 Add latest changes from gitlab-org/gitlab@master 2019-12-19 18:07:48 +00:00
GitLab Bot 5bd24a54ef Add latest changes from gitlab-org/gitlab@master 2019-12-17 09: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 862d225ca0 Add latest changes from gitlab-org/gitlab@master 2019-12-16 15:07:39 +00:00
GitLab Bot 99ddca0d88 Add latest changes from gitlab-org/gitlab@master 2019-12-06 21:07:54 +00:00
GitLab Bot 63894d59ab Add latest changes from gitlab-org/gitlab@master 2019-12-06 12:06:21 +00:00
GitLab Bot 8723197387 Add latest changes from gitlab-org/gitlab@master 2019-12-05 12:07:43 +00:00
GitLab Bot 8644755363 Add latest changes from gitlab-org/gitlab@master 2019-12-01 06:06:11 +00:00
GitLab Bot eac0da9a47 Add latest changes from gitlab-org/gitlab@master 2019-11-29 15:06:43 +00:00
GitLab Bot 20758bc3b3 Add latest changes from gitlab-org/gitlab@master 2019-11-27 18:06:30 +00:00
GitLab Bot 2477ab5553 Add latest changes from gitlab-org/gitlab@master 2019-11-20 21:06:38 +00:00
GitLab Bot 3fc9a8e695 Add latest changes from gitlab-org/gitlab@master 2019-11-15 12:06:12 +00:00
GitLab Bot 56d96ad7fa Add latest changes from gitlab-org/gitlab@master 2019-11-01 03:06:26 +00:00
GitLab Bot 11faf8ae72 Add latest changes from gitlab-org/gitlab@master 2019-10-23 21:06:17 +00:00
GitLab Bot ad1e4b8fb8 Add latest changes from gitlab-org/gitlab@master 2019-10-21 15:05:58 +00:00
GitLab Bot 8e45d25f7d Add latest changes from gitlab-org/gitlab@master 2019-10-16 18:08:01 +00:00
GitLab Bot 77a7772c3b Add latest changes from gitlab-org/gitlab@master 2019-10-08 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 5ecacec304 Add latest changes from gitlab-org/gitlab@master 2019-10-04 15:06:38 +00:00
GitLab Bot e66d6781ef Add latest changes from gitlab-org/gitlab@master 2019-09-26 18:06:29 +00:00
GitLab Bot f1a5755898 Add latest changes from gitlab-org/gitlab@master 2019-09-24 15:06:34 +00:00
GitLab Bot d46287cc16 Add latest changes from gitlab-org/gitlab@master 2019-09-20 12:05:52 +00:00
GitLab Bot 6cd5b7dbfa Add latest changes from gitlab-org/gitlab@master 2019-09-19 11:50:12 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
Peter Leitzen 50c647af51 Add rake task `db:obsolete_ignored_columns`
Show a list of obsolete `ignored_columns`
2019-09-11 16:23:42 +00:00
Dinesh Panda 736b5908da Avoid calling freeze on already frozen strings in lib 2019-09-10 08:11:43 +00:00
Ash McKenzie 9fc9ab2ba2 Add new GitlabDanger class
This class encapsulates our use of the Danger gem.
2019-09-06 11:21:53 +00:00
Ash McKenzie f34e4545ec Revert "Merge branch '66596-allow-danger-to-be-run-locally' into 'master'"
This reverts merge request !32196
2019-09-06 07:14:30 +00:00
Ash McKenzie fdc17ebc03
Add new danger_local Rake task
The benefit of running the danger_local Rake task
is that it displays some informational messages
for clarity and also exits with 1 if there's any
output.
2019-09-06 10:56:48 +10:00
GitLab Release Tools Bot 34c2b6adf9 Merge branch 'security-personal-snippets' into 'master'
Add direct upload support for personal snippets

See merge request gitlab/gitlabhq!3226
2019-08-29 21:34:22 +00:00
shampton c96adfcd6c Move visual review toolbar to NPM
Remove the visual review toolbar code
in favor of using the NPM package.
2019-08-23 12:57:21 -07:00
Jan Provaznik 41d52bbfe9 Add direct upload support for personal snippets 2019-08-23 11:19:14 +02:00
Michael Kozono 9eabc0d6fc Merge branch 'legacy-attachments-migrate-fix' into 'master'
Migrate legacy uploads rake tasks

See merge request gitlab-org/gitlab-ce!29409
2019-08-16 22:07:56 +00:00
Jarka Košanová 19db315734 Add rake tasks for migrating leacy uploads
- move uploads created by AttachmentUploader
- handle also files created for legacy_diff_notes
2019-08-16 07:52:30 +02: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
Hordur Freyr Yngvason 37ffbeeab1 Make ruby 2.6 the officially supported version 2019-08-14 23:16:55 +00: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
Lin Jen-Shin dbe3b9848b Merge branch 'resolve-scripts-differences' into 'master'
Backport EE changes made to the scripts/ directory

See merge request gitlab-org/gitlab-ce!31015
2019-07-29 15:15:46 +00:00
Yorick Peterse d7a4c1d2a5
Backport EE changes made to the scripts/ directory
This backport changes made by EE to the files in the scripts/ directory.
This comes with a few changes to some scripts to make them work in the
single codebase setup.
2019-07-29 13:53:20 +02:00
Andreas Brandl 988dc80585
Further remove code branches by database type
We dropped MySQL support and a lot of mysql specific code has been
removed in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/29608.

This comes in from the other direction and removes any `if postgresql?`
branches.
2019-07-29 12:47:06 +02:00
Heinrich Lee Yu 2b3d00a778 Remove unneeded monkey-patch
Changes all calls to data_source_exists? to table_exists?
since that is the intent of these calls
2019-07-25 12:21:38 +08:00
Douwe Maan 50ab880f80 Merge branch 'cleanup/spec-tasks' into 'master'
Resolves confusion within spec rake tasks.

See merge request gitlab-org/gitlab-ce!31073
2019-07-24 18:47:23 +00:00
Jeremy Jackson 271a6d1b8f Resolves confusion within spec rake tasks 2019-07-23 18:34:50 -06:00
Nick Thomas 4aa76dddec
Remove dead MySQL code
None of this code can be reached any more, so it can all be removed
2019-07-23 16:53:03 +01: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
Mike Greiling 97b8f85e03
Move frontend fixtures into spec/frontend
Moves every fixture source file from
spec/javascripts to spec/frontend
2019-07-19 02:27:15 -05:00
Mike Greiling faa17d5263
Rename the karma:fixtures task
Introduces frontend:fixtures rake task to replace
karma:fixtures and update documentation and CI scripts
to match
2019-07-19 02:27:14 -05:00
Stan Hu ef3f638642 Merge branch 'jc-fix-rugged-feature-flag-rake' into 'master'
Add unset_rugged rake task

Closes #64441

See merge request gitlab-org/gitlab-ce!30636
2019-07-16 20:40:42 +00:00
Brett Walker 0175a7ab15 Allow parameters for rake gitlab:seed:issues
to specify backfill_weeks and average_issues_per_week
2019-07-15 11:33:39 -05:00
Douglas Barbosa Alexandre 06b8fe5607 Merge branch '63667-hashed-storage-migration-count-correctly' into 'master'
Display the amount for Hashed Storage migration/rollback correctly

Closes #63667

See merge request gitlab-org/gitlab-ce!29996
2019-07-11 16:57:04 +00:00
John Cai ff0654b0b4 Add unset_rugged rake task
Adds an unset_rugged rake task that unsets all rugged feature flags.
Also fixes the existing disable_rugged task to have it explicitly
disable feature flags instead of just unsetting them.
2019-07-11 09:53:41 -07:00
Felipe Artur f0683aab05 Improve Graphql Docs
Adds more friendly docs for GraphQl implementation
2019-07-11 08:06:35 +00: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
Mayra Cabrera 0ab89d8e36 Add a rubocop for Rails.logger
Suggests to use a JSON structured log instead

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
2019-07-10 19:26:47 +00:00
Lukas Eipert d5842e7490
Prefer offline install for yarn 2019-07-02 16:29:47 +02:00
Nick Thomas 131523ef89
Remove migrations from setup_postgresql 2019-07-02 09:35:03 +01:00
Dmitriy Zaporozhets f63dc06cb4 Merge branch 'tc-rake-orphan-artifacts' into 'master'
Add rake task to clean orphan artifact files

See merge request gitlab-org/gitlab-ce!29681
2019-07-01 08:04:57 +00: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
DJ Mountney de93bf1fbb Update comments and docs around min schema version
Fixed some spelling
Dropped rake task description for a prefix only task
Added note on skipping the check to the postgres debugging dev doc
2019-06-25 10:44:40 -07:00
DJ Mountney e1befc9b3f Drop the source upgrade change
We no longer need to point people away from using db:migrate
2019-06-25 10:44:40 -07:00
DJ Mountney e448124fab Add an flag for skipping the schema version check
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.
2019-06-25 10:44:40 -07:00
DJ Mountney f4232d848e Fix db:migrate for fresh installs 2019-06-25 10:44:40 -07:00
DJ Mountney f4e1553519 Move min schema version check to db:migrate
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
2019-06-25 10:44:40 -07:00
DJ Mountney 7a089438fa Check supported version when migrating
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
2019-06-25 10:44:40 -07:00
Stan Hu ad3abd1d3a Silence backup warnings when CRON=1 in use
If CRON=1 is in use, we shouldn't generate any output or admins may be
notified via e-mail about unnecessary warnings.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63703
2019-06-25 06:30:51 -07:00
Yorick Peterse 8469f59d78
Backport the EE schema and migrations to CE
This backports all EE schema changes to CE, including EE migrations,
ensuring both use the same schema.

== Updated tests

A spec related to ghost and support bot users had to be modified to make
it pass. The spec in question assumes that the "support_bot" column
exists when defining the spec. In the single codebase setup this is not
the case, as the column is backported in a later migration. Any attempt
to use a different schema version or use of "around" blocks to
conditionally disable specs won't help, as reverting the backport
migration would also drop the "support_bot" column. Removing the
"support_bot" tests entirely appears to be the only solution.

We also need to update some foreign key tests now that we have
backported the EE columns. Fortunately, these changes are very minor.

== Backporting migrations

This commit moves EE specific migrations (except those for the Geo
tracking database) and related files to CE, and also removes any traces
of the ee/db directory.

Some migrations had to be modified or removed, as they no longer work
with the schema being backported. These migrations were all quite old,
so we opted for removing them where modifying them would take too much
time and effort.

Some old migrations were modified in EE, while also existing in CE. In
these cases we took the EE code, and in one case removed them entirely.
It's not worth spending time trying to merge these changes somehow as we
plan to remove old migrations around the release of 12.0, see
https://gitlab.com/gitlab-org/gitlab-ce/issues/59177 for more details.
2019-06-17 17:09:05 +02:00
Brett Walker 2a5ddcc045 Show description of 'gettext:regenerate' task 2019-06-07 09:38:01 -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
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
Sarah Groff Hennigh-Palermo 9377eb1822 Build visual_review_toolbar with webpack
It takes a lot of lines to move a script
2019-05-29 20:24:15 +00:00
Rémy Coutable 6145ddf515
Revert "Merge branch 'revert-04c3c6dd' into 'master'"
This reverts commit 744f1f2e70, reversing
changes made to c4d930e5f5.
2019-05-22 21:47:32 +02:00
Kamil Trzciński 4f20c9de6f Revert "Merge branch 'reorganize-tests-jobs-by-level' into 'master'"
This reverts merge request !27514
2019-05-22 11:45:46 +00:00
Kamil Trzciński 04c3c6dd5a Merge branch 'reorganize-tests-jobs-by-level' into 'master'
Reorganize test jobs by level

See merge request gitlab-org/gitlab-ce!27514
2019-05-22 10:21:38 +00:00
Stan Hu 27381e22a9 Move files from lib/haml_lint to haml_lint
Files in lib will be eager loaded and hence will require haml_lint to be
loaded. Since this is only a development dependency, we can't assume
this gem will be available in production, so it should never be loaded
in production.
2019-05-21 19:49:14 -07:00
Rémy Coutable 4d9c76e9e4
Reorganize test jobs by level
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-05-20 14:31:58 +02:00
Lin Jen-Shin e82f6d979f Avoid pipes so it doesn't overflow 2019-05-18 11:18:10 +08:00
Ben Bodenmiller 2497917b65 delete feature flag when disabling Rugged 2019-05-13 08:57:10 +00:00
Cindy Pallares deb5276f8b
Add warning that gitlab-secrets isn't included
Many customers forget to include the gitlab-secrets.json file. This adds
a warning that both gitlab-secrets.json and gitlab.rb are not included
in the backup.
2019-05-08 12:39:04 -05:00
Stan Hu f93b2e02a5 Run rubocop -a on CE files 2019-05-05 03:24:28 -07:00
Stan Hu a5620a0d23 Revert changes in lib/tasks/lint.rake 2019-05-05 03:24:28 -07:00
Stan Hu 09b44072e7 Remove stdout/stderr capture in static-analysis 2019-05-05 03:24:27 -07:00
Stan Hu fee5b0a4bc Add logging for time and lint start 2019-05-05 03:24:27 -07:00
Rémy Coutable 2537b0c1e0
Provide a new gitlab:seed:issues task
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-04-23 11:43:53 +02:00
Kamil Trzciński 650f40865e Forbid the use of `#reload` and prefer `#reset`
The `#reload` makes to load all objects into memory,
and the main purpose of `#reload` is to drop the association cache.

The `#reset` seems to solve exactly that case.
2019-04-15 13:05:14 +02:00
Tim Zallmann fb8908d961 Removed also the in the meanwhile introduced rake task 2019-04-10 13:51:14 -07:00
Tim Zallmann c57529556c Revert "Merge branch 'tz-reorganise-digests-json' into 'master'"
Reverts the loading of emojis and its images to move forward with RC
2019-04-10 11:49:06 -07:00
Robert Speicher e036cb04a2 Merge branch 'remaining-lib-differences' into 'master'
Resolve remaining CE to EE differences in lib/

See merge request gitlab-org/gitlab-ce!26608
2019-04-03 12:27:55 +00:00
Yorick Peterse 1f4bc814ab
Backport EE changes to gitlab:env:info
This backports EE specific changes for the Rake task `gitlab:env:info`,
wrapping them in a conditional. There is no way to inject code in the
middle of a Rake task in EE, so unfortunately this is the best we can
do.
2019-04-02 14:57:44 +02:00
John Jarvis 69b65a6b74 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into jarv/dev-to-gitlab-2019-04-02 2019-04-02 10:12:32 +02:00
Jan Provaznik a466d97e62 Rake task for removing exif from uploads
Adds a rake task which can be used for removing EXIF
data from existing uploads.
2019-04-02 07:48:35 +00:00
Wei-Meng Lee cfc6d2528c Fix attempting to drop views in PostgreSQL 2019-04-02 00:19:22 +00:00
Nick Thomas 98a5976b78
Document ApplicationRecord / pluck_primary_key
We also enable the rubocop that makes it mandatory
2019-03-29 20:54:06 +00:00
Douglas Barbosa Alexandre a86f48c79b
Add helper method to return a human-friendly name for database adapter 2019-03-21 19:03:26 -03:00
Lin Jen-Shin ae9d60ac2b Merge branch '58844-follow-up-from-don-t-create-ee-specific-files-when-creating-emojis-fixture-files' into 'master'
Simplify JavaScriptFixturesHelpers

Closes gitlab-ee#10386, #58898, and #58844

See merge request gitlab-org/gitlab-ce!26045
2019-03-19 14:37:08 +00:00
Patrick Bajao 26dadbc9c4 Integrate Gitlab::Keys with Gitlab::Shell
In this commit, some methods that aren't being used
are removed from `Gitlab::Shell`. They are the ff:
- `#remove_keys_not_found_in_db`
- `#batch_read_key_ids`
- `#list_key_ids`

The corresponding methods in `Gitlab::Keys` have been
removed as well.
2019-03-19 11:16:21 +00:00
Rémy Coutable b789bfaeef
Simplify the JavaScriptFixturesHelpers module
- Only storing fixtures in one place
- This place changes whether we are in CE or EE

We discovered with @winh that only fixtures located under
spec/javascripts/fixtures are used, even in EE so there's no need to
clean/create fixtures in ee/spec/javascripts/fixtures.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-03-19 08:46:22 +01:00
Nick Thomas 9f05e97aad
Run rubocop -a 2019-03-13 13:42:43 +00: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
Ray Paik 976fee745e Update cleanup.rake to fix a typo in the error message 2019-03-07 23:37:16 +00:00
Tim Zallmann d07919de90 Moved all emojis to the public folder
Created new emojis map in public folder

Renamed folder to emojis

Loading now the emojis from Localstorage or from Server

Moved all emojis to the public folder

Loading the emojis.json file now through AJAX

Loads now the map in the web element instead when building the emoji tag

Updated the custom Element Setup to modern method

Fixed Emoji Karma Specs for async loading

Loading now the emojis from Localstorage or from Server

Loads now the map in the web element instead when building the emoji tag

Fixed problem with FIXTURE_PATH for emojis fixtures

Fixes Linting Error in gemojione.rake

Fixed Emoji Karma Specs

Fix static type check in gemojione and check if already registered

Testing if the Emoji Support Check is failing Rspec

Change of CLass Name, returning true on check to test

Fixes failing Emoji RSpec Tests

Moved Emojis into public/-/emojis/1/

Fixed Linting Errors in gl_emoji

Fix to fixtures creation for emojis

Fixed path spec for new subdirectory -/emojis

Optimized emojis.json output

Fix for Emoji Spec failure due to unicode dataset

Better catch handling for emojis
2019-03-07 09:33:03 +00:00
Rémy Coutable c1c30f19a1 Merge branch 'resolve-some-rake-differences' into 'master'
Resolve some Rake task differences

See merge request gitlab-org/gitlab-ce!25644
2019-03-04 11:45:21 +00:00
Sean McGivern fd50ba4240 Merge branch 'sh-rugged-find-commit' into 'master'
Bring back Rugged implementation of find_commit

See merge request gitlab-org/gitlab-ce!25477
2019-03-04 09:22:44 +00:00
Stan Hu fb6a4e21d4 Bring back Rugged implementation of find_commit
This brings back some of the changes in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20339.

For users using Gitaly on top of NFS, accessing the Git data directly
via Rugged is more performant than Gitaly. This merge request introduces
the feature flag `rugged_find_commit` to activate Rugged paths.

There are also Rake tasks `gitlab:features:enable_rugged` and
`gitlab:features:disable_rugged` to enable/disable these feature
flags altogether.

Part of four Rugged changes identified in
https://gitlab.com/gitlab-org/gitlab-ce/issues/57317.
2019-03-01 08:45:51 -08:00
Gabriel Mazetto fc0ff92807 Added Rollbacker workers and support on the rake task
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.
2019-03-01 15:49:20 +01:00
Gabriel Mazetto ff2ca3569e Rake task for storage rollback 2019-03-01 15:49:20 +01:00
Yorick Peterse bb873b1e3b
Make the backup Rake task the same as in EE
EE uses single quotes for the changed line, whereas CE was using double
quotes. This commit ensures both repositories use the same kind of
quotes.
2019-02-28 15:03:10 +01:00
Yorick Peterse 9e08b71a04
Backport EE changes to the Karma Rake task
There's no harm in globbing for the ee/ directory, since this will
effectively be a noop in CE.
2019-02-28 15:03:10 +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 eafe834c3d
Reduce remaining diff with EE in app/services
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-02-14 12:37:55 +01:00
Stan Hu 1dadfff3f5 Move terminate_all_connections into setup Rake task 2019-02-11 21:30:57 -08:00
Stan Hu 5488e8a4a3 Kill all PostgreSQL connections for rake dev:setup
If there are any clients connected to the DB, PostgreSQL won't let you
drop the database. It's possible that Sidekiq, Unicorn, or some other
client will be hanging onto a connection, preventing the DROP DATABASE
from working. To workaround this problem, this method cancels all the
connections so that the db:reset command will work.

Note that there's still a slight possibility a client connects after its
connection is terminated. If this is an issue, we could solve it by
revoking CONNECT access, but for now it seems this works.

Closes https://gitlab.com/gitlab-org/gitlab-development-kit/issues/450
2019-02-11 21:30:57 -08:00
Jose Torres 56c267e52c Fix MySQL error when truncating a table that doesn't exist
This adds a conditional statement before truncating the
`schema_migrations` table.

This comit also ports this code to Rails 5.
2019-02-05 17:30:22 -08:00
Rémy Coutable 6b39f55d3f
Add cache to the 'compile-assets' and 'gitlab:assets:compile' jobs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-02-05 14:04:54 +01: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
Rémy Coutable 3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +01:00
Michael Kozono 9f80f04059 Prevent admins from attempting hashed storage migration on read only DB 2018-12-19 21:10:00 +00: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
Brett Walker 4c7b7924b3 Fix typo in method name "silence_stderr" 2018-11-29 20:04:25 -06:00
Nick Thomas c43af89748 Merge branch 'zj-object-pool-path' into 'master'
Rename Repository table to PoolRepository

See merge request gitlab-org/gitlab-ce!23236
2018-11-28 13:07:12 +00:00
Douwe Maan 5e3076f2d7 Merge branch '50341-cleanup-useless-project-import-attributes' into 'master'
Removes all the irrelevant code and columns that were migrated from the Project…

See merge request gitlab-org/gitlab-ce!21497
2018-11-28 11:19:55 +00:00
Tiago Botelho 4bd8a427d4
Removes all the irrelevant import related code and columns
Clears the import related columns and code from the Project
model over to the ProjectImportState model
2018-11-27 12:58:13 +00:00
Zeger-Jan van de Weg fff7754186
Rename the Repository table to PoolRepository
To separate the different kinds of repositories we have at GitLab this
table will be renamed to pool_repositories. A project can, for now at
least, be member of none, or one of these. The table will get additional
columns in a later merge request where more logic is implemented for the
model.

Further included is a small refactor of logic around hashing ids for the
disk_path, mainly to ensure a previous implementation is reusable.

The disk_path for the pool_repositories table no longer has a NOT NULL
constraint, but given the hashing of the ID requires the DB to assign
the record an ID, an after_create hook is used to update the value.

A related MR is:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23143, adding
tables for 'normal' repositories and wiki_repositories.
2018-11-27 13:41:46 +01: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
Zeger-Jan van de Weg 358fefc777
Migrate storage checks to Gitaly
Most of these checks are not valuable in the current setup, thus removed
and replaced by Gitaly checking if its read and writeable.

Depends on:
1. https://gitlab.com/gitlab-org/gitaly/merge_requests/675
2018-11-09 09:15:42 +01:00
Rémy Coutable e232ebf7a1 Merge branch 'rake-gitaly-check' into 'master'
Delegate storage health check to Gitaly's health check

Closes gitaly#1336

See merge request gitlab-org/gitlab-ce!22063
2018-11-06 15:08:32 +00:00
DJ Mountney 06b6daacb1 Merge remote-tracking branch 'origin/master' into dev-master 2018-10-29 14:37:19 -07:00
Imre Farkas b9652d8e4d [master] Persist only SHA digest of PersonalAccessToken#token 2018-10-29 16:06:45 +00:00
Cindy Pallares 75cf72344f
Use gitlab_environment for ldap rake task 2018-10-25 13:56:39 -05:00
Lin Jen-Shin 3a9271f179 Convert parser warnings to stdout in haml_lint
This was used in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16648
and this could happen from time to time, so let's just keep it.
2018-10-24 15:31:00 +08:00
Alejandro Rodríguez 098c722542 Add gitlab:gitaly:check task for Gitaly health check
Also, since Gitaly now takes care of checking for storage paths
existence/accessibility, we can remove those check from the
gitlab:gitlab_shell_check task and advance further into 0 direct disk
approach on gitlab-rails
2018-10-23 20:11:10 -03:00
William George 1b153d497b Make getting a user by the username case insensitive 2018-10-18 09:06:44 +00:00
Michael Bisbjerg 51b21050c5 Typo in log message of gitlab-rake gitlab:artifacts:migrate 2018-09-27 13:18:14 +00:00
Dylan Griffith f5f5d6ea1f Resolve "Un-vendor CI templates" 2018-09-26 15:39:27 +00:00
Douglas Barbosa Alexandre 6167615a74 Merge branch 'follow-up-geo-sync-disabled-wikis' into 'master'
CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6906

See merge request gitlab-org/gitlab-ce!21903
2018-09-25 17:19:23 +00: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
Cindy Pallares a7e774566e
Enable write to auth_keys file during restore
Fast lookup of authorized SSH keys in the database was ported to CE in
v10.4. This change adds the option to enable the setting via the restore
rake task and assumes yes if the force env variable is set.
2018-09-25 09:34:14 -05: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
Balasankar "Balu" C c4668c388f
Add wrapper rake task to migrate all uploads to OS
Add a rake task that will trigger gitlab:uploads:migrate rake task with
different possible arguments, one by one.
2018-09-18 20:26:54 +05:30
Marcel Amirault 6876c7afa8 Fix grammar (setup to set-up) in code comments, spec, views, etc. 2018-09-17 09:17:33 +00: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
Douwe Maan 1f765ce9ea Merge branch '48778-remove-old-storage-logic-from-import-export' into 'master'
Resolve "Remove old storage logic from Import/Export"

Closes #51144, #50109, #48778, and #51079

See merge request gitlab-org/gitlab-ce!21409
2018-09-07 14:28:25 +00:00
Douwe Maan 81f4dc059d Merge branch 'zj-cleanup-port-gitaly' into 'master'
Port cleanup tasks to use Gitaly

Closes #40529 and gitaly#954

See merge request gitlab-org/gitlab-ce!21588
2018-09-07 13:20:54 +00:00
James Lopez f1277fbf0b
refactor code based on feedback 2018-09-07 14:43:51 +02: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
James Lopez 27442862cf
refactor code based on feedback 2018-09-07 13:42:49 +02:00
James Lopez a2aa505805
Refactor code to remove object storage flag from Import/Export
Updated docs, refactor import/export code
Fix AvatarUploader path issue
Fix project export upload webhook error
2018-09-06 16:52:42 +02:00
Kamil Trzciński 0b5ff7dd2e Fix migrations 2018-09-04 17:43:42 +02:00
Rémy Coutable 3a35a03ff8
Stop using Flay
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-09-03 15:31:53 +02:00
Jasper Maes 86a8955cf3 Rails 5: replace removed silence_stream 2018-08-28 13:47:40 +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
Jarka Kadlecová 6aaeb6dc41 Clean orphaned files in object storage 2018-08-07 12:51:58 +02:00
Michael Kozono 3cbd8b1343 Add local project uploads cleanup task 2018-07-31 11:09:42 -07:00
Zeger-Jan van de Weg 4600265e00
Remove gitlab:user:check_repos task
While reviewing this branch it was noted that this task was broken.
Given the limited value this task brings, and given the fact that much
of the old behaviour has been moved to be automatically fixed, removing
was a good option.

Suggestion in:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20806#note_91261001
2018-07-31 14:31:51 +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
Douwe Maan 8bc7845fbf Merge branch '48932-disable-saml-if-omniauth-is-disabled' into 'master'
Resolve "Disable SAML and Bitbucket if OmniAuth is disabled"

Closes #48932

See merge request gitlab-org/gitlab-ce!20608
2018-07-23 07:48:00 +00:00
Lin Jen-Shin d0afab482f Disable SAML if OmniAuth is disabled
We also try to unify the way we setup OmniAuth, and how we check
if it's enabled or not.
2018-07-20 18:54:46 +08:00
Zeger-Jan van de Weg 80c61639f3
Remove refs cleanup job
Introduced by f20eadcbbe, meant to remove
refs from Git using the wrong name. That never made it to a non-rc
release and can be safely removed now.
2018-07-19 14:47:11 +02:00
Mark Chao a63bce1a4b Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
Bob Van Landuyt f6d22ec11e Remove timestamps from `locale/gitlab.pot`
This will help us avoid conflicts when regenerating the pot file, the
timestamps aren't used by Crowdin.
2018-07-10 18:37:30 +02:00
Lin Jen-Shin 4ee08b77bc Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
Bob Van Landuyt f3fbf50ad8 Update `gettext:updated_check` regenerate pot file
Making the `gettext:updated_check` by completely regenerating the gitlab.pot.

This avoids an issue where `gettext:find` would not pick up on changes
if the file isn't removed first.
2018-07-09 08:21:15 +02:00
Grzegorz Bizon 90a99ff3aa Add pipeline stages position clean-up migration 2018-06-29 13:57:52 +00:00
DJ Mountney a9fcf96856 Fixes an issue where migrations instead of schema loading were run
If you called rake gitlab:db:drop_tables before running gitlab-ctl
reconfigure (or rake gitlab:db:configure)
2018-06-27 13:39:55 -07:00
Rubén Dávila d67590bcce Merge branch 'bvl-dont-generate-mo' into 'master'
Don't generate `.mo` files

Closes #47979

See merge request gitlab-org/gitlab-ce!20048
2018-06-20 21:22:49 +00:00
Bob Van Landuyt 119f89260c Don't generate `.mo` files
Since we are only using `.po` files for translation we can shave off
some setup time.

Generating the `mo` files also regenerates the PO-files, including
fuzzy translations. Those cause a lot of bugs, and we don't need them
anymore since the `po` files are generated by an external translation service.
2018-06-20 22:16:13 +02:00
Lin Jen-Shin 582c6b17cf Unify flay.rake and gettext.rake from EE 2018-06-21 00:31:56 +08:00
Bob Van Landuyt fff6b89f0f More verbose errors in static-analysis
This makes the output in static analysis a bit more verbose.
2018-06-20 14:57:47 +02:00
Bob Van Landuyt 17fc178cb5 Correctly translate all forms in tests 2018-06-15 14:58:47 +02:00
Bob Van Landuyt 9b5339371b Validate if changed translations are checked in 2018-06-15 14:58:47 +02: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
Lin Jen-Shin f35b97948e Bring `rake postgresql_md5_hash` to CE 2018-06-14 17:18:57 +08:00
Douwe Maan 8b0d2283d7 Merge branch 'gitaly-disk-access-3' into 'master'
Find and mark more Git disk access locations, part 2

See merge request gitlab-org/gitlab-ce!19437
2018-06-12 13:32:46 +00:00
Jacob Vosmaer f376347f24 Find and mark more Git disk access locations, part 2 2018-06-12 14:33:37 +02:00
James Lopez fa1a75ae28 Merge branch 'sh-github-importer-improve-error' into 'master'
GitHub Rake importer: Fail with a clearer explanation if GitLab username is wrong

See merge request gitlab-org/gitlab-ce!19653
2018-06-11 18:29:03 +00:00
Stan Hu 28871d73ac GitHub Rake importer: Fail with a clearer explanation if GitLab username is wrong 2018-06-11 11:03:17 -07:00
Stan Hu 6defeb0a7d Expire Wiki content cache after importing a repository
The cache state for Wikis that were imported via GitHub or Bitbucket does
not appear to have been flushed after a successful import.

Closes #47546
2018-06-11 08:33:06 -07: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
Shinya Maeda 0d00d02e84 Directly refer application code from migration code 2018-06-04 14:14:20 +09:00
Lin Jen-Shin db40a7c4e3 Preserve warnings even if it passed 2018-06-01 02:04:55 +08:00
Imre Farkas 20dfe25c15 Export assigned issues in iCalendar feed 2018-05-31 14:01:04 +00:00
Gabriel Mazetto 8c5ce1b07c Specs covering listing all gitlab:storage:* types 2018-05-29 02:53:21 +02:00
Gabriel Mazetto d17b45adf5 assign helper full name to variable to reduce code length 2018-05-28 23:39:36 +02:00
Gabriel Mazetto 78d25079f5 Extracted auxiliary methods from storage.rake into specific RakeHelper 2018-05-28 23:39:35 +02:00
Rémy Coutable cc570b6c44 Merge branch '46600-fix-gitlab-revision-when-not-in-git-repo' into 'master'
Resolve "gitlab 10.8 assumes that installation is a git working copy."

Closes #46600

See merge request gitlab-org/gitlab-ce!19125
2018-05-25 13:32:49 +00:00
Stan Hu e6fca03bbd Fix backup creation and restore for specific Rake tasks 2018-05-24 14:58:25 +00:00
Rémy Coutable d50a80a282
Replace Gitlab::REVISION with Gitlab.revision and handle installations without a .git directory
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-05-24 10:14:01 +02:00
Andreas Brandl d8d30f8cb8 Increase text limit for GPG keys (mysql only).
Closes #46530.
2018-05-22 15:43:17 +02:00
Andreas Brandl 8257651822 Migration to add/drop primary key constraints for composite keys.
Closes #43706.
2018-05-21 17:56:57 +02:00
Harish Ved b11c218ad9 Fix: Use case in-sensitive ordering by name for groups 2018-05-17 16:20:41 +00:00