Skip to content

fix(schedule): reject empty --name on update, matching create - #414

Open
892041548 wants to merge 1 commit into
TestSprite:mainfrom
892041548:fix/schedule-name
Open

892041548 wants to merge 1 commit into
TestSprite:mainfrom
892041548:fix/schedule-name

Conversation

@892041548

@892041548 892041548 commented Oct 16, 2026 •

Copy link
Copy Markdown

Season 4 CLI Improvement Bonus

  • I'm entering this PR for the Season 4 CLI Improvement Bonus
  • Discord username: @zzzzzy

What's broken (Closes #411)

schedule update --name "" bypasses the empty-name guard that schedule create enforces, sending an empty name to the server (same class as #363 for --cron).

How you found it

Differential probing of create vs update validation for the same flags.

Why it matters

An empty schedule name is never intentional; failing fast with exit 5 and a clear message beats a confusing server round-trip or a silently blank-named schedule. Complements PR #371 (which guards --cron in the same runUpdate); --name verified still unguarded on main as of 2026-10-15.

Tests

  • 2 new tests in src/commands/schedule.test.ts (empty and whitespace-only --name rejected, no network call made)
  • schedule.test.ts: 20 passed; tsc --noEmit clean; eslint 0 errors

Summary by CodeRabbit

  • Bug Fixes
    • Schedule updates now reject names that are empty or contain only whitespace, with validation guidance shown before any request is sent. Non-empty names are preserved as entered.

@github-actions

Copy link
Copy Markdown

Thanks for the PR, @892041548! It links an issue, but that issue isn't assigned to you yet: #411 (unassigned). Per our workflow, claim the issue first by commenting /assign on it (the triage bot assigns you automatically). If it's already assigned to someone else, please coordinate with them or pick another issue — unclaimed-issue PRs are not reviewed. After fixing it, edit the PR description or push a commit to re-run this check. See CONTRIBUTING → Contribution model.

@github-actions github-actions Bot added the needs-issue PR not linked to an issue yet — please open one first and claim it (see CONTRIBUTING) label Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: TestSprite/testsprite-cli/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ed1c2de-d19d-4b0e-97de-59f54a03c7e0
📥 Commits

Reviewing files that changed from the base of the PR and between 988c035 and 89d9cc2.

📒 Files selected for processing: 2
  • src/commands/schedule.test.ts
  • src/commands/schedule.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

Walkthrough

runUpdate now rejects schedule names that are empty or contain only whitespace before it builds the update request. Tests verify the validation error, exit code, guidance for whitespace-only input, and that no fetch call occurs.

Changes

Schedule update name validation

Layer / File(s) Summary
Validate update names
src/commands/schedule.ts, src/commands/schedule.test.ts
runUpdate rejects names that contain only whitespace. Tests verify the validation result and confirm that the command does not call fetch for empty or whitespace-only names.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 89d9c

The update command now rejects empty or whitespace-only names before making a request. No remaining behavior issue blocks merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: rejecting empty --name values for schedule update to match schedule create.
Linked Issues check Passed Issue #411 requires schedule update to reject empty and whitespace-only --name values before building the request body. runUpdate now trims the supplied name and rejects an empty result. The tes…
Out of Scope Changes check Passed The changes are limited to runUpdate validation in src/commands/schedule.ts and focused tests in src/commands/schedule.test.ts. These tests support issue #411. No unrelated behavior or files are…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Full details: Linked Issues check

Explanation

Issue #411 requires schedule update to reject empty and whitespace-only --name values before building the request body. runUpdate now trims the supplied name and rejects an empty result. The tests verify VALIDATION_ERROR, exit code 5, expected guidance, and no fetch call. Non-empty names remain unchanged.

Full details: Out of Scope Changes check

Explanation

The changes are limited to runUpdate validation in src/commands/schedule.ts and focused tests in src/commands/schedule.test.ts. These tests support issue #411. No unrelated behavior or files are identified.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🏆 Season 4 CLI Improvement Bonus: entry recorded. Thanks, @892041548!

To be counted, this PR needs the following by Oct 29, 11:59 PM PT:

  • ⬜ A linked issue assigned to you: the issue this PR links isn't assigned to you yet. Claim it by commenting /assign on it.
  • ✅ Out of draft.
  • ✅ A Discord username in the description.

Rewards go to merged PRs judged a genuine improvement, and up to three bonus-eligible PRs count per person. Untick the box to withdraw the entry. This comment refreshes when you edit the PR. Full rules.

@github-actions github-actions Bot added the s4-cli-bonus Entered for the Season 4 CLI Improvement Bonus label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-issue PR not linked to an issue yet — please open one first and claim it (see CONTRIBUTING) s4-cli-bonus Entered for the Season 4 CLI Improvement Bonus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Hackathon] fix(schedule): update --name "" bypasses the empty-name guard enforced by create

1 participant