Heyo, Been following the configuring pants for CI ...
# general
m
Heyo, Been following the configuring pants for CI docs, and have noticed with PANTS_CONFIG_FILES, Configuring the environment variable
PANTS_CONFIG_FILES=pants.ci.toml
which seems to implicitly be an additional to pants.toml However when configuring the environment variable with multiple files, eg
PANTS_CONFIG_FILES="['<http://pants.ci|pants.ci>.toml', '<http://pants.ci|pants.ci>.integration.test.toml']"
, it seems to no longer be implicitly be an additional to the pants.toml And needing to explicitly include pants.toml
PANTS_CONFIG_FILES="['pants.toml', '<http://pants.ci|pants.ci>.toml', '<http://pants.ci|pants.ci>.integration.test.toml']"
Question is, when using as a list, will I need to include all configs?
b
You can likely use something like
PANTS_CONFIG_FILES="+[...]"
with the
+
. See https://www.pantsbuild.org/2.19/docs/using-pants/key-concepts/options#list-values for more details, particularly the sections "Environment variables" and "Add/remove semantics"
m
Had been following https://www.pantsbuild.org/2.19/docs/using-pants/using-pants-in-ci#configuring-pants-for-ci-pantscitoml-optional and https://www.pantsbuild.org/2.19/reference/global-options#pants_config_files Just checking in if I'm using
PANTS_CONFIG_FILES
as a list, the expected behaviour is to include all config files, including
pants.toml
b
You don't need to, the
+
syntax allows explicitly appending.
m
I see, So
PANTS_CONFIG_FILES="+['<http://pants.ci|pants.ci>.toml', '<http://pants.ci|pants.ci>.integration.test.toml']"
is equal to
PANTS_CONFIG_FILES="['pants.toml', '<http://pants.ci|pants.ci>.toml', '<http://pants.ci|pants.ci>.integration.test.toml']"
c
running
pants global --help-advanced
shows all options, with default and current values, so you can verify actual outcome of your settings:
Copy code
--pants-config-files="['<str>', '<str>', ...]"
  PANTS_CONFIG_FILES
  pants_config_files
      default: [
          "/Users/x/proj/gh/pantsbuild/pants/pants.toml"
      ]
      current value: [
          "/Users/x/proj/gh/pantsbuild/pants/pants.toml"
      ]
      Paths to Pants config files. This may only be set through the environment variable `PANTS_CONFIG_FILES` and the command line argument `--pants-config-files`; it will be ignored if in a config file like
      `pants.toml`.
m
As there are environment variables used in pants.ci.toml, is there a way to view the settings without setting the environment variables?
c
No, pants chokes on incomplete/bad config.