codecov-circleci-orb icon indicating copy to clipboard operation
codecov-circleci-orb copied to clipboard

Multiple flags lead to unexpected behavior

Open mblayman opened this issue 1 year ago • 0 comments

My team (from Included Health, a Codecov customer) has a couple of monorepos that need to upload coverage data.

The orb docs seem to indicate that we could associate multiple flags with a coverage file by using a comma separated list with no spaces (e.g., ui,chrome in the docs). The result of doing that lead to a joined flag that looked like:

image

Our config YAML looked like:

...
          flags: bundleapp,entityresolution,fhir_server,financialaccount_server,kafkatools_server
...

The orb says that flags is a string type so I attempted to switch to a string with some spacing like:

...
          flags: "bundleapp, entityresolution, fhir_server, financialaccount_server, kafkatools_server"
...

This version resulted in a parse error. /bin/bash: line 17: entityresolution: command not found

I took a closer look at the orb script and I'm not certain that the result would have worked anyway. The Codecov CLI uses the multiple argument for the -F flag definition on the CLI. The click docs show that the multiple option would expect to be used like -F flag_a -F flag_b. The orb script only uses a single -F that is prepended at the end of processing (i.e. -F flag_a,flag_b). I'm not sure that this would lead to a correct invocation of the upload CLI command (but I confuse I've not tested this. Perhaps click does some magic here).

For now, I've worked around this by calling the upload orb command once per flag, but this is less than ideal.

Thanks for providing the CircleCI orb. I hope this information helps to make improvements.

mblayman avatar Feb 21 '24 05:02 mblayman