Add a method isConnected to IComputer and provide implementation in Computer#10607
Add a method isConnected to IComputer and provide implementation in Computer#10607timja merged 24 commits intojenkinsci:masterfrom
Conversation
|
(actually I need to move this to draft - so to provide a default implementation thus not breaking any class that Edit: fixed now. |
… compatibility across different jenkins versions
|
Flakes are affecting the build,
I will check these flakes later, for now keeping the PR as it is without re-triggering another CI build |
|
I think we can add a Edit: PR is passing, so leaving it at here for this PR. |
|
some kind of compilation error (?) logI shall check in some hours Edit: should be fixed now - an import |
jglick
left a comment
There was a problem hiding this comment.
Code change and test look good. Minor comments about Javadoc.
Thank you. Fixed the javadocs, thanks for the comments. |
|
(flake 😢) |
|
various tests to be fixed 👀 failure list |
|
Tried running all the tests 10times, passed. |
|
https://github.com/jenkinsci/jenkins/runs/47909286867 already passed, so why fe240d4? |
MarkEWaite
left a comment
There was a problem hiding this comment.
This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback.
/label ready-for-merge
I thought all PRs needed syncing with master and passing CI before merging, in case of new test failures (though maybe not needed for this PR). |
All PRs need to pass CI before merging. This one already had, as of febf944. I am not aware of any requirement for the PR to be up to date with the base branch up to some specific duration, though of course if you filed in months ago it would be prudent to update it. (If core maintainers wished to err on the side of caution, we could set up a merge queue, though it would slow down integration and I think it would rarely catch any additional mistakes.) |
Adds a new method,
isConnected, to indicate whether an agent is actually connected to the controller.Currently,
isOnlinereturnsfalsewhen an agent is:The Javadoc for
isOnlineandisOfflinehas also been updated to clearly point out this behavior.Background
At CloudBees, we use
isOnlineandisOfflineto determine if an agent is connected to the controller. However, to distinguish between a temporarily offline agent and a disconnected one, we often needed to add explicit checks likeComputer#getChannel() != null.Introducing
isConnectedsimplifies this logic and makes it easier to understand the behavior ofisOnlineandisOffline, especially with the@seereference in their Javadoc.Testing done
Automated test
Proposed changelog entries
NA
Proposed changelog category
/label skip-changelog
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
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 (see query).