Skip to content

[Improvement-18684][TaskPlugin] Trim whitespace in ShellParameters.checkParameters - #18685

Merged
SbloodyS merged 4 commits into
apache:devfrom
chovy-3012:Improvement-18684
Oct 12, 2026
Merged

SbloodyS merged 4 commits into
apache:devfrom
chovy-3012:Improvement-18684

Conversation

@chovy-3012

Copy link
Copy Markdown
Contributor

Was this PR generated or assisted by AI?

NO.

Purpose of the pull request

ShellParameters.checkParameters() only checks rawScript != null && !rawScript.isEmpty() without trimming. A whitespace-only script (e.g. " \n\t ") passes validation and creates a meaningless empty task.

Closes #18684

Brief change log

  • ShellParameters.java: checkParameters() use trim() to reject whitespace-only scripts
  • ShellParametersTest.java: Add 4 unit tests covering null, empty, valid, and whitespace-only scripts

Verify this pull request

This change added tests and can be verified as follows:

./mvnw test -pl dolphinscheduler-task-plugin/dolphinscheduler-task-shell

Pull Request Notice

Pull Request Notice

@SbloodyS SbloodyS added the improvement make more easy to user or prompt friendly label Oct 9, 2026
@SbloodyS SbloodyS added this to the 3.5.0 milestone Oct 9, 2026

@SbloodyS SbloodyS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@SbloodyS
SbloodyS merged commit 570aab8 into apache:dev Oct 12, 2026
133 of 142 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend improvement make more easy to user or prompt friendly ready-to-merge test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement][TaskPlugin] Reject whitespace-only scripts in ShellParameters.checkParameters

2 participants