Skip to content

Reinstall prompt tweaks #1268

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

Merged
merged 2 commits into from
Apr 12, 2025
Merged

Conversation

ckyrouac
Copy link
Collaborator

@ckyrouac ckyrouac commented Apr 11, 2025

See commit messages, just some prompt tweaks to clarify usage of system-reinstall-bootc.

Closes: #1269

@github-actions github-actions bot added the area/system-reinstall-bootc Issues related to system-reinstall-botoc label Apr 11, 2025
@ckyrouac ckyrouac requested review from Copilot and cgwalters April 11, 2025 16:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

system-reinstall-bootc/src/prompt.rs:31

  • [nitpick] The prompt message may be ambiguous if multiple keys are possible. Consider clarifying whether this message applies solely when a single key is imported or if it also applies when multiple keys are selected.
This is the key that will be used to access the bootc system.

system-reinstall-bootc/src/prompt.rs:31

  • [nitpick] Since the multi-select prompt allows for choosing several keys, this singular phrasing may confuse users. It might help to adjust the wording to clarify how the selected key is used or if only one can be effective.
This is the key that will be used to access the bootc system.

Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking really, OK to merge as is

@@ -52,6 +52,9 @@ fn run() -> Result<()> {
.run_with_cmd_context()
.context("running reinstall command")?;

println!();
println!("Reboot to start using the bootc image");
Copy link
Collaborator

@cgwalters cgwalters Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking about this more...I wonder if we should instead default to rebooting, with the option to press e.g. ctrl-c/escape to exit?

We already prompt them in temporary_developer_protection_prompt "hey this will replace your system" earlier so I think we could actually change it to say...

diff --git i/system-reinstall-bootc/src/prompt.rs w/system-reinstall-bootc/src/prompt.rs
index 6308450a..ec73ae85 100644
--- i/system-reinstall-bootc/src/prompt.rs
+++ w/system-reinstall-bootc/src/prompt.rs
@@ -44,7 +44,7 @@ pub(crate) fn temporary_developer_protection_prompt() -> Result<()> {
     // Print an empty line so that the warning stands out from the rest of the output
     println!();
 
-    let prompt = "THIS WILL REINSTALL YOUR SYSTEM! Are you sure you want to continue?";
+    let prompt = "NOTICE: This will replace the installed operating system and reboot. Are you sure you want to continue?";
     let answer = ask_yes_no(prompt, false)?;
 
     if !answer {

And then here at the end we have a timer like:

Operation complete, rebooting in {n} seconds. Press Ctrl-C to cancel reboot, any other key to continue immediately.

With a value of n=10 perhaps?

@@ -9,7 +9,8 @@ fn prompt_single_user(user: &crate::users::UserKeys) -> Result<Vec<&crate::users
let prompt = indoc::formatdoc! {
"Found only one user ({user}) with {num_keys} SSH authorized keys.
Would you like to import its SSH authorized keys
into the root user on the new bootc system?",
into the root user on the new bootc system?
This is the key that will be used to access the bootc system.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bootc system" stutters here. I wonder if we even need to clarify "bootc" system in this context, I think it's implicitly understood. Maybe:

Would you like to copy the SSH authorized keys for the root user on the new system? Then you can log in as root@ using those keys.

@ckyrouac ckyrouac force-pushed the reinstall-prompt-tweaks branch from 7ea1880 to 6c217e5 Compare April 11, 2025 19:09
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
Trying to make the purpose of selecting a user more clear.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
@ckyrouac ckyrouac force-pushed the reinstall-prompt-tweaks branch from 6c217e5 to d457c25 Compare April 11, 2025 19:28
@cgwalters
Copy link
Collaborator

We were playing with this but it isn't quite right

+pub(crate) async fn reboot() -> Result<()> {
+    let delay_seconds = 10;
+    println!(
+        "Operation complete, rebooting in {delay_seconds} seconds. Press Ctrl-C to cancel reboot, or press enter to continue immediately.",
+    );
+
+    let event = crossterm::event::EventStream::new();
+    tokio::pin!(event);
+    let event = event.next();
+    let timeout = tokio::time::timeout(Duration::from_secs(delay_seconds), event);
+    timeout.await?;
+    Ok(())
+}
+

@cgwalters
Copy link
Collaborator

quay.io bad gateway is ruining our CI 😦

@cgwalters cgwalters merged commit f465f1c into bootc-dev:main Apr 12, 2025
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/system-reinstall-bootc Issues related to system-reinstall-botoc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

system-reinstall-boot: Add prompt for reboot post command
2 participants