environment var matrix defined in UI ignored when appveyor.yml used

Dale Phurrough's Avatar

Dale Phurrough

07 Jul, 2019 06:48 PM

Hi. I've isolated what I think is an errant behavior with the handling of matrix environment variables defined in the UI when coexisting with appveyor.yml. I request insight from the support team or other community members.

According to https://www.appveyor.com/docs/build-configuration/#appveyoryml-and-...

Environment variables. Variables defined on UI are getting merged with those ones defined in appveyor.yml. Variable values with the same names are getting overridden with values from UI.

In my experience this is not true. Instead, matrix environment variables defined in the UI are ignored if an appveyor.yml is used. Please notice the distinction between the following two. The first is failing. The second works as documented.

  • "matrix environment variables" aka "environment variable build matrix group"
  • plain build environment variables

My intention is to have the majority of settings in appveyor.yml. My appveyor.yml I use in three different AppVeyor projects. Each of the three projects has a different set of values for a single environment variable. For example:
environment variable name is "DIST"

project1 has a matrix of 3 values for DIST: 14, 85, 22
project2 has a matrix of 7 values for DIST: 1,2,3,4,5,6,7
project3 has a matrix of 14 values for DIST: 1,2,3,4,5,6,7,8,9,10,11,12,13,14

This approach allows simple setup and configuration of any number of CI projects all using the same appveyor.yml. Only the values of DIST need to change. Values of DIST can be added/removed from the set of values within any project. And for each value of DIST in a project's build, there is one job. Therefore with the examples above, a build for project2 has 7 sub-jobs.

Previously, I defined everything in the UI and it worked as I expected. When I moved to using an appveyor.yml except for the matrix of environment variables I need, the errant behavior started. When I start a build, it has only one job. There are no multiple jobs in the build -- one for each matrix environment variable value defined in the UI.

When I call the https://ci.appveyor.com/api/projects/account/projectslug/settings API, I see environmentVariables and environmentVariablesMatrix that are defined in the UI. This is good. It does not show any values of environment variables that are in the appveyor.yml. This is limiting, but not unexpected.

When I call the https://ci.appveyor.com/api/projects/account/projectslug/settings/e..., I see only the environment variables defined in the UI...the same values as in environmentVariables above. I DO NOT see the matrix of environment variables which was seen above in environmentVariablesMatrix. THIS IS UNEXPECTED.

What does the support team think about this scenario? I did not find another post like this, nor examples in the docs like it.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 08 Jul, 2019 05:39 PM

    Ilya Finkelshteyn's Avatar

    Hi Dale.

    Sorry for the confusion. You are right, only "plain" variables are getting merged. Matrix settings from UI are not respected in can you use appveyor.yml. I believe that in your case you need to have a separate appveyor.yml for each project, even if this means some duplication.

    Ilya.

  2. 2 Posted by Dale Phurrough on 09 Jul, 2019 01:41 PM

    Dale Phurrough's Avatar

    :-/ OK. Then its a lack of a feature. An opportunity for the AppVeyor team to enable "environment variable build matrix group" merging. As a focus group of one ;-), I would prefer blind concatenation. The list of matrix variables defined in one or both are concatenated together to create the matrix variable dimension. Which means if the same var with the same value is defined in both places (UI, yml), then it will be twice in the final matrix list.

  3. Support Staff 3 Posted by Ilya Finkelshte... on 09 Jul, 2019 04:57 PM

    Ilya Finkelshteyn's Avatar

    There is more general issue, which will help in this case too https://github.com/appveyor/ci/issues/1068. Its a shame it is still not implemented. It is because now we are fully concentrated on implementing various heterogeneous scenarios including on-premise and "bring your own infrastructure" solutions and more operating systems. I hope we will come back to this feature this (calendar) year.

  4. 4 Posted by Dale Phurrough on 10 Jul, 2019 03:50 PM

    Dale Phurrough's Avatar

    As helpful feedback :-) , I don't see the global env variable idea you linked helping with my use case. I need to create multiple jobs based on a list of env variable values. The idea you link seems to only create global plain env variables. However, if it were expanded to create global matrix env variables, that would likely be undesired by a wide range of customers because then all projects on an account will now have the same matrix of jobs based on the global matrix env vars for all of them.

    The focus for my use case is creating/controlling the set of jobs in a project based on a list of environment variables defined at the project level...the matrix dimension on env variables. With this, each project will have only the sub-jobs necessary to meet the requirements.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac