Skip to content

[RUN-356] Validate --test-cases bounds and reject empty values#67

Merged
lorenjphillips merged 1 commit into
mainfrom
loren/run-356-validate-test-cases-bounds
May 7, 2026
Merged

[RUN-356] Validate --test-cases bounds and reject empty values#67
lorenjphillips merged 1 commit into
mainfrom
loren/run-356-validate-test-cases-bounds

Conversation

@lorenjphillips
Copy link
Copy Markdown
Contributor

@lorenjphillips lorenjphillips commented May 7, 2026

Stacks on #66.

  • Reject empty tokens (--test-cases tc_1,,tc_2) via clap NonEmptyStringValueParser
  • Reject >100 values client-side with a clear message (mirrors backend Pydantic max_length=100)
  • Backend membership check (test_case_ids ⊆ test_set) already enforced in initialize_simulations.py:286-288 — no backend change

ID: 01999fb1-c0f6-7000-a5e7-stacked-on-66

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced validation for the test cases parameter to ensure 1–100 entries are provided during run creation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 903b97bf-7b89-4237-a2bf-cbe889400ea8

📥 Commits

Reviewing files that changed from the base of the PR and between 2edd8e6 and 511ef07.

📒 Files selected for processing (1)
  • src/commands/runs.rs

📝 Walkthrough

Walkthrough

This PR tightens validation for the --test-cases argument in CLI run creation. The argument parser now enforces non-empty values with NonEmptyStringValueParser, and the launch execution path adds a runtime check rejecting test case lists exceeding 100 entries. No public signatures are modified.

Changes

Test Case Validation Constraints

Layer / File(s) Summary
Argument Parser Configuration
src/commands/runs.rs
--test-cases argument switches to NonEmptyStringValueParser to enforce non-empty comma-delimited list input at parse time.
Launch Runtime Validation
src/commands/runs.rs
RunCommands::Launch execution adds explicit check rejecting --test-cases lists exceeding 100 entries via anyhow::bail!.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops with glee so bright,
To bound your tests—not quite so light!
Non-empty lists and counts that gleam,
One hundred strong, a bounded dream.
From empty void to max's height,
Validation dances, clean and tight! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: client-side validation for --test-cases that rejects empty values and enforces a 100-item maximum bound.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch loren/run-356-validate-test-cases-bounds

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

@lorenjphillips lorenjphillips changed the base branch from feat/launch-test-cases to main May 7, 2026 21:21
@lorenjphillips lorenjphillips force-pushed the loren/run-356-validate-test-cases-bounds branch from f2c87bd to 511ef07 Compare May 7, 2026 21:22
@lorenjphillips lorenjphillips merged commit cef8960 into main May 7, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants