Skip to content

test(cli): verify malformed CSV rejection before reporting - #2118

Merged
cristim merged 2 commits into
mainfrom
test/1944-csv-orchestration-regression
Sep 29, 2026
Merged

cristim merged 2 commits into
mainfrom
test/1944-csv-orchestration-regression

Conversation

@cristim

@cristim cristim commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Adds CSV orchestration regression coverage for the parser fix already merged in #2114 (issue #1944).

The new table drives runToolFromCSV with fractional, suffixed, negative, and overflowing counts, plus currency-suffixed savings. It verifies parsing fails with line/column context before a purchase report is written. Existing CSV fixture creation is reused. Production behavior is unchanged.

Verification:

  • Regression proof with the original production parser restored in an isolated clone: fractional/suffixed/negative counts and suffixed savings returned nil errors through orchestration; loader tests also exposed NaN/Inf acceptance. Twelve assertions failed on acceptance itself. Overflow is preservation coverage, not a newly rejected baseline case.
  • Go 1.26.6 full race suite passed before integrating main (407.588s). Targeted CSV loader/cap/orchestration race tests and build passed after integration; final follow-up tree is identical to that integrated tree.
  • Vet, module tidy check, golangci-lint v2.10.1, and normal pre-commit hooks passed.
  • Built CLI given Count 3.7 exited 1 with CSV line 2 / column 4 context and wrote no purchase report. No real purchases were made.
  • Independent GPT-6 Astra two-pass local review found no actionable findings. Exact final-SHA verification is tracked by the parent session; this is not an Opus review.

Summary by CodeRabbit

  • Bug Fixes
    • Malformed counts and savings in CSV input are now reported with the relevant column and line number, and no output report is created.

@cristim cristim added triaged Item has been triaged priority/p1 Next up; this sprint severity/medium Moderate harm urgency/this-sprint Within the current sprint impact/few Limited audience effort/s Hours type/bug Defect labels Sep 28, 2026
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: LeanerCloud/cloud-commitments-cli/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: 7fdc2a07-5b6b-44fa-91d5-8118a9d44c3e

📥 Commits

Reviewing files that changed from the base of the PR and between 0229b93 and 3fb7321.

📒 Files selected for processing (1)
  • cmd/multi_service_csv_strict_test.go

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

CSV tests now use a shared fixture writer. A new test checks that malformed count and savings values produce line-2 CSV errors and do not create an output report.

Changes

CSV test coverage

Layer / File(s) Summary
CSV fixtures and numeric validation
cmd/multi_service_csv_strict_test.go
Existing tests use writeTestRecommendationsCSV to create fixtures. New cases cover fractional, suffixed, negative, and overflowing counts, plus suffixed savings. They check the reported line and column and verify that no output report is created.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to 3fb73

The added CSV checks match the actual error format and cover malformed inputs before report generation. No concrete merge-blocking risk is evident from the supplied change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. 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 clearly and concisely describes the main change: adding CLI tests that verify malformed CSV input is rejected before report generation.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@cristim
cristim merged commit 6c44a78 into main Sep 29, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/few Limited audience priority/p1 Next up; this sprint severity/medium Moderate harm triaged Item has been triaged type/bug Defect urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant