Skip to content

Commit d9211fc

Browse files
committed
Suppress rubocop warnings for redeploy_state and deploy_state
1 parent d86ba5f commit d9211fc

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

app/models/shipit/deploy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def build_rollback(user = nil, env: nil, force: false)
9494
parent_id: id,
9595
since_commit: stack.last_deployed_commit,
9696
until_commit:,
97-
env: env&.to_h || {},
97+
env: env.to_h,
9898
allow_concurrency: force,
9999
ignored_safeties: force,
100100
max_retries: stack.retries_on_rollback

app/models/shipit/stack.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def undeployed_commits?
132132

133133
def trigger_task(definition_id, user, env: nil, force: false)
134134
definition = find_task_definition(definition_id)
135-
env = env&.to_h || {}
135+
env = env.to_h
136136

137137
definition.variables_with_defaults.each do |variable|
138138
env[variable.name] ||= variable.default
@@ -158,7 +158,7 @@ def build_deploy(until_commit, user, env: nil, force: false, allow_concurrency:
158158
user_id: user.id,
159159
until_commit:,
160160
since_commit:,
161-
env: filter_deploy_envs(env&.to_h || {}),
161+
env: filter_deploy_envs(env.to_h),
162162
allow_concurrency:,
163163
ignored_safeties: force || !until_commit.deployable?,
164164
max_retries: retries_on_deploy

app/models/shipit/task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def dump(hash)
5151
end
5252

5353
def load(hash)
54-
hash&.to_h || {} # cast back to a real hash
54+
hash.to_h # cast back to a real hash
5555
end
5656

5757
def new

app/models/shipit/undeployed_commit.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# frozen_string_literal: true
22

3+
# rubocop:disable Lint/MissingCopEnableDirective, Style/OptionalBooleanParameter
4+
# Disabling for now because we need to support the `bypass_safeties` parameter
5+
# in the `deploy_state` and `redeploy_state` methods. We can revisit this later.
6+
7+
require 'delegate'
38
module Shipit
49
class UndeployedCommit < DelegateClass(Commit)
510
attr_reader :index

0 commit comments

Comments
 (0)