Multi-Project pipeline with `needs:pipeline` using example from docs results in undefined error
Summary
Using the example in the documention for Mirroring status from upstream pipeline
upstream_bridge:
stage: test
needs:
pipeline: other/project
results in an "undefined error"
Example Project
You can view this on gitlab.com in a test project of mine: https://gitlab.com/kevenhughes/arcport/pipelines/81165861
Replicated on self-managed 12.2.4-ee as well.
Relevant logs and/or screenshots
production.log:
Completed 500 Internal Server Error in 53ms (ActiveRecord: 7.7ms | Elasticsearch: 0.0ms)
NoMethodError (undefined method `to_sym' for [:pipeline, "other/project"]:Array
Did you mean? to_s
to_set):
lib/gitlab/ci/yaml_processor.rb:164:in `block in validate_job_needs!'
lib/gitlab/ci/yaml_processor.rb:163:in `each'
lib/gitlab/ci/yaml_processor.rb:163:in `validate_job_needs!'
lib/gitlab/ci/yaml_processor.rb:113:in `block in initial_parsing'
lib/gitlab/ci/yaml_processor.rb:108:in `each'
lib/gitlab/ci/yaml_processor.rb:108:in `initial_parsing'
lib/gitlab/ci/yaml_processor.rb:20:in `initialize'
lib/gitlab/ci/yaml_processor.rb:87:in `new'
lib/gitlab/ci/yaml_processor.rb:87:in `validation_message'
Possible fixes
using to_sym
on an array is invalid:
irb(main):009:0> ar = ["one", 2, 3.0]
=> ["one", 2, 3.0]
irb(main):010:0> ar.to_sym
Traceback (most recent call last):
4: from /usr/local/bin/irb:23:in `<main>'
3: from /usr/local/bin/irb:23:in `load'
2: from /usr/local/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
1: from (irb):10
NoMethodError (undefined method `to_sym' for ["one", 2, 3.0]:Array)
Did you mean? to_s
to_set
relevant lines of code:
https://gitlab.com/gitlab-org/gitlab-ee/blob/v12.2.0-ee/lib/gitlab/ci/yaml_processor.rb#L164
Related Merge Request: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/12343
Customer ticket: https://gitlab.zendesk.com/agent/tickets/131433 (internal)