-
Notifications
You must be signed in to change notification settings - Fork 1k
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
(feat): Add prompt for overriding engine error in CRWA #6380
Conversation
I like it at the start. I feel that anything that's a potential blocker should be at the start. It makes no sense to answer a bunch of questions first, just to realize you can't install anyway 🙂 |
Just checking in with this one and whether you want to work through it to get it merged in the next week or if there are some bigger conversations happening about CRWA between core members? |
Thanks for the ping @ehowey. I'm sorry I didn't get to this today. It does look good, I just want to take it for a spin locally. And then I'll talk to @thedavidprice about that documentation we wanted to connect to this |
Okay sounds good - maybe also start needing to bike shed the possibility to skip these checks in a CI env. |
So this is what I see when I try it (just for reference for everyone else) In addition to the red text you already have there, how about adding (also in red) I like the orange link, but it would be even better if it was a clickable link, do you think you can change that? (we use the |
I'm going to be stalled out on making that change for a few days Tobbe - sorry! I should be able to get to it early next week. |
No need to be sorry. Take the time you need 🙂 |
Hey we recently switched the CRWA from listr to listr2. This might make things a little easier here give that listr2 has nice support for prompting (listr2 user input docs). Prompting from within tasks is now easy so you won't be forced to, although you still can if you want, prompt before listr runs. Also don't worry I've found the changes needed for the listr to listr2 update to be minimal. |
Just a note to say I merged those changes and did the minor migration to using the In terms of Listr2 and prompting the user, that is good news. But probably a bigger conversation for the core team because of the required switch from |
@ehowey enquirer is a lot smaller and faster and is what Nx uses, so we're down to switch it out. It's used in quite a few tooling-related parts of the codebase (e.g. the release script) so I'll go ahead and make the switch! |
Are you just going to push against this PR or a separate PR for the switch to enquirer and then I can update this PR afterwards? |
@ehowey separate PR! And I can update your changes here for you unless you'd like to handle it? (I just feel bad introducing merge conflicts, those are never fun.) |
I don't mind handling it. It might open the opportunity for a mini-refactor as enquirer + Listr2 allows for prompts to be handled within Listr itself versus separated out as I have them now. I'm thinking that this will be helpful for any future prompts the team wants to add and a better code pattern long term. |
Closing in favor of #6723 |
Related to #3989
This adds a prompt to continue through any engine errors/warnings in the install process. It also moves the engine checks to the very start of the install process.
Because of how ListR renders I had to make the decision to move the engine check higher up in the process in its own task separate from the main install tasks. It wasn't possible to insert a prompt in the middle of ListR tasks, at least none of the ways I tried would actually render properly in the terminal. I actually like having the engine checks at the start - if the tests pass I show a nice green check mark and all continues as normal. However if the test fails then you get an error message and a prompt asking you whether you want to continue with the install or not.
Some questions for discussion:
useState
so if there are code suggestions/format stuff feel free to shout them out. What I have here works, but maybe has some code smells?