Skip to content

Reveal consumed positional when cluster name is missing#132

Merged
mason-sharp merged 1 commit into
mainfrom
fix/ACE-196/repset-diff-error-message
Jul 1, 2026
Merged

Reveal consumed positional when cluster name is missing#132
mason-sharp merged 1 commit into
mainfrom
fix/ACE-196/repset-diff-error-message

Conversation

@danolivo

@danolivo danolivo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Reveal consumed positional when cluster name is missing

Author: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 92af2aea-4f62-4475-a14d-436574698946

📥 Commits

Reviewing files that changed from the base of the PR and between 8dc2f4c and cc1cf68.

📒 Files selected for processing (2)
  • internal/cli/cli.go
  • internal/cli/cli_test.go

📝 Walkthrough

Walkthrough

The resolveClusterArg function now returns a more specific error when a positional argument is consumed as a required non-cluster argument (e.g., table or repset), leaving the cluster unset without a default configured. A corresponding test validates the new error message content.

Changes

Cluster Arg Error Clarification

Layer / File(s) Summary
Detailed consumed-argument error
internal/cli/cli.go
Adds a conditional branch when required arguments equal provided count and no default cluster exists, producing an error describing the consumed positional argument and suggesting explicit cluster passing or default_cluster configuration.
Test coverage for new error
internal/cli/cli_test.go
Imports strings and adds TestResolveClusterArgSinglePositionalRevealsConsumedArg to assert the error message names the consumed argument rather than implying it was ignored.

Poem

A rabbit hopped through cluster code,
Found an arg on the wrong road,
"You meant the repset, not the host!"
Now the error says it clear as toast. 🐇
Hop on, reviewers, the message glows!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.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
Title check ✅ Passed The title clearly matches the main change: improving the error when a positional argument is consumed and the cluster name is missing.
Description check ✅ Passed The description is related to the change, even though it repeats the title and adds no extra detail.
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.
✨ 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 fix/ACE-196/repset-diff-error-message

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.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@mason-sharp mason-sharp merged commit 7cf19eb into main Jul 1, 2026
3 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