Skip to content
代码片段 群组 项目
未验证 提交 809c92c3 编辑于 作者: Ashvin Sharma's avatar Ashvin Sharma 提交者: GitLab
浏览文件

Fix rubocop errors in smoke test

Some of the rubocop errors snuck past local and that started failing
the smoke_tests. This MR aims to fix those test. I will also include
some fixes from the .rubocop_todo file to keep stuff clean.
上级 19c11d91
No related branches found
No related tags found
无相关合并请求
...@@ -10,9 +10,7 @@ Layout/EmptyLinesAroundMethodBody: ...@@ -10,9 +10,7 @@ Layout/EmptyLinesAroundMethodBody:
- 'app/services/members/destroy_service.rb' - 'app/services/members/destroy_service.rb'
- 'ee/app/models/software_license.rb' - 'ee/app/models/software_license.rb'
- 'ee/lib/gitlab/elastic/helper.rb' - 'ee/lib/gitlab/elastic/helper.rb'
- 'ee/lib/remote_development/workspace_operations/reconcile/output/desired_config_generator.rb'
- 'ee/spec/support/helpers/identity_verification_helpers.rb' - 'ee/spec/support/helpers/identity_verification_helpers.rb'
- 'ee/spec/support/shared_contexts/remote_development/remote_development_shared_contexts.rb'
- 'lib/api/helpers/packages_helpers.rb' - 'lib/api/helpers/packages_helpers.rb'
- 'lib/gitlab/background_migration/batched_migration_job.rb' - 'lib/gitlab/background_migration/batched_migration_job.rb'
- 'lib/gitlab/ci/project_config.rb' - 'lib/gitlab/ci/project_config.rb'
......
...@@ -121,7 +121,6 @@ def self.get_extra_k8s_resources( ...@@ -121,7 +121,6 @@ def self.get_extra_k8s_resources(
env_secret_name:, env_secret_name:,
file_secret_name: file_secret_name:
) )
workspaces_agent_config = workspace.workspaces_agent_config workspaces_agent_config = workspace.workspaces_agent_config
agent_annotations = workspaces_agent_config.annotations agent_annotations = workspaces_agent_config.annotations
agent_labels = workspaces_agent_config.labels agent_labels = workspaces_agent_config.labels
...@@ -281,7 +280,7 @@ def self.get_merged_labels_and_annotations( ...@@ -281,7 +280,7 @@ def self.get_merged_labels_and_annotations(
'workspaces.gitlab.com/host-template' => domain_template.to_s, 'workspaces.gitlab.com/host-template' => domain_template.to_s,
'workspaces.gitlab.com/id' => workspace_id.to_s, 'workspaces.gitlab.com/id' => workspace_id.to_s,
'workspaces.gitlab.com/max-resources-per-workspace-sha256' => 'workspaces.gitlab.com/max-resources-per-workspace-sha256' =>
Digest::SHA256.hexdigest(max_resources_per_workspace.sort.to_h.to_s) OpenSSL::Digest::SHA256.hexdigest(max_resources_per_workspace.sort.to_h.to_s)
} }
annotations = agent_annotations.merge(extra_annotations) annotations = agent_annotations.merge(extra_annotations)
[labels, annotations] [labels, annotations]
......
...@@ -315,7 +315,9 @@ def create_config_to_apply(workspace:, **args) ...@@ -315,7 +315,9 @@ def create_config_to_apply(workspace:, **args)
desired_config_generator_version = workspace.desired_config_generator_version desired_config_generator_version = workspace.desired_config_generator_version
method_name = "create_config_to_apply_v#{desired_config_generator_version}" method_name = "create_config_to_apply_v#{desired_config_generator_version}"
# rubocop:disable GitlabSecurity/PublicSend -- We are intentionally doing this send to dynamically select the generator version method
send(method_name, workspace: workspace, **args) send(method_name, workspace: workspace, **args)
# rubocop:enable GitlabSecurity/PublicSend
end end
# rubocop:disable Metrics/ParameterLists, Metrics/AbcSize -- Cleanup as part of https://gitlab.com/gitlab-org/gitlab/-/issues/421687 # rubocop:disable Metrics/ParameterLists, Metrics/AbcSize -- Cleanup as part of https://gitlab.com/gitlab-org/gitlab/-/issues/421687
...@@ -986,7 +988,6 @@ def workspace_service_account( ...@@ -986,7 +988,6 @@ def workspace_service_account(
labels:, labels:,
annotations: annotations:
) )
image_pull_secrets_names = image_pull_secrets.map { |secret| { name: secret.symbolize_keys.fetch(:name) } } image_pull_secrets_names = image_pull_secrets.map { |secret| { name: secret.symbolize_keys.fetch(:name) } }
{ {
kind: 'ServiceAccount', kind: 'ServiceAccount',
......
...@@ -61,6 +61,7 @@ def self.validate_mutually_dependent_settings( ...@@ -61,6 +61,7 @@ def self.validate_mutually_dependent_settings(
mutually_dependent_settings:, mutually_dependent_settings:,
default_setting_names: default_setting_names:
) )
# No blank line here (satisfies Layout/EmptyLinesAroundMethodBody)
if (mutually_dependent_settings - default_setting_names).any? if (mutually_dependent_settings - default_setting_names).any?
raise "Unknown mutually dependent setting(s): " \ raise "Unknown mutually dependent setting(s): " \
......
...@@ -110,7 +110,6 @@ def build_expected_rop_steps( ...@@ -110,7 +110,6 @@ def build_expected_rop_steps(
ok_results_for_steps:, ok_results_for_steps:,
context_passed_along_steps: context_passed_along_steps:
) )
expected_rop_steps = [] expected_rop_steps = []
rop_steps.each do |rop_step| rop_steps.each do |rop_step|
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册