summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-02 00:18:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-02 00:18:50 +0000
commit1bde803c0dc057fefff36be2104c0ae6b5cb1336 (patch)
treed3f52d98da59d5604aa42016c3c11d2f1596afc8 /app
parent133febf6d6c7b8f4c63002e065762cb3eec9ba15 (diff)
downloadgitlab-ce-1bde803c0dc057fefff36be2104c0ae6b5cb1336.tar.gz
Add latest changes from gitlab-org/security/gitlab@15-9-stable-ee
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/build.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index f8b3777841d..1e70dd171ed 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -74,6 +74,7 @@ module Ci
delegate :trigger_short_token, to: :trigger_request, allow_nil: true
delegate :ensure_persistent_ref, to: :pipeline
delegate :enable_debug_trace!, to: :metadata
+ delegate :debug_trace_enabled?, to: :metadata
serialize :options # rubocop:disable Cop/ActiveRecordSerialize
serialize :yaml_variables, Gitlab::Serializer::Ci::Variables # rubocop:disable Cop/ActiveRecordSerialize
@@ -1069,11 +1070,10 @@ module Ci
end
def debug_mode?
- # TODO: Have `debug_mode?` check against data on sent back from runner
- # to capture all the ways that variables can be set.
- # See (https://gitlab.com/gitlab-org/gitlab/-/issues/290955)
- variables['CI_DEBUG_TRACE']&.value&.casecmp('true') == 0 ||
- variables['CI_DEBUG_SERVICES']&.value&.casecmp('true') == 0
+ # perform the check on both sides in case the runner version is old
+ debug_trace_enabled? ||
+ Gitlab::Utils.to_boolean(variables['CI_DEBUG_SERVICES']&.value, default: false) ||
+ Gitlab::Utils.to_boolean(variables['CI_DEBUG_TRACE']&.value, default: false)
end
def drop_with_exit_code!(failure_reason, exit_code)