Repository navigation
fix: enforce min/max bounds of 0 in duration flag @W-24935878@ - #755
Open
WillieRuemmele wants to merge 1 commit into
Open
WillieRuemmele wants to merge 1 commit into
WillieRuemmele wants to merge 1 commit into
Conversation
@W-24935878@
This branch has not been deployed
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.
What does this PR do?
Flags.durationvalidatedmin/maxwith truthiness checks, so a bound of0was silently ignored. Commands that declaremin: 0(e.g.sf org resume scratch,sf org resume sandbox,sf apex run test) accepted negative values such as--wait=-5.The checks now compare against
undefined, so:min: 0rejects negative values (DurationBoundsMin, orDurationBoundswhenmaxis also set)max: 0rejects positive values (DurationBoundsMax, orDurationBoundswhenminis also set){ min: 0, max: N }no longer falls through toDurationBoundsMaxfor out-of-range inputWhat issues does this PR fix or reference?
forcedotcom/cli#3689, @W-24935878@
Testing
Added unit tests for
min: 0,min: 0+max: 10, andmax: 0. The new tests fail without the fix and pass with it. Lint,tsc, and the full unit suite pass (175 tests).Behavior change
Commands that set
min: 0will now reject negative durations at flag-parse time instead of accepting them.