RuboCop fails because of `Gitlab/Json` cop
GitLab has moved to a single codebase for GitLab CE and GitLab EE.
Please do not create issues here, instead create them at https://gitlab.com/gitlab-org/gitlab/issues. Job #3202545281 failed for bf18f329:
$ bundle exec rake rubocop:check:graceful
Running RuboCop in graceful mode:
rubocop --parallel --format RuboCop::Formatter::GracefulFormatter
This might take a while...
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/lib/gitlab/memory/diagnostic_reports_logger.rb:15:11.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/lib/gitlab/memory/diagnostic_reports_logger_spec.rb:14:13.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/tooling/rspec_flaky/report_spec.rb:44:16.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/tooling/rspec_flaky/report_spec.rb:61:6.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/tooling/rspec_flaky/report_spec.rb:116:17.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/tooling/bin/find_changes:68:4.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/tooling/lib/tooling/helm3_client.rb:71:17.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/tooling/lib/tooling/kubernetes_client.rb:143:14.
To see the complete backtrace run rubocop -d.
Inspecting 20518 files
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/lib/gitlab/memory/diagnostic_reports_logger.rb:15:11.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/lib/gitlab/memory/diagnostic_reports_logger_spec.rb:14:13.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/tooling/rspec_flaky/report_spec.rb:44:16.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/tooling/rspec_flaky/report_spec.rb:61:6.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/tooling/rspec_flaky/report_spec.rb:116:17.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/tooling/bin/find_changes:68:4.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/tooling/lib/tooling/helm3_client.rb:71:17.
To see the complete backtrace run rubocop -d.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/tooling/lib/tooling/kubernetes_client.rb:143:14.
To see the complete backtrace run rubocop -d.
20518 files inspected, no offenses detected
Silenced offenses:
lib/gitlab/database/migrations/batched_background_migration_helpers.rb:230:121: C: [Correctable] Gitlab/Json: Prefer Gitlab::Json over calling JSON or to_json directly. See https://docs.gitlab.com/ee/development/json.html
"\tsudo gitlab-rake gitlab:background_migrations:finalize[#{job_class_name},#{table_name},#{column_name},'#{job_arguments.to_json.gsub(',', '\,')}']" \
^^^^^^^^^^^^^^^^^^^^^
spec/commands/diagnostic_reports/uploader_smoke_spec.rb:34:7: C: [Correctable] Gitlab/Json: Prefer Gitlab::Json over calling JSON or to_json directly. See https://docs.gitlab.com/ee/development/json.html
{ ...
^
spec/requests/groups/settings/access_tokens_controller_spec.rb:102:14: C: [Correctable] Gitlab/Json: Prefer Gitlab::Json over calling JSON or to_json directly. See https://docs.gitlab.com/ee/development/json.html
expect(assigns(:active_resource_access_tokens).to_json).to eq(active_resource_access_tokens.to_json)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/requests/groups/settings/access_tokens_controller_spec.rb:102:69: C: [Correctable] Gitlab/Json: Prefer Gitlab::Json over calling JSON or to_json directly. See https://docs.gitlab.com/ee/development/json.html
expect(assigns(:active_resource_access_tokens).to_json).to eq(active_resource_access_tokens.to_json)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/requests/projects/settings/access_tokens_controller_spec.rb:103:14: C: [Correctable] Gitlab/Json: Prefer Gitlab::Json over calling JSON or to_json directly. See https://docs.gitlab.com/ee/development/json.html
expect(assigns(:active_resource_access_tokens).to_json).to eq(active_resource_access_tokens.to_json)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/requests/projects/settings/access_tokens_controller_spec.rb:103:69: C: [Correctable] Gitlab/Json: Prefer Gitlab::Json over calling JSON or to_json directly. See https://docs.gitlab.com/ee/development/json.html
expect(assigns(:active_resource_access_tokens).to_json).to eq(active_resource_access_tokens.to_json)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20518 files inspected, 6 offenses silenced
8 errors occurred:
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/lib/gitlab/memory/diagnostic_reports_logger.rb:15:11.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/lib/gitlab/memory/diagnostic_reports_logger_spec.rb:14:13.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/tooling/rspec_flaky/report_spec.rb:44:16.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/tooling/rspec_flaky/report_spec.rb:61:6.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/spec/tooling/rspec_flaky/report_spec.rb:116:17.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/tooling/bin/find_changes:68:4.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/tooling/lib/tooling/helm3_client.rb:71:17.
An error occurred while Gitlab/Json cop was inspecting /builds/gitlab-org/gitlab-foss/tooling/lib/tooling/kubernetes_client.rb:143:14.
uninitialized constant RuboCop::Version::Server
Did you mean? TCPServer
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/version.rb:22:in `version'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli/command/execute_runner.rb:82:in `display_error_summary'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli/command/execute_runner.rb:58:in `display_summary'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli/command/execute_runner.rb:27:in `block in execute_runner'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli/command.rb:11:in `run'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli/environment.rb:18:in `run'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli.rb:72:in `run_command'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli.rb:79:in `execute_runners'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rubocop-1.36.0/lib/rubocop/cli.rb:48:in `run'
/builds/gitlab-org/gitlab-foss/rubocop/check_graceful_task.rb:36:in `run'
/builds/gitlab-org/gitlab-foss/lib/tasks/rubocop.rake:17:in `block (3 levels) in <main>'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/sentry-ruby-core-5.1.1/lib/sentry/rake.rb:24:in `execute'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/bin/rake:25:in `load'
/builds/gitlab-org/gitlab-foss/vendor/ruby/2.7.0/bin/rake:25:in `<top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/cli.rb:483:in `exec'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/cli.rb:31:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/cli.rb:25:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/exe/bundle:48:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.15/exe/bundle:36:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1