Azure / InnovationEngine

An experiment in simplicity for complex environments
MIT License
30 stars 14 forks source link

Environment variable overrides not working #199

Closed rgardler-msft closed 2 weeks ago

rgardler-msft commented 3 weeks ago

https://github.com/Azure/InnovationEngine?tab=readme-ov-file#environment-variables states that "CLI argument variables override environment variables declared within the markdown document, which override preexisting environment variables."

Therefore, if I execute IE with the following I would expect the output of the below to be TESTING

ie execute LeaderBoard.md --var HASH_SUFFIX=TESTING

File content

# Basic setup

export HASH_SUFFIX=$(uuidgen | cut -c 1-8)
echo $HASH_SUFFIX

Example of output:

2. Basic setup

  ✔ export HASH_SUFFIX=$(uuidgen | cut -c 1-8)
    echo $HASH_SUFFIX

8c73b7ab
mbifeld commented 2 weeks ago

This is a bug. Tested locally and determined this bug relates to the in-script variable declaration being in $(). When replacing the code with export HASH_SUFFIX=hello, HASH_SUFFIX properly gets overridden with TESTING.

vmarcella commented 2 weeks ago

The regex that located variables to override in the scenario did not fare well with some complex variable declarations, like the one you've pointed out, and has been fixed in #202