travis-ci / travis-conditions

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

Configurations with (multiple?) slash-wrapped regular expressions fail to parse #10

Closed backspace closed 6 years ago

backspace commented 6 years ago

This is a continuation from #7. I’ve been experimenting with various .travis.ymls and it seems that the presence of wrapping /…/s causes parsing failures that are not mentioned in the documentation.

For instance, in this commit, I changed the stages configuration to this:

stages:
  - name: Jorts
    if: type = cron OR commit_message =~ /jortleby/ OR (tag IS present AND tag =~ /^hello$/)

The key change is that I added the wrapping / around jortleby. This causes the request to be rejected as unparseable.

Variations that work:

    if: type = cron OR commit_message =~ /jortleby/ OR (tag IS present AND tag IS present)

and

    if: type = cron OR commit_message =~ /jortleby/ OR (tag IS present AND tag =~ ^hello)

So to me it seems like there’s something special about having more than one /…/ regular expression in a condition.

svenfuchs commented 6 years ago

thanks for reporting @backspace! ❤️

i believe this should be fixed in https://github.com/travis-ci/travis-conditions/pull/12

i'm probably missing something. is this issue #10 here the same as #11?

(btw i think you might be interested to learn about https://github.com/travis-ci/docs-travis-ci-com/pull/1978 for debugging/experimenting with conditions)

backspace commented 6 years ago

Thank you!

You’re correct, eval and parse are news to me, and would be quite helpful for this kind of thing, thanks. I dream of someday having this 🤞🏻

backspace commented 6 years ago

as for #11, maybe? I guess it wasn’t clear to me that they were the same but it does seem possible.