Fix wrong behavior when CI keyword "when" is an array
We have the "inclusion" validation for the "when" keyword but no validation for its type. So, the attribute also accepts an array as the value. The "inclusion" validation of "ActiveModel::Validations" also accepts array values and compares each element. In this commit, we are adding the "type: String" validation for the "when" keyword for Job and Bridge entries. Changelog: fixed
显示
- app/assets/javascripts/editor/schema/ci.json 3 个添加, 39 个删除app/assets/javascripts/editor/schema/ci.json
- lib/gitlab/ci/config/entry/bridge.rb 1 个添加, 1 个删除lib/gitlab/ci/config/entry/bridge.rb
- lib/gitlab/ci/config/entry/job.rb 1 个添加, 1 个删除lib/gitlab/ci/config/entry/job.rb
- spec/frontend/editor/schema/ci/ci_schema_spec.js 4 个添加, 0 个删除spec/frontend/editor/schema/ci/ci_schema_spec.js
- spec/frontend/editor/schema/ci/yaml_tests/negative_tests/job_when.yml 11 个添加, 0 个删除...d/editor/schema/ci/yaml_tests/negative_tests/job_when.yml
- spec/frontend/editor/schema/ci/yaml_tests/positive_tests/job_when.yml 10 个添加, 0 个删除...d/editor/schema/ci/yaml_tests/positive_tests/job_when.yml
- spec/lib/gitlab/ci/config/entry/bridge_spec.rb 35 个添加, 1 个删除spec/lib/gitlab/ci/config/entry/bridge_spec.rb
- spec/lib/gitlab/ci/config/entry/job_spec.rb 20 个添加, 0 个删除spec/lib/gitlab/ci/config/entry/job_spec.rb
加载中
想要评论请 注册 或 登录