Commit 2fa04939 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch '299105-fix-tasks' into 'master'

Fix Style/FrozenStringLiteralComment violations in Rake tasks

See merge request gitlab-org/gitlab!53268
parents 884400e6 26141c2a
......@@ -2648,87 +2648,6 @@ Style/FrozenStringLiteralComment:
- 'bin/secpick'
- 'danger/changes_size/Dangerfile'
- 'danger/metadata/Dangerfile'
- 'ee/lib/tasks/geo.rake'
- 'ee/lib/tasks/geo/git.rake'
- 'ee/lib/tasks/geo/replication.rake'
- 'ee/lib/tasks/gitlab/db.rake'
- 'ee/lib/tasks/gitlab/elastic.rake'
- 'ee/lib/tasks/gitlab/elastic/test.rake'
- 'ee/lib/tasks/gitlab/geo.rake'
- 'ee/lib/tasks/gitlab/indexer.rake'
- 'ee/lib/tasks/gitlab/ldap.rake'
- 'ee/lib/tasks/gitlab/seed/insights.rake'
- 'ee/lib/tasks/gitlab/seed/metrics.rake'
- 'ee/lib/tasks/migrate/ldap.rake'
- 'lib/tasks/brakeman.rake'
- 'lib/tasks/cache.rake'
- 'lib/tasks/ci/cleanup.rake'
- 'lib/tasks/cleanup.rake'
- 'lib/tasks/config_lint.rake'
- 'lib/tasks/db_obsolete_ignored_columns.rake'
- 'lib/tasks/dev.rake'
- 'lib/tasks/downtime_check.rake'
- 'lib/tasks/eslint.rake'
- 'lib/tasks/file_hooks.rake'
- 'lib/tasks/frontend.rake'
- 'lib/tasks/gemojione.rake'
- 'lib/tasks/gitlab/artifacts/check.rake'
- 'lib/tasks/gitlab/artifacts/migrate.rake'
- 'lib/tasks/gitlab/backup.rake'
- 'lib/tasks/gitlab/bulk_add_permission.rake'
- 'lib/tasks/gitlab/check.rake'
- 'lib/tasks/gitlab/container_registry.rake'
- 'lib/tasks/gitlab/db.rake'
- 'lib/tasks/gitlab/doctor/secrets.rake'
- 'lib/tasks/gitlab/exclusive_lease.rake'
- 'lib/tasks/gitlab/external_diffs.rake'
- 'lib/tasks/gitlab/features.rake'
- 'lib/tasks/gitlab/generate_sample_prometheus_data.rake'
- 'lib/tasks/gitlab/git.rake'
- 'lib/tasks/gitlab/gitaly.rake'
- 'lib/tasks/gitlab/helpers.rake'
- 'lib/tasks/gitlab/import.rake'
- 'lib/tasks/gitlab/import_export.rake'
- 'lib/tasks/gitlab/info.rake'
- 'lib/tasks/gitlab/ldap.rake'
- 'lib/tasks/gitlab/lfs/check.rake'
- 'lib/tasks/gitlab/lfs/migrate.rake'
- 'lib/tasks/gitlab/list_repos.rake'
- 'lib/tasks/gitlab/packages/events.rake'
- 'lib/tasks/gitlab/packages/migrate.rake'
- 'lib/tasks/gitlab/pages.rake'
- 'lib/tasks/gitlab/praefect.rake'
- 'lib/tasks/gitlab/seed.rake'
- 'lib/tasks/gitlab/setup.rake'
- 'lib/tasks/gitlab/shell.rake'
- 'lib/tasks/gitlab/storage.rake'
- 'lib/tasks/gitlab/tcp_check.rake'
- 'lib/tasks/gitlab/test.rake'
- 'lib/tasks/gitlab/two_factor.rake'
- 'lib/tasks/gitlab/update_templates.rake'
- 'lib/tasks/gitlab/uploads/check.rake'
- 'lib/tasks/gitlab/uploads/migrate.rake'
- 'lib/tasks/gitlab/uploads/sanitize.rake'
- 'lib/tasks/gitlab/usage_data.rake'
- 'lib/tasks/gitlab/user_management.rake'
- 'lib/tasks/gitlab/web_hook.rake'
- 'lib/tasks/gitlab/workhorse.rake'
- 'lib/tasks/gitlab/x509/update.rake'
- 'lib/tasks/gitlab_danger.rake'
- 'lib/tasks/grape.rake'
- 'lib/tasks/haml-lint.rake'
- 'lib/tasks/import.rake'
- 'lib/tasks/karma.rake'
- 'lib/tasks/lint.rake'
- 'lib/tasks/migrate/composite_primary_keys.rake'
- 'lib/tasks/migrate/migrate_iids.rake'
- 'lib/tasks/migrate/setup_postgresql.rake'
- 'lib/tasks/pngquant.rake'
- 'lib/tasks/rubocop.rake'
- 'lib/tasks/scss-lint.rake'
- 'lib/tasks/setup.rake'
- 'lib/tasks/test.rake'
- 'lib/tasks/tokens.rake'
- 'qa/Gemfile'
- 'qa/Rakefile'
- 'qa/bin/qa'
......
# frozen_string_literal: true
task spec: ['geo:db:test:prepare']
namespace :geo do
......
# frozen_string_literal: true
namespace :geo do
namespace :git do
namespace :housekeeping do
......
# frozen_string_literal: true
namespace :geo do
namespace :replication do
task pause: :gitlab_environment do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :db do
desc 'GitLab | DB | Output pseudonymity dump of selected tables'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :elastic do
desc "GitLab | Elasticsearch | Index everything at once"
......
# frozen_string_literal: true
namespace :gitlab do
namespace :elastic do
namespace :test do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :geo do
desc "Gitlab | Geo | Check replication/verification status"
......
# frozen_string_literal: true
namespace :gitlab do
namespace :indexer do
desc "GitLab | Indexer | Install or upgrade gitlab-elasticsearch-indexer"
......
# frozen_string_literal: true
namespace :gitlab do
namespace :ldap do
desc 'GitLab | LDAP | Run a GroupSync'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :seed do
namespace :insights do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :seed do
desc "GitLab | Metrics | Setup development metrics"
......
# frozen_string_literal: true
desc "GitLab | Migrate provider names to multiple LDAP setup"
namespace :gitlab do
task migrate_ldap_providers: :environment do
......
# frozen_string_literal: true
desc 'Security check via brakeman'
task :brakeman do
# We get 0 warnings at level 'w3' but we would like to reach 'w2'. Merge
......
# frozen_string_literal: true
namespace :cache do
namespace :clear do
REDIS_CLEAR_BATCH_SIZE = 1000 # There seems to be no speedup when pushing beyond 1,000
......
# frozen_string_literal: true
namespace :ci do
namespace :cleanup do
desc "GitLab | CI | Clean running builds"
......
# frozen_string_literal: true
namespace :gitlab do
namespace :cleanup do
desc "GitLab | Cleanup | Delete moved repositories"
......
# frozen_string_literal: true
module ConfigLint
def self.run(files)
failures = files.reject do |file|
......
# frozen_string_literal: true
desc 'Show a list of obsolete `ignored_columns`'
task 'db:obsolete_ignored_columns' => :environment do
list = Gitlab::Database::ObsoleteIgnoredColumns.new.execute
......
# frozen_string_literal: true
task dev: ["dev:setup"]
namespace :dev do
......
# frozen_string_literal: true
desc 'Checks if migrations in a branch require downtime'
task downtime_check: :environment do
repo = if defined?(Gitlab::License)
......
# frozen_string_literal: true
unless Rails.env.production?
desc "GitLab | Run ESLint"
task eslint: ['yarn:check'] do
......
# frozen_string_literal: true
namespace :file_hooks do
desc 'Validate existing file hooks'
task validate: :environment do
......
# frozen_string_literal: true
unless Rails.env.production?
namespace :frontend do
desc 'GitLab | Frontend | Generate fixtures for JavaScript tests'
......
# frozen_string_literal: true
namespace :gemojione do
desc 'Generates Emoji SHA256 digests'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :artifacts do
desc 'GitLab | Artifacts | Check integrity of uploaded job artifacts'
......
# frozen_string_literal: true
require 'logger'
require 'resolv-replace'
......
# frozen_string_literal: true
require 'active_record/fixtures'
namespace :gitlab do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :import do
desc "GitLab | Import | Add all users to all projects (admin users are added as maintainers)"
......
# frozen_string_literal: true
namespace :gitlab do
desc 'GitLab | Check the configuration of GitLab and its environment'
task check: :gitlab_environment do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :container_registry do
desc "GitLab | Container Registry | Configure"
......
# frozen_string_literal: true
namespace :gitlab do
namespace :db do
desc 'GitLab | DB | Manually insert schema migration version'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :doctor do
desc "GitLab | Check if the database encrypted values can be decrypted using current secrets"
......
# frozen_string_literal: true
namespace :gitlab do
namespace :exclusive_lease do
desc 'GitLab | Exclusive Lease | Clear existing exclusive leases for specified scope (default: *)'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :external_diffs do
desc "Override external diffs in file storage to be in object storage instead. This does not change the actual location of the data"
......
# frozen_string_literal: true
namespace :gitlab do
namespace :features do
desc 'GitLab | Features | Enable direct Git access via Rugged for NFS'
......
# frozen_string_literal: true
namespace :gitlab do
desc "GitLab | Generate Sample Prometheus Data"
task :generate_sample_prometheus_data, [:environment_id] => :gitlab_environment do |_, args|
......
# frozen_string_literal: true
namespace :gitlab do
namespace :git do
desc 'GitLab | Git | Check all repos integrity'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :gitaly do
desc 'GitLab | Gitaly | Install or upgrade gitaly'
......
# frozen_string_literal: true
# Prevent StateMachine warnings from outputting during a cron task
StateMachines::Machine.ignore_method_conflicts = true if ENV['CRON']
......
# frozen_string_literal: true
namespace :gitlab do
namespace :import do
# How to use:
......
# frozen_string_literal: true
namespace :gitlab do
namespace :import_export do
desc 'GitLab | Import/Export | Show Import/Export version'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :env do
desc 'GitLab | Env | Show information about GitLab and its environment'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :ldap do
desc 'GitLab | LDAP | Rename provider'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :lfs do
desc 'GitLab | LFS | Check integrity of uploaded LFS objects'
......
# frozen_string_literal: true
require 'logger'
desc "GitLab | LFS | Migrate LFS objects to remote storage"
......
# frozen_string_literal: true
namespace :gitlab do
task list_repos: :environment do
scope = Project
......
# frozen_string_literal: true
require 'logger'
desc "GitLab | Packages | Events | Generate hll counter events file for packages"
......
# frozen_string_literal: true
require 'logger'
desc "GitLab | Packages | Migrate packages files to remote storage"
......
# frozen_string_literal: true
require 'logger'
namespace :gitlab do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :praefect do
def int?(string)
......
# frozen_string_literal: true
namespace :gitlab do
namespace :seed do
desc "GitLab | Seed | Seeds issues"
......
# frozen_string_literal: true
namespace :gitlab do
desc "GitLab | Setup production application"
task setup: :gitlab_environment do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :shell do
desc "GitLab | Shell | Install or upgrade gitlab-shell"
......
# frozen_string_literal: true
namespace :gitlab do
namespace :storage do
desc 'GitLab | Storage | Migrate existing projects to Hashed Storage'
......
# frozen_string_literal: true
namespace :gitlab do
desc "GitLab | Check TCP connectivity to a specific host and port"
task :tcp_check, [:host, :port] => :environment do |_t, args|
......
# frozen_string_literal: true
namespace :gitlab do
desc "GitLab | Run all tests"
task :test do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :two_factor do
desc "GitLab | 2FA | Disable Two-factor authentication (2FA) for all users"
......
# frozen_string_literal: true
namespace :gitlab do
desc "GitLab | Update templates"
task :update_templates do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :uploads do
desc 'GitLab | Uploads | Check integrity of uploaded files'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :uploads do
namespace :migrate do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :uploads do
namespace :sanitize do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :usage_data do
desc 'GitLab | UsageData | Generate raw SQLs for usage ping in YAML'
......
# frozen_string_literal: true
namespace :gitlab do
namespace :user_management do
desc "GitLab | User management | Update all users of a group with personal project limit to 0 and can_create_group to false"
......
# frozen_string_literal: true
namespace :gitlab do
namespace :web_hook do
desc "GitLab | Webhook | Adds a webhook to the projects"
......
# frozen_string_literal: true
namespace :gitlab do
namespace :workhorse do
desc "GitLab | Workhorse | Install or upgrade gitlab-workhorse"
......
# frozen_string_literal: true
require 'logger'
desc "GitLab | X509 | Update signatures when certificate store has changed"
......
# frozen_string_literal: true
desc 'Run local Danger rules'
task :danger_local do
require_relative '../../tooling/gitlab_danger'
......
# frozen_string_literal: true
namespace :grape do
desc 'Print compiled grape routes'
task routes: :environment do
......
# frozen_string_literal: true
unless Rails.env.production?
require 'haml_lint/rake_task'
require Rails.root.join('haml_lint/inline_javascript')
......
# frozen_string_literal: true
require 'benchmark'
require 'rainbow/ext/string'
......
# frozen_string_literal: true
unless Rails.env.production?
namespace :karma do
# alias exists for legacy reasons
......
# frozen_string_literal: true
unless Rails.env.production?
namespace :lint do
task :static_verification_env do
......
# frozen_string_literal: true
namespace :gitlab do
namespace :db do
desc 'GitLab | DB | Adds primary keys to tables that only have composite unique keys'
......
# frozen_string_literal: true
desc "GitLab | Build internal ids for issues and merge requests"
task migrate_iids: :environment do
puts 'Issues'.color(:yellow)
......
# frozen_string_literal: true
desc 'GitLab | Generate PostgreSQL Password Hash'
task :postgresql_md5_hash do
require 'digest'
......
# frozen_string_literal: true
return if Rails.env.production?
require 'png_quantizator'
......
# frozen_string_literal: true
unless Rails.env.production?
require 'rubocop/rake_task'
......
# frozen_string_literal: true
unless Rails.env.production?
require 'scss_lint/rake_task'
......
# frozen_string_literal: true
desc "GitLab | Setup gitlab db"
task :setup do
Rake::Task["gitlab:setup"].invoke
......
# frozen_string_literal: true
Rake::Task["test"].clear
desc "GitLab | Run all tests"
......
# frozen_string_literal: true
require_relative '../../app/models/concerns/token_authenticatable.rb'
require_relative '../../app/models/concerns/token_authenticatable_strategies/base.rb'
require_relative '../../app/models/concerns/token_authenticatable_strategies/insecure.rb'
......
......@@ -21,10 +21,6 @@ RSpec.describe Backup::Files do
allow(File).to receive(:realpath).with("/var/gitlab-pages").and_return("/var/gitlab-pages")
allow(File).to receive(:realpath).with("/var/gitlab-pages/..").and_return("/var")
allow_any_instance_of(String).to receive(:color) do |string, _color|
string
end
allow_any_instance_of(described_class).to receive(:progress).and_return(progress)
end
......
......@@ -9,8 +9,6 @@ RSpec.describe 'gitlab:git rake tasks' do
before do
Rake.application.rake_require 'tasks/gitlab/git'
allow_any_instance_of(String).to receive(:color) { |string, _color| string }
stub_warn_user_is_not_gitlab
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment