diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-09-04 15:07:33 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-09-04 15:08:36 +0300 |
commit | 0a39a3d4cdaf6ad4a5a031c1ca287cdc555c60ab (patch) | |
tree | b0b5db7da33628ac283898d503da221a74a986c8 /lib | |
parent | b76bc2762a245c61089fae486e61c9fd83d45f95 (diff) |
Persist `needs:` validation as config error
In case when `needs:` is missing, but when requested by service,
we would not save the pipeline with config_error.
This makes it explicit that we want to persist the error
as `config_error` failure reason.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/pipeline/chain/helpers.rb | 7 | ||||
-rw-r--r-- | lib/gitlab/ci/pipeline/chain/populate.rb | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/helpers.rb b/lib/gitlab/ci/pipeline/chain/helpers.rb index 6bb3a75291b..8ccb1066575 100644 --- a/lib/gitlab/ci/pipeline/chain/helpers.rb +++ b/lib/gitlab/ci/pipeline/chain/helpers.rb @@ -5,7 +5,12 @@ module Gitlab module Pipeline module Chain module Helpers - def error(message) + def error(message, config_error: false) + if config_error && command.save_incompleted + pipeline.yaml_errors = message + pipeline.drop!(:config_error) + end + pipeline.errors.add(:base, message) end end diff --git a/lib/gitlab/ci/pipeline/chain/populate.rb b/lib/gitlab/ci/pipeline/chain/populate.rb index 65029f5ce7f..13eca5a9d28 100644 --- a/lib/gitlab/ci/pipeline/chain/populate.rb +++ b/lib/gitlab/ci/pipeline/chain/populate.rb @@ -26,7 +26,7 @@ module Gitlab # Gather all runtime build/stage errors # if seeds_errors = pipeline.stage_seeds.flat_map(&:errors).compact.presence - return error(seeds_errors.join("\n")) + return error(seeds_errors.join("\n"), config_error: true) end ## |