Skip to content

cms: store ID and published schema versions are undiscoverable, and guessing fails silently #324

Description

@JonasJesus42

Context

Migrating cuida.electrolux.com.ec into the Electrolux FastStore storefront. Before authoring
entries with parity cms, we needed two values. Neither is discoverable today, and both fail
silently when wrong.

Problem 1 — the store ID is unguessable, and a wrong one looks valid

parity cms requires PARITY_CMS_STORE, but nothing tells you what it is. On this account three
independently plausible values were all wrong:

Candidate Why it looked right Result
faststore the repo has cms/faststore/, @faststore/core ships cms/faststore/, and vtex content upload-schema defaults to it wrong
electroluxecfaststore the VTEX account, and what discovery.config.js calls storeId wrong
electroluxec a sibling VTEX account wrong (401 — different account)

The real value is electrolux, which matches nothing in the repo.

What makes this expensive is that a wrong store ID does not error:

GET api/content-platform/manage/{account}/{anything}/branches   -> 200 []
GET api/content-platform/schemas/{account}.{anything}/content-types -> 404 SCHEMA_NOT_FOUND

200 [] for any string reads as "valid store, no branches yet". Accepting the CLI default would
have published a schema into a namespace nothing reads — sections present in the registry, absent
from the CMS, and no error anywhere.

The one reliable way we found (note it does not take a store, so it bootstraps):

GET api/content-platform/manage/{account}/entries?contentTypes=&page=1&pageSize=100
-> { entries: [ { storeId: "electrolux", contentTypeId: "landingPage", ... } ] }

Problem 2 — published schema versions cannot be listed

vtex content upload-schema prompts for a semver and rejects one already in the registry:

? Schema version to publish (e.g. 1.2.0 or 1.2.0-beta.1, not already in the registry)
> Version must be major.minor.patch, optionally with a prerelease tag

But there is no way to see what is already published:

  • vtex content only has generate-schema, init, split-components, split-content-types, upload-schema — no list.
  • The repo records no schema version; package.json version is the app release, a different thing.
  • We could not find a read endpoint for registry versions.

So the only ways forward are asking whoever published last, or guessing a number and hoping it
collides rather than lands somewhere wrong.

Proposal

  1. parity cms doctor should resolve and print the store ID from entries[].storeId, and fail
    loudly when PARITY_CMS_STORE disagrees with what the account actually uses. This is the check
    that catches the silent-namespace failure.
  2. Consider making PARITY_CMS_STORE optional, deriving it when unambiguous.
  3. Investigate whether the schema registry exposes published versions. If it does, surface them
    in doctor and suggest the next version on upload. If it does not, that is worth documenting so
    people stop looking.

Both are prerequisites to a safe first publish, and today both are guesswork.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions