OpenAstronomy/azure-pipelines-templates

Specifying libraries for a specific env seems broken.

Closed this issue · 3 comments

I think I came across this issue earlier. It's probably on this line:

- ${{ each tool_pair in coalesce(env['libraries'], parameters.libraries) }}:

The coalesce function only works with strings. If all the first arguments (i.e. env['libraries']) are null it'll just return the last one (i.e. parameters.libraries) without trying to convert it. So if libraries are set for the specific env, it'll try to cast it to a string and error because it can't.

It's been a while since I tried to debug this, so I can't really remember what's happening. Your reasoning sounds good, but I don't know what a fix would be without the deep dive down the docs.

I tried to make the caching config the same as the libraries config: https://github.com/OpenAstronomy/azure-pipelines-templates/blob/master/run-tox-env.yml#L113-L122

As I couldn't use the coalesce function I had to do branching. This leads to code duplication as you can see above, but the duplicate code can be moved into a separate template that only run-tox-env.yml would use. Shall I move the libraries section to a separate template and then do the if and elseif instead of the coalesce?