fix: normalize blank executable to null when loading legacy job configuration - #306
Merged
ogulcanaydogan merged 2 commits intoAug 18, 2026
Conversation
…guration Configurations saved through the web UI with a blank Executable field persist it as an empty string rather than omitting it, since f:textbox does not submit null for an empty text input. ExecRemoteAgent rejects any non-null value that is not a valid ssh-agent(.exe) path, so every build using such a job failed with IllegalArgumentException. Normalize blank input to null in three places: the ExecRemoteAgent constructor (runtime net), the SSHAgentBuildWrapper constructor (new saves), and readResolve() (already-persisted configs, since XStream sets fields directly and bypasses the constructor). Signed-off-by: Ogulcan Aydogan <[email protected]>
Confirm the blank-normalization added for jenkinsci#303 does not also affect a valid, non-blank executable path, and that an already-clean config survives readResolve() unchanged rather than being rewrapped. Signed-off-by: Ogulcan Aydogan <[email protected]>
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #303.
The "Executable" field's
f:textboxsubmits an empty string rather than omitting the element when left blank, so any job config saved through the web UI without filling that field persists<executable></executable>instead of no element at all.ExecRemoteAgentrejects any non-null value that is not a validssh-agent(.exe)path, so every build using such a job failed with:Same root cause pattern as #299/#300: a field introduced after some jobs were last saved deserializes or gets submitted as its "empty" value rather than being genuinely absent, and downstream code was not defensive about that empty value.
Normalizes blank input to
nullin three places, matching the #300 pattern:ExecRemoteAgent.toSSHAgentPath- treat a blank string the same asnull(runtime net)SSHAgentBuildWrapperconstructor - normalize on every new save going forwardSSHAgentBuildWrapper.readResolve()- migrate already-persisted configs, since XStream sets fields directly and bypasses the constructorAdded
SSHAgentBuildWrapperExecutableTestcovering: blank/whitespace/null input normalizes to null from the constructor, a legacy XML with<executable></executable>deserializes to null, a legacy XML with no<executable>element at all deserializes to null, a valid non-blank path is retained and trimmed, and an already-clean config survivesreadResolve()unchanged. Full suite green (50/50).