Skip to content

fail on an unreadable or unparsable env file - #373

Merged
umputun merged 2 commits into
masterfrom
env-file-parse-error
Oct 27, 2026
Merged

umputun merged 2 commits into
masterfrom
env-file-parse-error

Conversation

@umputun

@umputun umputun commented Oct 27, 2026

Copy link
Copy Markdown
Owner

envVars skipped the env file on any open error and only logged a warning when the file could not be parsed. A typo or a permission problem in env.yml ran the playbook with empty values for every var from the file.

now any parse error, and any open error other than a missing file, stops the run with a message naming the file. A missing env file is still skipped, and an empty or comments-only file still means no vars.

envVars only logged a warning when the env file could not be parsed and the run went on
without any of its vars, so a typo in env.yml ran the playbook with empty values. A parse
error is now returned. A missing file is still skipped, and a file with no yaml document
(empty or comments only) still counts as no vars.
envVars treated every os.Open error as a missing env file, so an env.yml that exists but
cannot be read (permission denied) was skipped without a log line and the playbook ran with
empty values. Only a file that does not exist is skipped now; any other open error is
returned. TestEnvVars also checks that both error messages name the env file.
Copilot AI balanced review requested due to automatic review settings October 27, 2026 16:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@umputun
umputun merged commit e0ca40f into master Oct 27, 2026
3 checks passed
@umputun
umputun deleted the env-file-parse-error branch October 27, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants