fix(products): stop enforcing store rules the server owns - #165
fix(products): stop enforcing store rules the server owns#165joshdholtz wants to merge 7 commits into
Conversation
58c8918 to
c56c587
Compare
There was a problem hiding this comment.
Pull request overview
This PR adjusts the CLI’s handling of store-specific “rules” (product creation/store-state eligibility) to avoid hard client-side blocks that can go stale as the server enables new capabilities, and instead defers final validation to the API while emitting warnings on stderr (including in --json mode).
Changes:
- Replace several client-side hard errors with
AlwaysWarnwarnings so requests still reach the server for authoritative validation. - Add/update tests to assert unknown store/type combinations and Web Billing product creates warn but still post to the create endpoint.
- Add guidance hints for users when the operation is likely to be rejected server-side.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/cli/products.go | Converts Web Billing and unknown store/type client-side blocks into warnings while still posting creates. |
| internal/cli/products_store.go | Changes store-state app-type validation from hard-stop to warning + hint, allowing server-side decision. |
| internal/cli/products_create_test.go | Updates tests/helpers to capture stderr and assert warnings occur without preventing requests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The CLI hard-blocked product creates on Web Billing apps, rejected store/type combinations it didn't know, and refused store-state commands on non-Apple/Play apps. Those rules live server-side and change as stores are ungated, so the CLI now sends the request and lets the server's own error answer — the per-store type lists remain only to drive the interactive picker. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
c56c587 to
e225711
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e225711. Configure here.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…pports The CSV/JSON parsers and the interactive flow only allowed app_store and play_store, but plans also create and price Web Billing and Test Store products — the interactive path even coerced other app types to app_store. The store field now mirrors the app or input verbatim; the server owns the supported set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…icing for internal stores Help no longer teaches the removed store rules (rc schema feeds it to agents verbatim); a failed Web Billing create points at store-state plans; --duration ignored by the server is reported instead of silent; rc_billing and test_store desired states price via currency_prices from the CSV and interactive inputs; --equalize-base-territory only touches App Store states; Play-Store CSV shaping no longer runs for other stores. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The territory column/answer picks territory_prices vs currency_prices; currencyPricedStore survives only as an interactive-form hint. A future currency-priced store works without a CLI change, and the CSV no longer rejects territory input the server should rule on. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…le check Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

The CLI was enforcing store rules it doesn't own — and they were already stale (the API creates and prices Web Billing and Test Store products; the CLI still said no). Now the server is the only authority. Three changes:
rc products createstops pre-blocking. Requests go through and the server's error answers, with a hint to what works today:rc products storeaccepts every store the plans API supports. No more Apple/Play-only gate, and the interactive flow uses the app's real store type instead of coercing everything toapp_store.Prices land in the shape the input implies, not what a store list dictates. A territory means
territory_prices; no territory meanscurrency_prices(how Web Billing and Test Store price — territory prices sent to them were silently ignored before). No hardcoded store list to go stale when the next store is ungated.The only client-side errors left are structural — the payload can't be built without the field — and they carry CSV line numbers. Per-store type lists survive only in help text and the interactive picker.
🤖 Generated with Claude Code