Skip to content
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

[#245] Return non-zero exit code in case of confirmation timeout #246

Merged

Conversation

rvem
Copy link
Member

@rvem rvem commented Dec 8, 2023

Problem: When profile activation confirmation fails due to
confirmation timeout and performs a rollback, zero exit code is
returned. Such a behavior is confusing since rollback usually means
something went wrong during deployment and it shouldn't return
successful exit code.

Solution: Explicitly return confirmation waiting error instead of
printing it and silently signaling success.

Resolves #245

@rvem rvem requested a review from PhilTaken December 8, 2023 13:31
@PhilTaken
Copy link
Collaborator

Upon closer look it appears that this change is limited to the remote side, the deploying host should receive the timeout reliably 🤔

@@ -464,7 +456,7 @@ pub async fn activate(
if magic_rollback && !boot {
info!("Magic rollback is enabled, setting up confirmation hook...");

match activation_confirmation(profile_path.clone(), temp_path, confirm_timeout, closure)
match activation_confirmation(temp_path, confirm_timeout, closure)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this block makes more sense as an if let

@rvem
Copy link
Member Author

rvem commented Dec 11, 2023

Upon closer look it appears that this change is limited to the remote side, the deploying host should receive the timeout reliably 🤔

AFAICS, the corresponding activate is invoked via ssh <target> activate-rs <options>, so activate is indeed run on the remote side but on the foreground of the ssh session

@PhilTaken
Copy link
Collaborator

right, and then the exit code is propagated through the connection. perfect then.

LGTM

Problem: When profile activation confirmation fails due to
confirmation timeout and performs a rollback, zero exit code is
returned. Such a behavior is confusing since rollback usually means
something went wrong during deployment and it shouldn't return
successful exit code.

Solution: Explicitly return confirmation waiting error instead of
printing it and silently signalizing success.
@rvem rvem force-pushed the rvem/#245-return-non-zero-exit-code-for-confirmation-timeout branch from 6e9f729 to b076e35 Compare December 11, 2023 13:43
@rvem rvem merged commit 514fa3b into master Dec 11, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

question: how to ensure non-0 exit code of rolled back deployment?
2 participants