travis-ci / travis-conditions

Boolean language for conditional builds, stages, jobs
MIT License
20 stars 4 forks source link

Uncaught exception for invalid env data #2

Open svenfuchs opened 6 years ago

svenfuchs commented 6 years ago

See https://github.com/travis-ci/travis-yml/commit/de47ccc76fd1081903f06ab585d2b47ef504d0e6#commitcomment-28925719

This https://github.com/travis-ci/travis-conditions/blob/c6d7b9747617371a4845b4920cd41dc74a747ea3/lib/travis/conditions/v0/data.rb#L26 raises ArgumentError: wrong array length at 0 (expected 2, was 1) if data[:env] is an array with plain strings that do not contain =.

Should raise something like InvalidDataError instead.

kerrizor commented 6 years ago

I spotted this is Gatekeeper as well.

webknjaz commented 6 years ago

@svenfuchs I think, I've spotted another regression. Old parser was able to match env-based allow_failures, new one seems to ignore env at all. Even turning it into a mapping doesn't help: