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

Unexpected input can cause the release script to fail #7563

Closed
maximillianh opened this issue Nov 15, 2019 · 6 comments
Closed

Unexpected input can cause the release script to fail #7563

maximillianh opened this issue Nov 15, 2019 · 6 comments

Comments

@maximillianh
Copy link
Member

@maximillianh maximillianh commented Nov 15, 2019

The release script fails silently after any keyboard input from the user. The release script can fail silently when given unexpected input. This can potentially delay the release by hours.

@bmw bmw changed the title Any input causes the release script to fail Unexpected input can cause the release script to fail Nov 19, 2019
@bmw
Copy link
Member

@bmw bmw commented Nov 19, 2019

Moving this to 1.1 for now as I think this both should be fixed soon and shouldn't be too hard.

@bmw bmw added this to the 1.1.0 milestone Nov 19, 2019
@bmw bmw self-assigned this Dec 4, 2019
@bmw bmw added the easy-fix label Dec 4, 2019
@bmw
Copy link
Member

@bmw bmw commented Dec 17, 2019

I looked into this a bit and want to implement 2 things:

  1. Using trap, if the release script is about to exit with an error, print a warning message to the terminal.
  2. Remove all git diff calls in the release script. I initially just wanted to prevent this from exiting with an error, but I think doing that reliably in a way that still works if someone adds another call to git diff is a little difficult. Also, in the 4 years of releasing Certbot, I'm not aware of these calls ever being useful and the only keyboard input I'm aware of to make git diff exit with a nonzero status is to exit before scrolling to the end of the output.

What do you think @ohemorange? I wanted to get your +1 before spending time implementing this.

@bmw bmw modified the milestones: 1.1.0, 1.2.0 Jan 7, 2020
@ohemorange
Copy link
Contributor

@ohemorange ohemorange commented Jan 15, 2020

the only keyboard input I'm aware of to make git diff exit with a nonzero status is to exit before scrolling to the end of the output.

Are we sure that's what triggers the error? I'm having trouble finding where it says anything about this in the documentation; I was assuming it was an issue with taking input at the wrong point in time. Not that I have any issue with getting rid of the git diff calls; they're useful only when making updates to the release script itself.

Either way, I think using trap sounds promising. By "print a warning message to the terminal", I assume you meant "and don't exit immediately", or something? Because if it exits anyway, having a warning message printed isn't particularly helpful.

@bmw
Copy link
Member

@bmw bmw commented Jan 16, 2020

Are we sure that's what triggers the error?

I couldn't find much documentation on it, but I couldn't make it fail on any other keyboard input. git diff pipes the output to less by default. less doesn't even exit if you hit ctrl+c unless you pass -K.

Either way, I think using trap sounds promising. By "print a warning message to the terminal", I assume you meant "and don't exit immediately", or something? Because if it exits anyway, having a warning message printed isn't particularly helpful.

I am not aware of a way to catch an error at an arbitrary point in the script and then resume execution from that point unfortunately. Are you?

The idea here was just to print a loud warning like

******************************
*                            *
* THE RELEASE SCRIPT FAILED! *
*                            *
******************************

to make it clearer that it failed rather than perhaps not noticing and trying to continue with the release process.

If you don't think that's useful though I can leave it out.

@ohemorange
Copy link
Contributor

@ohemorange ohemorange commented Jan 17, 2020

I am not aware of a way to catch an error at an arbitrary point in the script and then resume execution from that point unfortunately. Are you?

I am not, but I was optimistically interpreting your comment to mean that you were, which I see now was the wrong choice (optimism).

Given that, a large message seems better than nothing. So overall, plan sgtm.

@bmw bmw added the has pr label Jan 17, 2020
@bmw bmw removed their assignment Jan 17, 2020
@bmw
Copy link
Member

@bmw bmw commented Jan 17, 2020

Unfortunately I don't think it's possible.

What I think we can easily do though is write better error handling in specific problem areas where the release script sometimes fails. With our current setup, I'm not aware of any after removing the calls to git diff, but if there are some, I personally think that it's worth doing and that it should be pretty easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.