-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
exp init: create workspace structure by default, show workspace tree #7331
Conversation
50e1c0f
to
dc50914
Compare
We may want to reconsider the output for interactive mode now, especially for the one that shows workspace structure, since we create some of the files by default:
|
dc50914
to
7df1085
Compare
Looks good! Two issues to consider:
Maybe we can just make the output more general?
|
yeah, I was thinking of just doing that after #4112 as it'll be noop. But could do that now too, as |
For non-interactive mode, I'll just merge these into a single message:
|
Also, should the message be following?
|
I have decided to not create |
Do you mean for non-interactive mode, or am I misunderstanding? Also, I would just keep them separate unless you have a strong reason to merge them. I don't see an exact guideline for this, but I prefer a single piece of information per line. It keeps the clarity of whether each path is a file or directory, it's more consistent, and it's easier to parse.
I think "Using" is fine. |
Yeah sorry, I meant non-interactive mode.
Right, but is something being a file or a directory important information? It may cause visual noise without adding any meaningful information. I think that we created something is more important. This is what the current implementation displays: Creating data and src |
You could also address that in a separate PR first and come back to this if it's easier since it would make params have less special behavior that needs to be handled. I'm seeing inconsistent behavior when using flags with/without interactive mode: Example 1:
Example 2:
We spent a lot of time developing the interactive mode initially, but I think that led to problems with the non-interactive mode and now inconsistencies between them. Do we need such different implementations for interactive and non-interactive modes? I think it creates a more consistent UI and reduces the risk of bugs or odd behavior in either mode if we combine as much as possible. I would prefer a unified workflow like:
I know this is asking for large changes, but hopefully it will be simpler and raise fewer issues/questions once complete. Let me know if you want to have a call to discuss. |
This PR handles "all inputs are created", so this can already create params by empty. We just need to get rid of those checks that we have before. I don't want to make too many decisions or changes in a single PR. And I need this PR before we move to params, as it unifies input creations.
Great catch with the UI messages. The first one is an oversight on this PR. "no message" on overrides has been fixed, it'll be shown even in interactive and non-interactive mode. The params issue will be fixed after we remove the checks for params file existence.
This is something that will rarely be used. I prefer it as being an override, as ignoring them may be more confusing. Although I have no strong opinion.
Yeah, fixed this. Thanks.
Makes sense, but how should we improve message before the prompts in an interactive mode? |
00ac3fc
to
6ec7b7d
Compare
Yeah, I agree that ignoring the arguments is a bad option. I meant that It can also reduce some of the
IMO we can get rid of printing the tree before the prompts to simplify, especially if we are printing the updated tree at the end. I also think we can get rid of all the
Having a confirmation prompt in interactive mode after printing the tree seems okay if you think it's helpful to keep that, but I don't know that it's necessary. |
Right, but if you are using
I'll do this in the next PR.
Yeah, let's get rid of it then. Also in the next PR. Thanks. |
I am merging this PR. This is a
release-blocker
cc @efiop |
This PR creates the workspace structure by default. That means that the
code
paths anddata
paths are created if they don't exist. If the path has any extension, the empty file will be created, otherwise, a directory is created.Initially, this was to be created for the defaults only, but I have added the magic everywhere, so this is applied to passed arguments, defaults or config values too.
Second thing that PR adds is this output so that users are aware of the changes and their workspace structure:
Closes #7137, closes #7138 and closes #7139.