[JENKINS-70059] Improve Safe Restart interface and user information - #7355
Conversation
…b.com/meiswjn/jenkins into feature/improve-safe-restart-messages
|
I relate to that description so much. When you have big instance (above 1K jobs), spam from users can be overwhelming. No matter what you say in communication channels, there will always somebody who will start screaming around in panic. |
…b.com/meiswjn/jenkins into feature/improve-safe-restart-messages
|
To test this locally, you will need a docker container. You can mount the war. Test it by running: Afterwards, attach to the container to get the password: |
daniel-beck
left a comment
There was a problem hiding this comment.
I like the idea of providing additional information during a restart a lot. And some UI that triggers safe restarts cannot easily be changed to have a custom message (e.g. the weird checkbox in the plugin manager/update center), so presenting it differently makes sense.
Some thoughts for your consideration:
- Not all Jenkins installations can self-restart, so there's no way for admins to get the "gentle" message at all, even if they're manually doing the same thing.
- The "gentle message" could just be a pre-determined custom message for the existing shutdown message.
- Then custom shut-down message could be passed to
HudsonIsRestartingand shown there. - It probably makes sense to make the existing "Jenkins is shutting down" message less panic-inducing, although we'll need to strike a balance to ensure it's still noticeable.
I think this would result in the same goals being met, while taking care of some configurations that might not be addressed by the current implementation.
Note that the above is preliminary feedback before I had an opportunity to run this, so may well be wrong. I would appreciate any corrections where I've misunderstood what this is doing.
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
|
Hi @daniel-beck, thanks for your feedback. A couple of questions for clarification:
With 'manually', do you mean prepareShutdown? For this, the default message has been changed as well and it can be customized completely now. Or do you mean the orange design?
With pre-determined, do you mean a general configuration option? I thought about this but think it would be more intuitive to just pre-fill the reason field and if it is empty, provide a default.
HudsonIsRestarting is rendered when the UI is actually no longer available. Usually the reason was not presented there but merely an information that Jenkins will be back. I think it might be impractical to show this message here, since the message during pre-restart may not be accurate during the restart itself. However, it would be possible to pass a boolean to determine if it should show the green safe restart box I guess.
I think this PR would fix this as well by allowing you to specify a custom message. There are a lot more ways, of course, but this would be a start. |
|
Hi @daniel-beck, Since you are so busy, would it make more sense to give this review to another member of the core team? Same with #6539. |
|
Hi @daniel-beck, |
|
@meiswjn No worries, I understand :) FWIW your other PR is still at the top of my list, but keeps getting pre-empted 😢 |
|
Perhaps @janfaracik could provide feedback on To me this just looks off. It reminds me of plugins like Ownership, that highlight their own content in a way that reduces consistency with the rest of the UI. Nit: When I initiate a safe restart, and then update the cause by going to the "Prepare for shutdown" form, the banner changes color. FWIW my feedback is (still) nonblocking. If there's enough approvals from others, this PR is free to be merged. |
|
Hey @daniel-beck, thanks for your feedback! I am not really able to think of a more Jenkins-ish way of displaying it, I am afraid. Since your feedback is non-blocking: Is it a bug on my side, or does the previous review from @NotMyFault still count towards the required reviewers? |
NotMyFault
left a comment
There was a problem hiding this comment.
Thank you so much for moving this forward!
If the review is still valid, isn't this PR ready to be merged because of the approvals of timja and NotMyFault?
I'd like to have @janfaracik take a look at the UI design and Daniel's comment above, if possible :)
|
@janfaracik Do you have a moment to comment on this PR? Would greatly appreciate it! |
|
LGTM. Agree with @daniel-beck about the green banner, IMO it draws too much attention - but not a blocker. On the 'Jenkins is restarting' screen the banner almost looks actionable/clickable, especially with the term 'Safe restart'? If the banner was replaced with some hint text, e.g. 'Jenkins is restarting. Builds can usually continue.' it'd be better. A user might not understand what a 'Safe restart' is. The booting/restart/error screens could do with taking a look at in general so I wouldn't block this PR going forward. |
Thanks for having a look!
Since the review is non-blocking and two core maintainers approved the PR: Would it be possible to merge this? |
|
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
|
I would like to withdraw the |
|
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
|
Congratulations on getting your very first Jenkins core pull request merged 🎉🥳 |
| <strong>${%Safe Restart}</strong> | ||
| </p> | ||
| <p> | ||
| ${%Builds on agents can usually continue.} |
There was a problem hiding this comment.
Is it worth pointing out that this applies only to Pipeline builds, not to other project types?
There was a problem hiding this comment.
Good idea!
"Pipeline builds on agents can usually continue."
What would you think about that?



This PR aims to decrease user panic when a safe restart is performed.
See JENKINS-70059.
Testing done
Test it yourself
To test this locally, you will need a docker container. You can mount the war. Test it by running:
docker run -d --name jenkins -p 8080:8080 -v <path-to-your-war>/jenkins.war:/usr/share/jenkins/jenkins.war jenkins/jenkinsAfterwards, attach to the container to get the password:
docker exec -it jenkins /bin/bashTesting done by me
Testing was only done manually inside a Docker container. I tested prepareShutdown and safeRestart via the UI of the Jenkins controller. I also tested the safe-restart CLI command, which still works without any parameters.
Screenshots
Safe Restart UI
Before:After:
Jenkins Unavailable (After Safe Restart)
Before:After:

Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.evalto ease future introduction of Content Security Policy (CSP) directives (see documentation).Maintainer checklist
Before the changes are marked as
ready-for-merge:upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidateto be considered (see query).