Ensure applying configuration as code retains the offline cause of agents#26749
Conversation
When configuring agents with configuration as code the offline cause is not maintained in the yaml. So the offline cause is lost when reapplying casc or restarting Jenkins. This change retains the offline cause in those cases.
|
Technically this is a change in behaviour. Maybe some users assume that after a restart of Jenkins all agents (configured with casc) that have been taken offline temporarily are back online. |
However, there are also users (like me) who expect agents that have been temporarily taken offline to remain offline even after a restart. |
I just wanted to add more about expected behavior in my org :) |
|
Sure we need this fix. Question is if we should have some kind of property that one can set to keep the old behaviour |
I don't see why people would want agents they marked as offline to come back up on a restart / reload. I'd leave it for now. |
MarkEWaite
left a comment
There was a problem hiding this comment.
Thanks! This fixes an issue that I recently encountered in my test environment. I needed an agent offline due to misconfiguration and then restarted the controller and was surprised that the agent was online again.
|
This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process. /label ready-for-merge |
|
@MarkEWaite @mawinter69 @timja |
I don't expect it to arrive in 2.555.2. We generally wait for the fix to be included in a weekly release before we include it in an LTS. The 2.555.2 LTS will release next Wednesday and the earliest this could arrive in a weekly release is next Tuesday. We can consider it as a backport candidate for 2.555.3. It helps the backport decision process if we know that this is a regression and the Jenkins release that first introduced the regression. |
|
I think the issue was introduced with #9855 that reworked the temp offline handling in Computer and Node. That was first shipped in LTS 2.492.1 |
…ents (jenkinsci#26749) (cherry picked from commit fea6278)
When configuring agents with configuration as code the offline cause is not maintained in the yaml. So the offline cause is lost when reapplying casc or restarting Jenkins.
This change retains the offline cause in those cases.
Fixes #26750
Testing done
Added a unit test that fails without and succeeds with this change
Screenshots (UI changes only)
Before
After
Proposed changelog entries
Proposed changelog category
/label bug,regression-fix
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).Desired reviewers
@mention
Before the changes are marked as
ready-for-merge:Maintainer checklist
upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidateto be considered.