Travis CI conditions not consistent with travis-conditions tool

This concat stage condition evaluates to true using the travis-conditions tool:

$ echo '{"repo": "plus3it/pyppyn", "env": ["OWNER=plus3it", \
"THIS_REPO=pyppyn"]}' \
| travis-conditions eval "repo = concat(env(OWNER),/,env(THIS_REPO))"
true

But the same thing in .travis.yml evaluates to false.

if: repo = concat(env(OWNER),/,env(THIS_REPO))

(See this build, where no deploy stage is shown. We’ve narrowed down this issue to that part of the condition: https://travis-ci.org/plus3it/pyppyn/builds/486966874)

Any thoughts?

Sorry, but how does this build show the problem? It is a PR build, so neither


nor

evaluates to true.

A subsequent master branch build include these jobs, so I think this is not an issue.

Sorry, wrong link above. I fixed it there.

We had to remove repo = concat(env(OWNER),/,env(THIS_REPO)) to get jobs to run. Here’s merge master with no deploy jobs: https://travis-ci.org/plus3it/pyppyn/builds/486966874

Ah, OK.

I don’t think we interpret THIS_REPO, which is defined in

So the env(THIS_REPO) will return what you think it does.

We had to change it to THIS_REPO. The repo and REPO seemed to be interfering with each other: repo = concat(env(OWNER),/,env(REPO)). But, that still doesn’t work…

I don’t understand what you are saying. What did you test, and what happened?

Sorry, doing too much at once.

The travis-conditions tool shows that this does not work correctly because repo and REPO conflict:

$ echo '{"repo": "plus3it/pyppyn", "env": ["OWNER=plus3it", "REPO=pyppyn"]}' | travis-conditions eval "repo = concat(env(OWNER),/,env(REPO))"
false
$ echo '{"repo": "plus3it/pyppyn", "env": ["OWNER=plus3it", "THIS_REPO=pyppyn"]}' | travis-conditions eval "repo = concat(env(OWNER),/,env(THIS_REPO))"
true

So, I thought that changing the env name to THIS_REPO would fix it in .travis.yml but it did not.

In .travis.yml for merge to master, this evaluates as true:

if: branch = env(RELEASE_BRANCH) AND type != pull_request

But this evaluates as false, even though the travis-conditions tool says it should work:

if: branch = env(RELEASE_BRANCH) AND type != pull_request AND repo = concat(env(OWNER),/,env(THIS_REPO))

Thanks for the info.

$ echo '{"repo": "plus3it/pyppyn", "env": ["OWNER=plus3it", "REPO=pyppyn"]}' | travis-conditions eval "repo = concat(env(OWNER),/,env(REPO))"
false
$ echo '{"repo": "plus3it/pyppyn", "env": ["OWNER=plus3it", "THIS_REPO=pyppyn"]}' | travis-conditions eval "repo = concat(env(OWNER),/,env(THIS_REPO))"
true

seems like a bug to me, but

if: branch = env(RELEASE_BRANCH) AND type != pull_request AND repo = concat(env(OWNER),/,env(THIS_REPO))

not evaluating to true inside your actual use case does not , because of the way THIS_REPO is defined (i.e., via interpretation that is only reliably possible at the build execution time (after we have had to decide whether or not this job should be included or not).

OH. That makes sense. Travis CI cannot see into the future??? :crystal_ball: