Skip to content

JENKINS-59781 Handle partial SSH output without trailing newlines#176

Merged
nrayapati merged 2 commits into
masterfrom
JENKINS-59781
Dec 17, 2025
Merged

JENKINS-59781 Handle partial SSH output without trailing newlines#176
nrayapati merged 2 commits into
masterfrom
JENKINS-59781

Conversation

@nrayapati
Copy link
Copy Markdown
Member

Adds handling for partial output from standard output and error streams to ensure command output is not truncated when commands exit without trailing newlines. This improves logging completeness for SSH command execution.

Description

See JENKINS-59781.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description.
  • Appropriate unit or acceptance tests or explanation to why this change has no tests.
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

  • Run the changes and verified the change matches the issue description.
  • Reviewed the code.
  • Verified that the appropriate tests have been written or valid explanation given.
  • If applicable, test installing this plugin on the Jenkins instance.

Adds handling for partial output from standard output and error streams to ensure command output is not truncated when commands exit without trailing newlines. This improves logging completeness for SSH command execution.
@nrayapati nrayapati changed the title Handle partial SSH output without trailing newlines JENKINS-59781 Handle partial SSH output without trailing newlines Dec 16, 2025
@nrayapati nrayapati added the enhancement New feature or request label Dec 17, 2025
@nrayapati nrayapati requested a review from Copilot December 17, 2025 16:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses JENKINS-59781 by adding support for capturing partial SSH command output that lacks trailing newlines. The change prevents command output from being truncated when SSH commands exit without properly terminated lines.

Key Changes:

  • Adds when(partial:) event handlers for both stdout and stderr streams to capture incomplete lines
  • Includes trim() and empty checks to avoid logging whitespace-only output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/groovy/org/jenkinsci/plugins/sshsteps/SSHService.groovy Outdated
Comment thread src/main/groovy/org/jenkinsci/plugins/sshsteps/SSHService.groovy Outdated
Comment thread src/main/groovy/org/jenkinsci/plugins/sshsteps/SSHService.groovy Outdated
Comment thread src/main/groovy/org/jenkinsci/plugins/sshsteps/SSHService.groovy Outdated
Comment thread src/main/groovy/org/jenkinsci/plugins/sshsteps/SSHService.groovy Outdated
Comment thread src/main/groovy/org/jenkinsci/plugins/sshsteps/SSHService.groovy Outdated
@nrayapati nrayapati merged commit 8f758c7 into master Dec 17, 2025
15 checks passed
@nrayapati nrayapati deleted the JENKINS-59781 branch December 17, 2025 19:35
@long76
Copy link
Copy Markdown

long76 commented Dec 24, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants