Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: --env flag missing file/wrong syntax of file raises error #23915

Merged
merged 8 commits into from
May 27, 2024

Conversation

Hasan-Alrimawi
Copy link
Contributor

Enhanced warning message for --env flag with run and eval subcommands.

The commit is specifically made to address issue #23674 by improving the warning messages that appear when using the --env flag with run or eval subcommands in the following scenarios:

  1. Missing environment file.
  2. Incorrect syntax in the environment file content.

Changes made

  • Distinguishes between cases of missing environment file and wrong syntax in the environment file content.
  • Shows a concise warning message to convey the case/issue occurred.

Code changes & enhancements

  • Implemented a match statement to handle different types of errors received while getting and parsing the file content to display a concise warning message, rather than simple error check and then displaying the same warning message for whatever the type of error is.
  • Updated the related existing tests to reflect the new warning messages.
  • Added two test cases to cover the wrong environment file content syntax with both run and eval subcommands.

Impact
The use of --env flag with both run/eval would be more user-friendly as it gives a precise description of what is not right when using incorrectly.

If you could give it a look, @dsherret , I appreciate your feedback on these changes.

@CLAassistant
Copy link

CLAassistant commented May 21, 2024

CLA assistant check
All committers have signed the CLA.

@bartlomieju bartlomieju added this to the 1.44 milestone May 22, 2024
@bartlomieju bartlomieju changed the title Solved --env flag missing file/wrong syntax of file content issue fix: Solved --env flag missing file/wrong syntax of file content issue May 22, 2024
@bartlomieju bartlomieju changed the title fix: Solved --env flag missing file/wrong syntax of file content issue fix: --env flag missing file/wrong syntax of file raises error May 22, 2024
@Hasan-Alrimawi
Copy link
Contributor Author

@bartlomieju
Could you please take a look in order to merge the changes if everything is good? All checks have passed.

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.

5 participants