-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Grouped config commands better (closes #6911) #6983
Conversation
I think this is a good organization step to take but it worries me since it will literally break everyone's configuration. I'm not sure I'm prepared to answer 1000 questions of "what's wrong with my config". :) |
Agreed with @fdncred; this seems like a good change but breaking users is a concern. Some ideas off the top of my head:
|
I just said:
If you'll check the code, you'll see I didn't delete any of the old branches from config.rs Config::into_config() |
Also, can someone tell me why only the macos CI test suddenly doesn't work, and why it seems that the CI framework is injecting .DS_Store files into the test runner's directories:
|
There's a way to turn off .DS_Store files on MacOS, but I don't remember what it is. We should probably figure that out and put it in our CI I guess. It's weird though that it just started popping up. We've been building MacOS for years without issue. |
Ah, gotcha. I see it now, nicely done. After a quick skim your approach looks good to me, but I'll need to sit down and take a closer look at the extensive |
631079f
to
2562917
Compare
just for fun, I restarted the macOS test because the .ds_store problem doesn't show up anywhere else. I'm wondering if it was just some type of ci glitch. |
2562917
to
421060f
Compare
Looking at this again... I think it would make sense to split this into 2 PRs. The changes to |
I had to change rm's help docs because they referenced |
I'm also not a fan of changing the |
Well, alright. |
Thanks. I think this is looking good but let's wait until after next release (Nov 8) to merge it; that will give us 3 weeks to test it internally before we unleash it on users. |
Thinking about this again, this is going to make on-the-fly updates a bit different too. For instance, now to change the |
@fdncred This is wrong; this PR only changes how the config file is read; the actual structure of |
@webbedspace Correct me if I'm wrong, but you're saying this because all the entries are in this code twice now; like they were originally and how they are in your new grouped methodology. Is that right? So, I see things like So, at some point, when there is a breaking change, and only grouped config is available, my point above will be valid then. I realize I'm restating a lot but I'm trying to make sure I'm understanding everything. I'm really not sure how I feel about this being either a massive breaking change (bad for users) or duplicate values in the code (bad for developers). I think the core-team just needs to decide whether we're going to accept this or not. |
Your comment made me realise I'd had a slight misunderstanding. My apologies. I'd assumed that EngineState (in engine_state.rs) generated the Fortunately for me, this doesn't really change my point very much. The reality is the following:
This does mean something funny I hadn't noticed until now: mixing the old and new values (i.e. having I understand this sounds unseemly, but A) I don't believe mixing the two is even all that likely to occur in normal usage (people will either use one or the other), B) reading $env.config to query the system state is already very flimsy and brittle (one can just blow away $env.config altogether with
I tried to make it not actually that bad for developers: all of the "legacy" config position reads in |
So, um, it's been a week and a half… is this still OK to merge? |
@webbedspace Please remove the I'm personally still worried about unintended consequences. I know some people use the default_config.nu files and then source changes on top of them. I'm wondering how this behavior will work with this. Meaning, the default_config.nu is in the "new" format and their source blah blah changes are in the "old" format. I'm thinking this will break for them. I think @kubouch does something like this. Generally, I agree that people mostly will use one format or the other though. I'm also considering that maybe we want to have a deprecation message somewhere and say something like, "We have changed the format of the config.nu file. Please see nushell.sh/book/some/link. The "old" format will be deprecated in 0.80 and only the new format will work at that time.". Maybe not that verbose but you get the idea. I just don't like having two flavors for very long. |
I already reverted the |
@webbedspace what I'm talking about is removing all changes to |
Well, y'see, I need to change the line |
I'm sorry, you're right. Those changes are related I was missing those points. |
I added a deprecation warning message. It reads:
The URL is made up, for now. |
I quite like the new grouped config options. For me, it would mean I would need to reorganize my config a bit but that's life, we're still in pre-1.0 and the only thing that changes is the cell paths, not the values. The new deeply nested style would also play nicely with the new The important part for me is that both old and new styles are working for at least one release which already seems to be the case in this PR. In the deprecation message you don't need to tie it to 0.80. We could remove the old style as soon as 0.73. |
Well, I think the changeover couldn't hurt to get at least a couple months leeway. The support footprint in config.rs really isn't that invasive... |
Not sure we want to commit to a specific timeline just yet
Removed the v0.80 mention because I don't think we want to tie ourselves to a specific timeline for removal. Will merge when CI is green. Thanks for this change, it's a big+good one! |
Why am I getting this error if it's not a breaking change?
It kind of makes me wonder if any others were missed. |
Urgghh… my dignity… If that's the only error then that should be the only one missing (the "errors" in config.rs are actually just eprintln!s that don't even stop control flow). |
@fdncred @rgwood @webbedspace I saw this change did not reorganize |
I'll do it once I implement #7059. (Note: this comment is not legally binding.) |
I've been working an issue which is to re-assign During |
I'd like to share a little more details for this and some potetional changes we will make. JT created issue #7110 which expects ENV
We need to consider the mutation scenario when working on the next change :) And of course, there are two more issues causing #7110:
|
This is how I understand it "should" work - |
@webbedspace If you could tag me in your upcoming change, that would be great, we might be able to coordinate and test to get #7110 fixed together |
Description
config
: command-specific options could be grouped better #6911. The new structure of the default config is this:All old options' positions continue to be read as usual, and there are currently no deprecation warnings given.
Changes the default
always_trash
option totrue
because I feel it's a safer default for basic usage. (negotiable)Also tweaks the wording of
rm
's help in a few places.Tests + Formatting
Make sure you've done the following, if applicable:
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --check
to check standard code formatting (cargo fmt --all
applies these changes)cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect
to check that you're using the standard code stylecargo test --workspace --features=extra
to check that all tests passUser-Facing Changes
If you're making changes that will affect the user experience of Nushell (ex: adding/removing a command, changing an input/output type, adding a new flag):