vtex-io-storefront-theme-versioning
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStorefront Theme Versioning, Install, and Rollback
店铺前端主题的版本管理、安装与回滚
When this skill applies
本指南适用场景
Use this skill whenever the version of a content-holding storefront app (a theme such as , or any app that ships , , , or ) is about to change in .
vendor.store-themestore/blocks.jsonstore/routes.jsonstore/templates/store/contentSchemas.jsonmaster- Bumping the version of a theme app with
vtex release patch | minor | major - Running /
vtex publishon a theme appvtex deploy - Running against a production account
vtex install vendor.store-theme@X.Y.Z - Promoting a workspace that has a different theme version installed than
master - Planning recovery from a deploy that "lost" all storefront content
- Reviewing a developer's deploy script that touches a storefront theme
Do not use this skill for:
- block registration via — use
interfaces.jsonvtex-io-render-runtime-and-blocks - shopper-facing component code under — use
react/vtex-io-storefront-react - app-level settings under — use
manifest.json#settingsSchemavtex-io-app-settings - Master Data schema versioning — use
vtex-io-masterdata-strategy
当环境中内容承载型店铺前端应用(如这类主题应用,或任何包含、、或的应用)的版本即将变更时,可使用本指南。
mastervendor.store-themestore/blocks.jsonstore/routes.jsonstore/templates/store/contentSchemas.json- 使用升级主题应用版本
vtex release patch | minor | major - 对主题应用执行/
vtex publishvtex deploy - 针对生产账号执行
vtex install vendor.store-theme@X.Y.Z - 发布与环境主题版本不同的工作区
master - 规划从导致「店铺前端内容丢失」的部署中恢复
- 审核涉及店铺前端主题的开发者部署脚本
本指南不适用于:
- 通过注册区块——请使用
interfaces.jsonvtex-io-render-runtime-and-blocks - 目录下面向购物者的组件代码——请使用
react/vtex-io-storefront-react - 下的应用级设置——请使用
manifest.json#settingsSchemavtex-io-app-settings - Master Data schema版本管理——请使用
vtex-io-masterdata-strategy
Decision rules
决策规则
- Treat any app that ships content under (theme apps and many storefront apps) as a content-holding app. Its installed MAJOR version is part of the key the platform uses to store and look up every Site Editor change a merchant has ever saved against blocks declared by that app.
store/ - Site Editor content, custom routes, templates, and per-template render caches are stored by under keys of the form
vtex.pages-graphql. Examples:vendor.app@MAJOR.x:template,acme.store-theme@0.x:store.home.acme.store-theme@0.x:store.product - A (
patch→0.0.61) and a0.0.62(minor→0.1.0) reuse the same key and the new version sees the same merchant content. A0.2.0(major→0.x) changes the key. The new major starts with zero merchant content even if the theme code is otherwise identical.5.x - When cannot find content for the active major, it falls back to the default
vtex.pages-graphqlcontent. The site visibly degrades to "VTEX default theme" content even though the customer's app is installed and rendering.vtex.store-theme - Avoid on a content-holding app whenever possible. Prefer keeping changes within the current major as
vtex release majororpatchso merchant content carries forward automatically.minor - When a major bump is unavoidable because of a structural change to blocks, routes, or templates, migrate the merchant content from the old major to the new major with the mutation in
updateThemeIdsbefore promoting. The mutation rekeys all Site Editor edits, Pages, and Redirects fromvtex.pages-graphql@2.xtovendor.app@{oldMajor}.xin one operation. This is the official developer-accessible recovery surface; do not assume content has to be re-authored manually.vendor.app@{newMajor}.x - Always install and validate a new theme major in a production-flag dev workspace (, which both creates and switches to the workspace in one step) before promoting. Linking is not enough:
vtex use rollout-workspace --productiondoes not exercise published artifacts and does not produce the same content-key behavior asvtex link+vtex install.vtex workspace promote - Run against
updateThemeIdsfrom the GraphQL Admin IDE (vtex.pages-graphql@2.x, thenvtex install vtex.admin-graphql-ide@3.x) inside the production-flag dev workspace, aftervtex browse admin/graphql-ideof the new major and beforevtex install. Site Editor, Pages, and Redirects in that workspace will then resolve under the new major and be carried with the workspace at promote time.vtex workspace promote - Treat as the atomic cutover. Smoke-test the dev workspace's full page set (home, PDP, PLP, department, search, custom routes, account, checkout entry) after running
vtex workspace promote. If the dev workspace is broken, master will be broken.updateThemeIds - Verify that the version published to the Apps Registry matches the source you expect. A common failure pattern is publishing a stripped-down boilerplate by mistake — the registry version installs cleanly, but it does not contain the custom blocks the existing Site Editor content references. cannot fix a missing-block problem; it only rekeys existing content.
updateThemeIds - The same step is required when downgrading to a previous major (for example
updateThemeIds→5.x). The mutation moves content in either direction across MAJOR boundaries.4.x - does not wipe master's
vtex workspace promoteVBase content. The service merges withvtex.pages-graphql: a 3-way merge ofMineWinsConflictsResolver(the master state the dev workspace forked from),base(current master), andmaster(the dev workspace). Master keys not touched by the dev workspace are preserved; conflicting keys are resolved in favor of the dev workspace ("mine wins"). Plan the rollout so that conflicting writes to master during the rollout window are minimized — for example, by pausing merchant Site Editor edits in master while the dev workspace is being prepared.mine - Whenever resolves a conflict in production,
MineWinsConflictsResolverautomatically writes a per-minute snapshot ofvtex.pages-graphql,base, andmasterto a siblingmineVBase bucket. This is logged withuserData_backupin thesubject: "conflicts_resolution"index. The snapshot is the recovery source if a promote merges in something unwanted; it is not a substitute for the smoke-test step (no backup is written when there is no conflict to resolve). Treat the backup as a safety net for VTEX support escalations, not a routine self-service restore.io_vtex_logs
- 将任何包含目录内容的应用(主题应用及多数店铺前端应用)视为内容承载型应用。其安装的MAJOR版本是平台存储和查找商家针对该应用声明的区块所做的每一处Site Editor更改的关键标识。
store/ - Site Editor内容、自定义路由、模板及每个模板的渲染缓存由以
vtex.pages-graphql格式的键存储。示例:vendor.app@MAJOR.x:template、acme.store-theme@0.x:store.home。acme.store-theme@0.x:store.product - 版本升级(
patch→0.0.61)和0.0.62版本升级(minor→0.1.0)会复用相同的键,新版本可读取相同的商家内容。0.2.0版本升级(major→0.x)会更改键。即使主题代码完全相同,新版本也会从零开始,无任何商家内容。5.x - 当无法找到当前主版本对应的内容时,会回退到默认的
vtex.pages-graphql内容。此时店铺会明显降级为「VTEX默认主题」内容,尽管客户的应用已安装并正在渲染。vtex.store-theme - 尽可能避免对内容承载型应用执行。优先将变更作为
vtex release major或patch版本保留在当前主版本内,以便商家内容自动延续。minor - 若因区块、路由或模板的结构性变更而必须升级主版本,请在发布前,使用中的
vtex.pages-graphql@2.xmutation将商家内容从旧主版本迁移到新主版本。该mutation可一次性将所有Site Editor编辑内容、页面及重定向的键从updateThemeIds更新为vendor.app@{oldMajor}.x。这是官方提供的开发者可访问的恢复方式;请勿假设内容必须手动重新编辑。vendor.app@{newMajor}.x - 发布前,务必在带生产标记的开发工作区(,该命令可一步创建并切换到工作区)中安装并验证新的主题主版本。仅本地链接(
vtex use rollout-workspace --production)不足以验证:vtex link不会使用已发布的工件,也不会产生与vtex link+vtex install相同的内容键行为。vtex workspace promote - 在安装新主版本后、执行前,在带生产标记的开发工作区中,通过GraphQL Admin IDE(先执行
vtex workspace promote,再执行vtex install vtex.admin-graphql-ide@3.x)针对vtex browse admin/graphql-ide运行vtex.pages-graphql@2.x。此时该工作区中的Site Editor、页面及重定向将使用新主版本的键,并在发布时同步到updateThemeIds环境。master - 将视为原子切换操作。运行
vtex workspace promote后,需对开发工作区的全页面集合(首页、商品详情页PDP、商品列表页PLP、分类页、搜索页、自定义路由、账户页、结账入口)进行冒烟测试。若开发工作区存在问题,updateThemeIds环境也会出现问题。master - 验证发布到应用注册表的版本是否与预期的源代码一致。常见的失败场景是误发布了精简版的模板——注册表中的版本可正常安装,但不包含现有Site Editor内容引用的自定义区块。无法修复区块缺失问题;它仅能更新现有内容的键。
updateThemeIds - 降级到之前的主版本(例如→
5.x)时,同样需要执行4.x步骤。该mutation可在任意主版本之间双向迁移内容。updateThemeIds - 不会清除
vtex workspace promote环境中master的VBase内容。该服务使用vtex.pages-graphql进行三方合并:对比MineWinsConflictsResolver(开发工作区从base环境分叉时的状态)、master(当前master环境状态)和master(开发工作区状态),冲突时以开发工作区的内容为准(「我方获胜」)。请规划发布流程以减少发布窗口内mine环境的冲突写入——例如,在准备开发工作区期间暂停商家在master环境中的Site Editor编辑操作。master - 当在生产环境中解决冲突时,
MineWinsConflictsResolver会自动将vtex.pages-graphql、base和master的每分钟快照写入同级的mineVBase存储桶。该操作会在userData_backup索引中记录io_vtex_logs。若发布时合并了不需要的内容,该快照可作为恢复源;但它不能替代冒烟测试步骤(无冲突时不会生成备份)。请将该备份视为VTEX支持团队处理问题的安全保障,而非常规自助恢复工具。subject: "conflicts_resolution"
Hard constraints
硬性约束
Constraint: Major version bumps on content-holding apps require an updateThemeIds
migration before promote
updateThemeIds约束:内容承载型应用升级主版本时,发布前必须执行updateThemeIds
迁移
updateThemeIdsA (or any version change that crosses the boundary) on an app that owns Store Framework content MUST NOT be promoted to without first migrating merchant content from the old major to the new major in a production-flag dev workspace, using the mutation in . The new major starts empty from 's point of view; promoting it to without running makes the storefront fall back to default theme content for every page that depended on Site Editor edits.
vtex release majorMAJOR.xmasterupdateThemeIdsvtex.pages-graphql@2.xvtex.pages-graphqlmasterupdateThemeIdsWhy this matters
vtex.pages-graphqlvendor.app@MAJOR.x:templatevtex.store-themeupdateThemeIdsDetection
Before running any on a production account, compare to the major currently installed (). If differs, STOP. Require the migration to be executed in a production-flag dev workspace, after the new major is installed and before promote.
vtex install vendor.app@X.Y.ZXvtex ls --production | grep store-themeXupdateThemeIdsAlso STOP if a developer is about to run on an app that ships any of: , , , . Confirm the structural change cannot be modeled as a or first; if the major is unavoidable, plan the step explicitly.
vtex release majorstore/blocks.jsonstore/routes.jsonstore/templates/store/contentSchemas.jsonpatchminorupdateThemeIdsCorrect
bash
vtex use theme-rollout --production # creates and switches to a production-flag dev workspace
vtex install acme.store-theme@5.0.0
vtex install vtex.admin-graphql-ide@3.x # required to access the GraphQL IDE
vtex browse admin/graphql-ide对于拥有Store Framework内容的应用,执行(或任何跨越边界的版本变更)后,不得直接发布到环境,必须先在带生产标记的开发工作区中,使用中的 mutation将商家内容从旧主版本迁移到新主版本。从的角度来看,新主版本初始为空;若未运行就发布到环境,所有依赖Site Editor编辑内容的页面都会回退到默认主题内容。
vtex release majorMAJOR.xmastervtex.pages-graphql@2.xupdateThemeIdsvtex.pages-graphqlupdateThemeIdsmaster重要性说明
vtex.pages-graphqlvendor.app@MAJOR.x:templatevtex.store-themeupdateThemeIds检测方式
在生产账号上执行前,对比与当前安装的主版本(执行查看)。若不同,请停止操作。要求在带生产标记的开发工作区中安装新主版本后、发布前执行迁移。
vtex install vendor.app@X.Y.ZXvtex ls --production | grep store-themeXupdateThemeIds若开发者要对包含、、或的应用执行,也请停止操作。先确认结构性变更是否可通过或版本实现;若必须升级主版本,请明确规划步骤。
store/blocks.jsonstore/routes.jsonstore/templates/store/contentSchemas.jsonvtex release majorpatchminorupdateThemeIds正确操作
bash
vtex use theme-rollout --production # 创建并切换到带生产标记的开发工作区
vtex install acme.store-theme@5.0.0
vtex install vtex.admin-graphql-ide@3.x # 需要安装以访问GraphQL IDE
vtex browse admin/graphql-ideIn the IDE, select the app vtex.pages-graphql@2.x
from the dropdown and run:
vtex.pages-graphql@2.x在IDE中,从下拉菜单选择应用vtex.pages-graphql@2.x
并运行:
vtex.pages-graphql@2.xmutation {
mutation {
updateThemeIds(
updateThemeIds(
from: "acme.store-theme@0.x",
from: "acme.store-theme@0.x",
to: "acme.store-theme@5.x"
to: "acme.store-theme@5.x"
)
)
}
}
Expected response: { "data": { "updateThemeIds": true } }
预期响应:{ "data": { "updateThemeIds": true } }
Validate Site Editor, Pages, and Redirects in this workspace, then:
验证该工作区中的Site Editor、页面及重定向,然后执行:
vtex workspace promote
**Wrong**
```bash
vtex release major
vtex publish
vtex install acme.store-theme@5.0.0vtex workspace promote
**错误操作**
```bash
vtex release major
vtex publish
vtex install acme.store-theme@5.0.0installed straight to master — no merchant content is visible under @5.x
直接安装到master环境——@5.x版本下无任何商家内容
and the storefront falls back to default vtex.store-theme content
店铺前端回退到默认的vtex.store-theme内容
undefinedundefinedConstraint: Never install a content-holding app version directly to master without a dev-workspace smoke test
约束:不得直接将内容承载型应用版本安装到master环境,必须先在开发工作区进行冒烟测试
Any change that swaps the installed version of a content-holding app on MUST go through a production-flag dev workspace first (), be smoke-tested across the full page set, and then be promoted with .
mastervtex use $name --productionvtex workspace promoteWhy this matters
mastermastermasterDetection
If a developer's command sequence runs while the active workspace is , STOP. Require switching to a production-flag dev workspace first.
vtex installmasterCorrect
bash
vtex use theme-rollout-2026-04 --production # creates and switches to a production-flag dev workspace
vtex install acme.store-theme@5.3.5任何更换环境中内容承载型应用安装版本的变更,都必须先通过带生产标记的开发工作区(),完成全页面集合的冒烟测试后,再通过发布。
mastervtex use $name --productionvtex workspace promote重要性说明
mastermastermaster检测方式
若开发者的命令序列在当前工作区为时执行,请停止操作。要求先切换到带生产标记的开发工作区。
mastervtex install正确操作
bash
vtex use theme-rollout-2026-04 --production # 创建并切换到带生产标记的开发工作区
vtex install acme.store-theme@5.3.5if this install crosses a MAJOR boundary, run updateThemeIds before smoke tests.
若该安装跨越主版本边界,在冒烟测试前运行updateThemeIds。
fetch home, PDP, PLP, search, custom routes from $workspace--$account.myvtex.com
从$workspace--$account.myvtex.com获取首页、PDP、PLP、搜索页、自定义路由
only after smoke tests pass:
仅在冒烟测试通过后执行:
vtex workspace promote
**Wrong**
```bash
vtex use master
vtex install acme.store-theme@5.3.5vtex workspace promote
**错误操作**
```bash
vtex use master
vtex install acme.store-theme@5.3.5any failure is now public
任何故障都会立即公开
undefinedundefinedConstraint: Verify the published artifact matches the source you expect
约束:验证发布的工件与预期源代码一致
Before installing a new published version of a content-holding app to , confirm that the artifact in the Apps Registry actually contains the blocks the active merchant content references. A successful does not guarantee the artifact carries the merchant's customizations.
mastervtex publishWhy this matters
A common failure pattern is publishing from a stripped-down repository or from a base-theme fork that lost the custom blocks the merchant has been editing for months. The install succeeds, but cannot resolve the blocks referenced in the merchant's stored content, and the storefront falls back to default content. The artifact and the content disagree.
pages-graphqlDetection
If the published version was built from a repository that does not contain the custom blocks the active theme references, STOP. Republish from the correct source. The migration only rekeys content; it cannot resolve missing block IDs, so a stripped-down artifact will still fall back to default content even after a successful migration.
updateThemeIdsCorrect
bash
undefined在将内容承载型应用的新版本安装到环境前,请确认应用注册表中的工件确实包含当前商家内容引用的区块。成功不代表工件包含商家的自定义内容。
mastervtex publish重要性说明
常见的失败场景是从精简版仓库或丢失商家已编辑数月的自定义区块的基础主题分支发布。安装可成功完成,但无法解析商家存储内容中引用的区块,店铺前端会回退到默认内容。工件与内容不匹配。
pages-graphql检测方式
若发布版本是从不包含当前主题依赖的自定义区块的仓库构建的,请停止操作。从正确的源代码重新发布。迁移仅能更新内容的键;无法解决区块ID缺失问题,因此即使迁移成功,精简版工件仍会回退到默认内容。
updateThemeIds正确操作
bash
undefinedpull the published artifact and confirm it ships the custom blocks
拉取已发布的工件并确认包含自定义区块
vtex apps files acme.store-theme@5.3.5 store/ | grep -E 'umMaisUm|customHeader'
vtex apps files acme.store-theme@5.3.5 store/ | grep -E 'umMaisUm|customHeader'
matches the block IDs the active theme depends on
匹配当前主题依赖的区块ID
**Wrong**
```bash
vtex publish
vtex install acme.store-theme@5.3.5
**错误操作**
```bash
vtex publish
vtex install acme.store-theme@5.3.5published artifact is the boilerplate fork; it is missing every custom block
发布的工件是模板分支;缺失商家存储内容中引用的所有自定义区块
referenced in the merchant's stored content
—
undefinedundefinedConstraint: Treat vtex workspace promote
as a 3-way mine-wins merge of pages-graphql VBase, not a wipe
vtex workspace promote约束:将vtex workspace promote
视为pages-graphql VBase的三方「我方获胜」合并,而非覆盖
vtex workspace promotevtex workspace promotevtex.pages-graphqlMineWinsConflictsResolver@vtex/apibasemastermineWhy this matters
Master keys that the dev workspace never touched are preserved on promote. Conflicting keys (something edited in both master and the dev workspace after the fork point) are overwritten by the dev workspace's value. Two practical consequences for a theme rollout:
- If merchants continue to edit Site Editor in master while the dev workspace is being prepared, those edits to keys the dev workspace also touches will be lost on promote.
- After runs in the dev workspace, the dev workspace owns the new-major content map; promoting it cleanly transfers the rekeyed Site Editor edits, Pages, and Redirects into master via mine-wins.
updateThemeIds
In production, every conflict resolution writes a per-minute snapshot of , , and to the sibling VBase bucket inside , logged with . No backup is written when there is no conflict to resolve, so smoke-testing remains the primary safety net.
basemastermineuserData_backupvtex.pages-graphqlsubject: "conflicts_resolution"Detection
If a rollout plan assumes promote will "replace" master content, STOP and rephrase as a merge plan: which keys does the dev workspace touch, which keys is master likely to touch in the same window, and how will conflicts be reconciled. If merchants are actively editing Site Editor in master during the rollout window, STOP and either pause those edits, narrow the rollout window, or document which keys will be overwritten.
Correct
text
Coordinate the rollout window with the merchant ops team:
- Pause Site Editor edits on master from the moment `updateThemeIds`
runs in the dev workspace until `vtex workspace promote` completes.
- Smoke-test in the dev workspace, then promote.
- After promote, validate Storefront → Site Editor, Pages, Redirects
on master.
If a conflict-resolution log appears (subject: "conflicts_resolution"),
record the backup paths surfaced by pages-graphql in `io_vtex_logs`.
The snapshot lives in the `userData_backup` bucket of vtex.pages-graphql
and can be fetched via the VBase v2 API for support escalation.Wrong
text
"Promote will replace master, so we don't need to coordinate."
- Merchants keep editing Site Editor in master during the rollout.
- Promote merges those edits with mine-wins; every conflicting key is
silently overwritten by the dev workspace value.
- Without a smoke-test or coordination, the lost edits are not noticed
until shoppers report missing content.vtex workspace promotemastermastervtex.pages-graphql@vtex/apiMineWinsConflictsResolverbasemastermastermastermine重要性说明
开发工作区未触及的环境键会在发布后保留。冲突键(分叉后环境和开发工作区都编辑过的键)会被开发工作区的值覆盖。主题发布有两个实际影响:
mastermaster- 若商家在准备开发工作区期间继续在环境中编辑Site Editor,那些与开发工作区触及的键冲突的编辑内容会在发布后丢失。
master - 在开发工作区中运行后,开发工作区拥有新主版本的内容映射;发布可通过「我方获胜」机制将更新键后的Site Editor编辑内容、页面及重定向干净地同步到
updateThemeIds环境。master
在生产环境中,每次冲突解决都会将、和的每分钟快照写入的同级 VBase存储桶,并在中记录。无冲突时不会生成备份,因此冒烟测试仍是主要的安全保障。
basemasterminevtex.pages-graphqluserData_backupio_vtex_logssubject: "conflicts_resolution"检测方式
若发布计划假设发布会「替换」环境内容,请停止并重新规划为合并计划:开发工作区会触及哪些键,环境在同一窗口可能触及哪些键,如何协调冲突。若商家在发布窗口期间仍在环境中编辑Site Editor,请停止操作,要么暂停这些编辑,要么缩小发布窗口,要么记录哪些键会被覆盖。
mastermastermaster正确操作
text
与商家运营团队协调发布窗口:
- 从开发工作区运行`updateThemeIds`到`vtex workspace promote`完成期间,暂停`master`环境中的Site Editor编辑操作。
- 在开发工作区进行冒烟测试,然后发布。
- 发布后,验证`master`环境中的店铺前端→Site Editor、页面、重定向。
若出现冲突解决日志(subject: "conflicts_resolution"),
记录pages-graphql在`io_vtex_logs`中显示的备份路径。
快照存储在vtex.pages-graphql的`userData_backup`存储桶中,
可通过VBase v2 API获取,用于支持团队处理问题。错误操作
text
"发布会替换master环境内容,因此无需协调。"
- 商家在发布期间继续在master环境中编辑Site Editor。
- 发布时通过「我方获胜」机制合并这些编辑内容;所有冲突键都会
被开发工作区的值静默覆盖。
- 若无冒烟测试或协调,丢失的编辑内容直到购物者报告内容缺失才会被发现。Preferred pattern
推荐模式
Recommended deploy flow for any change to a content-holding app installed on :
mastertext
1. Decide the SemVer bump deliberately
- patch → bug fix, no block contract change
- minor → new optional block, backward-compatible additions
- major → ANY structural change that breaks an existing block contract
(avoid when possible; requires the updateThemeIds migration)
2. vtex release [patch|minor|major]
vtex publish
3. Switch to a production-flag dev workspace
(vtex use both creates and switches in one step)
vtex use theme-rollout-YYYY-MM-DD --production
4. Install the new version in the dev workspace
vtex install vendor.app@X.Y.Z
5. If the bump crosses a MAJOR boundary (including downgrades such as 5.x → 4.x):
a. vtex install vtex.admin-graphql-ide@3.x (if not already installed)
b. vtex browse admin/graphql-ide
c. In the IDE, select the app `vtex.pages-graphql@2.x` from the dropdown
d. Run:
mutation {
updateThemeIds(
from: "{appVendor}.{appName}@{oldMajor}.x",
to: "{appVendor}.{appName}@{newMajor}.x"
)
}
Keep the literal "x" in both keys; do not replace it with a minor or
patch number or the mutation silently fails.
e. Expected response: { "data": { "updateThemeIds": true } }
If the bump is patch or minor inside the same major, skip this step —
content keys are preserved automatically.
6. Smoke-test in the dev workspace against the full page set
- $workspace--$account.myvtex.com/ (home)
- $workspace--$account.myvtex.com/<pdp-slug>/p (product)
- $workspace--$account.myvtex.com/<category> (PLP)
- $workspace--$account.myvtex.com/<dept> (department)
- $workspace--$account.myvtex.com/<search>?_q (search)
- any /institucional/* or other custom routes
- VTEX Admin → Storefront → Site Editor, Pages, Redirects
- account, login, cart, checkout entry
7. If anything is wrong: stop. Do not promote. Investigate.
If everything renders correctly:
- Coordinate the promote window with the merchant ops team so that
no Site Editor edits land on master between `updateThemeIds` in
the dev workspace and `vtex workspace promote`. Promote performs
a 3-way mine-wins merge against pages-graphql VBase, so any
conflicting master edit will be overwritten by the dev workspace.
- vtex workspace promote
8. Re-test on $account.myvtex.com (master) and the public domain.
- Validate Storefront → Site Editor, Pages, Redirects on master.
- If the public CDN serves stale content, validate with cache-busting
query strings; the edge will refresh on its normal TTL.
- If `io_vtex_logs` shows a `subject: "conflicts_resolution"` entry
for `vtex.pages-graphql` in this account around the promote time,
record the listed backup paths. They live in the `userData_backup`
bucket of pages-graphql and can be fetched via the VBase v2 API
if a recovery is needed later.
9. Keep the dev workspace for at least one business day in case a fast
re-promote is needed.Recommended emergency rollback after a broken major install on :
mastertext
1. vtex use rollback-YYYY-MM-DD --production
(vtex use both creates and switches; there is no `vtex workspace create`)
2. vtex install vendor.store-theme@<previous major version>
3. If the rollback crosses a MAJOR boundary (it almost always does), run
updateThemeIds in vtex.pages-graphql@2.x to migrate stored Site Editor
edits, Pages, and Redirects from the broken major back to the previous
major:
mutation {
updateThemeIds(
from: "{appVendor}.{appName}@{brokenMajor}.x",
to: "{appVendor}.{appName}@{previousMajor}.x"
)
}
4. Smoke-test the rollback workspace end-to-end (storefront pages and
VTEX Admin → Storefront → Site Editor, Pages, Redirects).
5. vtex workspace promote
If `updateThemeIds` returns false, the GraphQL IDE shows an error, or
content does not appear after migration, escalate to VTEX support
before promoting; do not promote a workspace whose Site Editor content
has not been validated.
If a previous promote merged in something unwanted, before re-promoting
check `io_vtex_logs` for a `subject: "conflicts_resolution"` entry on
`vtex.pages-graphql` for this account around the original promote
time. The entry lists per-minute snapshot paths inside the
`userData_backup` bucket (`store/templates.{base|master|mine}.<TS>.json`,
`store/content.{...}.json`, `store/routes.{...}.json`) which can be
fetched through the VBase v2 API:
GET https://infra.io.vtex.com/vbase/v2/{account}/{workspace}/
buckets/vtex.pages-graphql/userData_backup/files/{path}
This recovery path requires an admin auth token and is documented in
`vtex/pages-graphql` `TROUBLESHOOTING.md`. Treat it as a support-led
escalation, not a routine self-service step, and always test the
restored payload in a non-master workspace first.Recommended way to think about content-key behavior:
text
Patch / minor bump
acme.store-theme @ 0.0.61 → 0.0.62
storage key prefix unchanged: acme.store-theme@0.x:*
merchant content carries over automatically
Major bump
acme.store-theme @ 0.0.61 → 5.0.0
storage key prefix changes: acme.store-theme@0.x:* → acme.store-theme@5.x:*
the new major starts empty from the resolver's point of view
run updateThemeIds in vtex.pages-graphql@2.x inside the production-flag
dev workspace to rekey Site Editor edits, Pages, and Redirects from
acme.store-theme@0.x to acme.store-theme@5.x, then promote针对环境中内容承载型应用的任何变更,推荐的部署流程:
mastertext
1. 谨慎决定SemVer版本升级类型
- patch → bug修复,无区块契约变更
- minor → 添加新的可选区块,向后兼容的新增功能
- major → 任何破坏现有区块契约的结构性变更
(尽可能避免;需要执行updateThemeIds迁移)
2. vtex release [patch|minor|major]
vtex publish
3. 切换到带生产标记的开发工作区
(vtex use可一步完成创建和切换)
vtex use theme-rollout-YYYY-MM-DD --production
4. 在开发工作区安装新版本
vtex install vendor.app@X.Y.Z
5. 若版本升级跨越主版本边界(包括降级,如5.x → 4.x):
a. vtex install vtex.admin-graphql-ide@3.x (若尚未安装)
b. vtex browse admin/graphql-ide
c. 在IDE中,从下拉菜单选择应用`vtex.pages-graphql@2.x`
d. 运行:
mutation {
updateThemeIds(
from: "{appVendor}.{appName}@{oldMajor}.x",
to: "{appVendor}.{appName}@{newMajor}.x"
)
}
请保留两个键中的字面量"x";不要将其替换为minor或patch版本号,否则mutation会静默失败。
e. 预期响应:{ "data": { "updateThemeIds": true } }
若版本升级为同一主版本内的patch或minor,跳过此步骤——
内容键会自动保留。
6. 在开发工作区对全页面集合进行冒烟测试
- $workspace--$account.myvtex.com/ (首页)
- $workspace--$account.myvtex.com/<pdp-slug>/p (商品详情页)
- $workspace--$account.myvtex.com/<category> (商品列表页)
- $workspace--$account.myvtex.com/<dept> (分类页)
- $workspace--$account.myvtex.com/<search>?_q (搜索页)
- 任何/institucional/*或其他自定义路由
- VTEX Admin → 店铺前端 → Site Editor、页面、重定向
- 账户、登录、购物车、结账入口
7. 若出现任何问题:停止操作。不要发布。进行排查。
若所有内容渲染正常:
- 与商家运营团队协调发布窗口,确保在开发工作区运行`updateThemeIds`到`vtex workspace promote`完成期间,
没有Site Editor编辑内容提交到master环境。发布操作会针对pages-graphql VBase执行三方「我方获胜」合并,
因此任何冲突的master环境编辑内容都会被开发工作区覆盖。
- vtex workspace promote
8. 在$account.myvtex.com(master环境)和公网域名上重新测试。
- 验证master环境中的店铺前端→Site Editor、页面、重定向。
- 若公网CDN提供过期内容,使用缓存清除查询字符串验证;边缘节点会在正常TTL后刷新。
- 若`io_vtex_logs`显示该账号在发布时间前后有`vtex.pages-graphql`的`subject: "conflicts_resolution"`条目,
记录列出的备份路径。这些路径存储在pages-graphql的`userData_backup`存储桶中,
若后续需要恢复,可通过VBase v2 API获取。
9. 保留开发工作区至少一个工作日,以便快速重新发布。针对环境中失败的主版本安装,推荐的紧急回滚流程:
mastertext
1. vtex use rollback-YYYY-MM-DD --production
(vtex use可一步完成创建和切换;没有`vtex workspace create`命令)
2. vtex install vendor.store-theme@<previous major version>
3. 若回滚跨越主版本边界(几乎总是如此),在vtex.pages-graphql@2.x中运行
updateThemeIds,将存储的Site Editor编辑内容、页面及重定向从失败的主版本迁移回之前的主版本:
mutation {
updateThemeIds(
from: "{appVendor}.{appName}@{brokenMajor}.x",
to: "{appVendor}.{appName}@{previousMajor}.x"
)
}
4. 对回滚工作区进行端到端冒烟测试(店铺前端页面及
VTEX Admin → 店铺前端 → Site Editor、页面、重定向)。
5. vtex workspace promote
若`updateThemeIds`返回false、GraphQL IDE显示错误或
迁移后内容未显示,请在发布前联系VTEX支持团队;
不要发布未验证Site Editor内容的工作区。
若之前的发布合并了不需要的内容,重新发布前请检查
`io_vtex_logs`中该账号在原发布时间前后是否有`vtex.pages-graphql`的`subject: "conflicts_resolution"`条目。
该条目列出了`userData_backup`存储桶中的每分钟快照路径(`store/templates.{base|master|mine}.<TS>.json`、
`store/content.{...}.json`、`store/routes.{...}.json`),可通过VBase v2 API获取:
GET https://infra.io.vtex.com/vbase/v2/{account}/{workspace}/
buckets/vtex.pages-graphql/userData_backup/files/{path}
该恢复路径需要管理员授权令牌,文档位于
`vtex/pages-graphql`的`TROUBLESHOOTING.md`中。请将其视为支持团队主导的
问题排查方式,而非常规自助步骤,并始终先在非master环境的工作区中测试恢复的内容。理解内容键行为的推荐方式:
text
Patch / minor版本升级
acme.store-theme @ 0.0.61 → 0.0.62
存储键前缀不变:acme.store-theme@0.x:*
商家内容自动延续
Major版本升级
acme.store-theme @ 0.0.61 → 5.0.0
存储键前缀变更:acme.store-theme@0.x:* → acme.store-theme@5.x:*
从解析器的角度来看,新版本初始为空
在带生产标记的开发工作区中,针对vtex.pages-graphql@2.x运行updateThemeIds,
将Site Editor编辑内容、页面及重定向的键从acme.store-theme@0.x更新为acme.store-theme@5.x,然后发布Common failure modes
常见失败模式
- Running on a theme to "clean up" the version number, not realizing it requires the
vtex release majormigration before promote.updateThemeIds - Installing a new theme major directly on because the dev workspace "looked the same".
master - Publishing from a forked repository that does not contain the custom blocks the active theme depends on. rekeys content but cannot resolve missing block IDs.
updateThemeIds - Treating as equivalent to
vtex linkfor content-holding apps.vtex installdoes not exercise the published artifact resolution path or the major-keyed content lookup.link - Running from a workspace that was never smoke-tested end-to-end.
vtex workspace promote - Promoting a major bump without running first, so the storefront goes live with default
updateThemeIdscontent for every page that previously depended on Site Editor edits.vtex.store-theme - Reaching for a non-existent command. The CLI creates a workspace as a side effect of
vtex workspace create; that single command both creates and switches.vtex use {workspaceName} --production - Replacing the literal in
xarguments with a minor or patch number (updateThemeIdsinstead ofacme.store-theme@5.0.0). The mutation requires the major-with-x form and silently no-ops otherwise.acme.store-theme@5.x - Running against the wrong app in the GraphQL IDE dropdown. The mutation only exists in
updateThemeIds.vtex.pages-graphql@2.x - Trusting the public domain to confirm a fix immediately after promotion. CloudFront serves stale content; use or another cache-busting parameter to bypass the edge during validation.
?utm_source=<value> - Forgetting that downgrades (for example →
5.x) also cross a MAJOR boundary and need their own4.xrun before promote.updateThemeIds - Assuming wipes master
vtex workspace promoteVBase content and re-fills it from the dev workspace. It does not — it 3-way merges with mine-wins, so master keys not touched by the dev workspace survive, and master keys that are also touched by the dev workspace get overwritten silently. Coordinate the rollout window with merchant ops to avoid losing concurrent Site Editor edits in master.vtex.pages-graphql - Treating the bucket inside
userData_backupas a routine restore endpoint. It is only written when conflicts are resolved (no conflict, no backup), it requires admin-level auth and the VBase v2 API, and it is a support-led TROUBLESHOOTING surface — not a substitute for smoke-testing or for thevtex.pages-graphqlflow.updateThemeIds
- 为了「清理」版本号而对主题执行,未意识到发布前需要执行
vtex release major迁移。updateThemeIds - 直接在环境中安装新的主题主版本,因为开发工作区「看起来一样」。
master - 从不包含当前主题依赖的自定义区块的分叉仓库发布。仅能更新内容的键,无法解决区块ID缺失问题。
updateThemeIds - 将视为与
vtex link等效的内容承载型应用验证方式。vtex install不会使用已发布的工件解析路径,也不会触发基于主版本的内容查找。link - 从未进行端到端冒烟测试的工作区执行。
vtex workspace promote - 未先运行就发布主版本升级,导致店铺前端上线后,所有之前依赖Site Editor编辑内容的页面都回退到默认的
updateThemeIds内容。vtex.store-theme - 尝试使用不存在的命令。CLI会通过
vtex workspace create的副作用创建工作区;该命令可一步完成创建和切换。vtex use {workspaceName} --production - 将参数中的字面量
updateThemeIds替换为minor或patch版本号(如x而非acme.store-theme@5.0.0)。该mutation要求使用主版本加x的格式,否则会静默失败。acme.store-theme@5.x - 在GraphQL IDE下拉菜单中选择错误的应用运行。该mutation仅存在于
updateThemeIds中。vtex.pages-graphql@2.x - 发布后立即信任公网域名确认修复。CloudFront会提供过期内容;验证时请使用或其他缓存清除参数绕过边缘节点。
?utm_source=<value> - 忘记降级(如→
5.x)也跨越主版本边界,发布前需要执行4.x。updateThemeIds - 假设会清除
vtex workspace promote环境中master的VBase内容并从开发工作区重新填充。实际并非如此——它会执行三方「我方获胜」合并,因此开发工作区未触及的vtex.pages-graphql环境键会保留,而开发工作区触及的master环境键会被静默覆盖。请与商家运营团队协调发布窗口,避免丢失master环境中并发的Site Editor编辑内容。master - 将中的
vtex.pages-graphql存储桶视为常规恢复端点。仅在解决冲突时才会生成备份(无冲突则无备份),它需要管理员级别的授权和VBase v2 API,是支持团队主导的问题排查工具——不能替代冒烟测试或userData_backup流程。updateThemeIds
Review checklist
审核检查清单
- Is the proposed version bump correctly classified as patch, minor, or major against SemVer rules?
- If the bump crosses a major boundary, is there a documented migration step in the production-flag dev workspace (in either direction, including downgrades)?
updateThemeIds - Is the install going to a production-flag dev workspace first (), never directly to
vtex use $name --production?master - If the bump is major, has been run against
updateThemeIdsfrom the GraphQL Admin IDE, and has the response beenvtex.pages-graphql@2.x?{ "updateThemeIds": true } - Has the published artifact been verified to contain the custom blocks the active theme depends on?
- Has the dev workspace been smoke-tested across home, PDP, PLP, department, search, custom routes, account, checkout entry, and the Storefront module (Site Editor, Pages, Redirects)?
- Has the rollout window been coordinated so that no concurrent Site Editor edits land on master between the dev workspace's and
updateThemeIds, given the 3-way mine-wins merge?vtex workspace promote - After promote, has been checked for a
io_vtex_logsentry onsubject: "conflicts_resolution"for this account, and (if present) have the listedvtex.pages-graphqlpaths been recorded for support escalation?userData_backup - Is the dev workspace retained for at least one business day after promotion in case a fast re-promote is needed?
- 提议的版本升级是否根据SemVer规则正确分类为patch、minor或major?
- 若版本升级跨越主版本边界,是否在带生产标记的开发工作区中记录了迁移步骤(包括降级等任何方向的迁移)?
updateThemeIds - 安装是否先在带生产标记的开发工作区中进行(),而非直接安装到
vtex use $name --production环境?master - 若版本升级为major,是否已通过GraphQL Admin IDE针对运行
vtex.pages-graphql@2.x,且响应为updateThemeIds?{ "updateThemeIds": true } - 是否已验证发布的工件包含当前主题依赖的自定义区块?
- 是否已对开发工作区的首页、PDP、PLP、分类页、搜索页、自定义路由、账户页、结账入口及店铺前端模块(Site Editor、页面、重定向)进行冒烟测试?
- 是否已协调发布窗口,确保在开发工作区运行到
updateThemeIds完成期间,vtex workspace promote环境中没有并发的Site Editor编辑内容(考虑到三方「我方获胜」合并机制)?master - 发布后,是否检查了中该账号的
io_vtex_logs是否有vtex.pages-graphql条目,且(若存在)记录了列出的subject: "conflicts_resolution"路径用于支持团队处理问题?userData_backup - 开发工作区是否在发布后保留至少一个工作日,以便快速重新发布?
Related skills
相关指南
- — When the question is what the manifest contract should declare, and why a major version bump is a contract-breaking change for content-holding apps.
vtex-io-app-contract - — When the question is what a theme app actually owns (
vtex-io-storefront-theme-app,store/blocks.json, page templates) and how those files relate to merchant Site Editor content.store/routes.json - — When the question is how a block name in a theme resolves to a React component, and why missing blocks under the active major cause render failures.
vtex-io-render-runtime-and-blocks - — When the question is whether a piece of data should live behind Site Editor at all, or in app settings, Master Data, or another store.
vtex-io-data-access-patterns
- — 当问题涉及manifest契约应声明的内容,以及为何主版本升级对内容承载型应用是契约破坏性变更时。
vtex-io-app-contract - — 当问题涉及主题应用实际拥有的内容(
vtex-io-storefront-theme-app、store/blocks.json、页面模板),以及这些文件与商家Site Editor内容的关系时。store/routes.json - — 当问题涉及主题中的区块名称如何解析为React组件,以及当前主版本下缺失区块为何会导致渲染失败时。
vtex-io-render-runtime-and-blocks - — 当问题涉及某段数据是否应存储在Site Editor中,还是存储在应用设置、Master Data或其他存储中时。
vtex-io-data-access-patterns
Reference
参考资料
- Manifest — How ,
vendor, andnameform the app identity used in storefront content keys.version - Versioning an App — and the SemVer rules that decide whether a bump preserves or invalidates downstream content keys.
vtex release - Publishing an App — How produces the artifact installed by
vtex publish.vtex install - Installing an App — Workspace scope of and why dev workspaces must be production-flag for realistic testing.
vtex install - Creating a Production Workspace — is the single command that both creates and switches to a production-flag workspace.
vtex use {workspaceName} --production - Promoting a Workspace to Master — as the atomic cutover from a production-flag dev workspace to
vtex workspace promote.master - Migrating CMS settings after a major theme update — Official procedure for the mutation in
updateThemeIds, including the GraphQL IDE setup and the literalvtex.pages-graphql@2.xargument format.MAJOR.x vtex/pages-graphql— HowTROUBLESHOOTING.mdwrites per-minuteMineWinsConflictsResolver,base, andmastersnapshots into theminebucket ofuserData_backupand how to fetch them via the VBase v2 API for support-led recovery (internal VTEX repo).vtex.pages-graphql- Store Framework — Why theme apps own content and how Store Framework consumes it at render time.
store/
- Manifest — 、
vendor和name如何构成店铺前端内容键使用的应用标识。version - Versioning an App — 及决定版本升级是否保留或使下游内容键失效的SemVer规则。
vtex release - Publishing an App — 如何生成
vtex publish安装的工件。vtex install - Installing an App — 的工作区范围,以及为何开发工作区必须带生产标记才能进行真实测试。
vtex install - Creating a Production Workspace — 是一步创建并切换到带生产标记工作区的命令。
vtex use {workspaceName} --production - Promoting a Workspace to Master — 作为从带生产标记的开发工作区到
vtex workspace promote环境的原子切换操作。master - Migrating CMS settings after a major theme update — 中
vtex.pages-graphql@2.xmutation的官方流程,包括GraphQL IDE设置和字面量updateThemeIds参数格式。MAJOR.x vtex/pages-graphql—TROUBLESHOOTING.md如何将MineWinsConflictsResolver、base和master的每分钟快照写入mine的vtex.pages-graphql存储桶,以及如何通过VBase v2 API获取这些快照用于支持团队主导的恢复(VTEX内部仓库)。userData_backup- Store Framework — 为何主题应用拥有目录内容,以及Store Framework在渲染时如何使用这些内容。
store/