-
Notifications
You must be signed in to change notification settings - Fork 121
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
env variable lift order requirement. #688
env variable lift order requirement. #688
Conversation
I'd like to create some acceptance tests. How would I go about doing that? (I see that a lot of tests has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow! amazing job and super fast. love it.
gave few comments. i feel this might be a bit risky so lets see if we can try to minimize surprises to existing users.
@indietyp amazing work. i put some comments.
|
Codecov Report
@@ Coverage Diff @@
## master #688 +/- ##
==========================================
+ Coverage 93.62% 93.69% +0.07%
==========================================
Files 116 118 +2
Lines 22408 22619 +211
==========================================
+ Hits 20980 21194 +214
+ Misses 1428 1425 -3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I have reworked the section about env variables in the |
@indietyp i'll review it again once you resolve the conflicts. |
@indietyp insane work. it will take me time to review it properly. I need to understand everything you did there, since i saw logic to understand depends on per type and even for scripts added a new field. i'm for it, but it will just take me time to fully understand all changes there to ensure its ok. |
Yea, I totally get it, thanks for looking into it, I didn't know that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@indietyp it looks great.
I wrote few comments, mostly about the docs actually.
@indietyp there are some CI errors to look at. I really want to merge this into the new cargo-make version |
@sagiegurari same here, but I wanted to have some clarification: #688 (comment) and have been waiting for an answer. |
sorry missed it. |
@indietyp amazing work. only few small comments on the docs. so once done i'll merge it in. |
@sagiegurari what is the current status? |
@indietyp sorry for the delay, i was not available. i'll recheck it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the comments i put are minor and i can fix myself if you want.
but the biggest issue that i suddenly found (based on the docs you wrote) is that the support for ${env:default} is dropped?
we can't drop that as it will break peoples projects.
@@ -71,6 +71,8 @@ serde_ignored = "^0.1" | |||
serde_json = "^1" | |||
shell2batch = "^0.4.4" | |||
toml = "^0.5" | |||
petgraph = "0.6.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please sort crates and add ^ (i know its by default like that, but its more readable coming from other platforms).
|
||
> **Note:** The `$variable` syntax is currently not supported! | ||
|
||
> **Note:** Extended interpolation like `${variable:-default}` is currently unsupported! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats not that good. we will break many makefiles that use this capability.
we can't push this PR with this backward break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't change anything, just documented the behavior, thought envmnt didn't support default values, will remove if it actually supports it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be that envmnt supports non-standard interpolation through: :default
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@indietyp you are right! it has been so long. envmnt actually supports it so i'll now add it to cargo-make.
so this can be ignored and i'll drop the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking of creating a new PR to add support for the full range of interpolation as per POSIX spec: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to envmnt? sounds good. let me check that link and we will limit it only to ${var} and not $var right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep correct!
|
||
* [Declaration](#env-declaration) | ||
* [Note about Ordering](#env-note-about-ordering) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels like this should come as last sub section and not second.
Env files can also be defined globally in the Makefile.toml via **env_files** attribute as follows: | ||
Paths to environment files can also be defined globally in the `env_files` key of the `Makefile.toml`, which will be loaded in the order they are defined. All relative paths are relative to the directory containing the `Makefile.toml` they were defined in. | ||
|
||
> **Note:** `env_files` can also be used on a task level. Be aware that relative paths will instead be relative **to the current working directory** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of
**to the current working directory**
change to
to the **current working directory**
@@ -24,6 +24,8 @@ | |||
* [Platform Override](#usage-platform-override) | |||
* [Extend Attribute](#usage-task-extend-attribute) | |||
* [Environment Variables](#usage-env) | |||
* [Declaration](#env-declaration) | |||
* [Note about Ordering](#env-note-about-ordering) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move as last sub section instead of second
@indietyp thanks a lot for the PR. I know it has been a long ride :) so sorry about that. |
This Pull Request adds the ability (when loading) to reorder the environment variables based on usage, removing the requirement that variables need to follow a specific definition order.
Even though this only does the reordering on
merge_env
.This change will always be applied because
merge_env
is called inmerge_base_config_and_external_config
.Closes #685