Skip to content

fix(products): stop enforcing store rules the server owns - #165

Open
joshdholtz wants to merge 7 commits into
mainfrom
soften-store-hard-stops
Open

fix(products): stop enforcing store rules the server owns#165
joshdholtz wants to merge 7 commits into
mainfrom
soften-store-hard-stops

Conversation

@joshdholtz

@joshdholtz joshdholtz commented Sep 1, 2026

Copy link
Copy Markdown
Member

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 create stops pre-blocking. Requests go through and the server's error answers, with a hint to what works today:

$ rc products create --app-id app_webbilling --store-id premium --type subscription --title Premium
  Web Billing products are created through store-state plans:  rc products store sync app_webbilling
✗ authorization_error: Web Billing product creation is still not supported.

rc products store accepts 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 to app_store.

Prices land in the shape the input implies, not what a store list dictates. A territory means territory_prices; no territory means currency_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

Copilot AI lite review requested due to automatic review settings September 1, 2026 14:25
@joshdholtz
joshdholtz force-pushed the soften-store-hard-stops branch from 58c8918 to c56c587 Compare September 1, 2026 14:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AlwaysWarn warnings 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.

Comment thread internal/cli/products.go Outdated
Comment thread internal/cli/products.go Outdated
Comment thread internal/cli/products_store.go Outdated
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>
@joshdholtz
joshdholtz force-pushed the soften-store-hard-stops branch from c56c587 to e225711 Compare September 1, 2026 14:38

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread internal/cli/products_store.go
joshdholtz and others added 3 commits September 1, 2026 09:51
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>
@joshdholtz joshdholtz changed the title fix(products): warn instead of hard-stop on store rules the server owns fix(products): stop enforcing store rules the server owns Sep 1, 2026
joshdholtz and others added 3 commits September 1, 2026 10:56
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>
@joshdholtz
joshdholtz requested a review from a team September 1, 2026 20:10
@RPallas92
RPallas92 self-requested a review September 2, 2026 08:30
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.

3 participants