diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-02 03:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-02 03:18:50 +0300 |
commit | 1bde803c0dc057fefff36be2104c0ae6b5cb1336 (patch) | |
tree | d3f52d98da59d5604aa42016c3c11d2f1596afc8 /app/models/ci | |
parent | 133febf6d6c7b8f4c63002e065762cb3eec9ba15 (diff) |
Add latest changes from gitlab-org/security/gitlab@15-9-stable-ee
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/build.rb | 10 |
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) |