You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Hackathon] fix(testlist): validate non-empty and non-whitespace IDs across testlist commands #381
The testlist command group (testlist get, testlist delete, testlist run, testlist add, testlist remove, and testlist update) does not validate that positional <list-id> and <test-id...> arguments are non-empty and non-whitespace before proceeding.
When a positional argument is whitespace (e.g. testsprite testlist get " " or testsprite testlist run "$LIST_ID" where $LIST_ID is unpopulated or whitespace):
Under --dry-run: The CLI immediately prints canned success samples (ID: tl_dryrun, Deleted test list , or dry-run: no runs dispatched) and exits 0, giving a false-pass signal on invalid input.
In live mode: The CLI interpolates the unvalidated whitespace into the REST endpoint path (e.g. /testlist/%20%20%20/cases or /testlist/%20%20%20), leaking raw server 400/404 responses or timeout errors instead of failing fast locally with a typed VALIDATION_ERROR (exit 5).
In mutateCases (testlist add / testlist remove): While opts.testIds.length === 0 is checked, passing whitespace elements ([" "]) bypasses the length check and reaches the API.
In contrast, sibling commands such as test delete, project delete, and test update validate positional IDs up front and throw VALIDATION_ERROR (<flag> is required, exit 5).
Details / implementation notes
Proposed Solution:
Add helper assertValidListId in src/commands/testlist.ts throwing typed localValidationError('list-id', 'is required and must not be empty or whitespace-only', undefined, 'field') (exit code 5).
Validate listId at entry in runTestlistGet, runTestlistDelete, runTestlistUpdate, runTestlistRun, and mutateCases.
In mutateCases, validate that each element in opts.testIds is non-empty and non-whitespace.
In validateTestlistRunOptions, validate that each --case element is non-empty and non-whitespace.
Add comprehensive unit test suite in src/commands/testlist.spec.ts asserting that empty and whitespace arguments throw VALIDATION_ERROR (exit 5) across both live and --dry-run modes.
Branch is ready with all tests passing locally.
Confirmations
I have searched existing issues and this is not a duplicate.
I have provided my Discord identity above for reward coordination.
Thanks for the interest, @naufalfx805-source! This issue hasn't been accepted for implementation yet — see the triage comment (a maintainer will label it accepted once it is). Feel free to check back, or ping us on Discord if it's been quiet.
Thanks for the interest, @naufalfx805-source! This issue hasn't been accepted for implementation yet — see the triage comment (a maintainer will label it accepted once it is). Feel free to check back, or ping us on Discord if it's been quiet.
Closing as a duplicate of #368. Its scope now covers empty and whitespace-only positional ids for every command in one change, including the commands listed here. Thanks for the report! If you'd like to work on it, comment /assign on #368.
Activity
naufalfx805-source commentedon Oct 12, 2026
/assign
testsprite-hob commentedon Oct 12, 2026
Thanks for the interest, @naufalfx805-source! This issue hasn't been accepted for implementation yet — see the triage comment (a maintainer will label it
acceptedonce it is). Feel free to check back, or ping us on Discord if it's been quiet.naufalfx805-source commentedon Oct 19, 2026
/assign
testsprite-hob commentedon Oct 19, 2026
Thanks for the interest, @naufalfx805-source! This issue hasn't been accepted for implementation yet — see the triage comment (a maintainer will label it
acceptedonce it is). Feel free to check back, or ping us on Discord if it's been quiet.ruili-testsprite commentedon Oct 20, 2026
Closing as a duplicate of #368. Its scope now covers empty and whitespace-only positional ids for every command in one change, including the commands listed here. Thanks for the report! If you'd like to work on it, comment
/assignon #368.