fix(products): use productAttributes for Merchant API v1 (was attributes)#89
Merged
Merged
Conversation
…tes) Merchant API v1 renamed the product attributes field from `attributes` to `productAttributes` (processed products and product inputs alike). gmc still sent/read `attributes`, so against the live API `products list`/`get` showed blank titles and `products insert` failed with `400 INVALID_ARGUMENT: Unknown name "attributes"`. This also affected `feeds`, `migrate products`, and `preflight --remote`. - Rename the field on Product/ProductInput and every read/write site (CLI renderers, toProductInput, feeds, preflight rules, migrate transform). - Fix ItemLevelIssue to the real v1 shape (severity / reportingContext / applicableCountries; drop v1beta servability / destination / attribute) and base the disapproval count on `severity === "DISAPPROVED"`. - Add a recorded-shape v1 contract test so a future field rename fails CI. - Correct the `gmc issues` severity docs (live value is ERROR). Promotions (its own attributes) and accounts (identity attributes) are unchanged. Verified against a live Merchant Center account: products list shows titles, insert succeeds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Critical fix found by the first live API test. Merchant API v1 renamed the product attributes field
attributes→productAttributes(for both processed products and product inputs). gmc still usedattributes, so against the live API:products list/getrendered blank titles, prices, and availability;products insertfailed outright with400 INVALID_ARGUMENT: Unknown name "attributes";feeds,migrate products, andpreflight --remotewere all affected.The whole test suite mocks
fetch, so nothing exercised a real response — the same blind spot that hid the v1beta shutdown.Changes
attributes→productAttributesonProduct/ProductInputand every consumer: CLI renderers,toProductInput, the preflight rules (_util/format/policy/required), and themigratetransform output. Suggestion strings + docs updated to match.ItemLevelIssue→ real v1 shape:severity/reportingContext/applicableCountries(dropping v1betaservability/destination/attribute); disapproval count now keys onseverity === "DISAPPROVED".api/tests/products.test.ts): a recorded-shape v1 product response that locks the field names at compile + runtime, so a future rename fails CI instead of shipping silently.gmc issuesseverity doc fix: the liverenderaccountissuesvalue isERROR, not the v1betaDISAPPROVED/DEMOTED/NOT_IMPACTED.Promotions (its own
attributes) and accounts (identity attributes) are deliberately untouched.Verification
products listnow shows real titles +N disapproved / M issue(s)counts, andproducts insertsucceeds. Three-agent review: 0 critical, rename complete, no over-reach.Ships as v1.0.11. Changeset bumps
@gmc-cli/{api,cli,preflight,migrate}(patch).