fcode-release

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Factorial Code — Release

Factorial Code — 发布

Promotes an app's code from its
dev-…
workspace to its
prod-…
workspace using CLI remotes. Input: the two workspace slugs. This updates prod's current (unversioned) code only — publishing a workspace version and moving the
stable
alias is the separate platform release (model in
fcode-core-concepts
, journey in
fcode-ama
): don't run
team:versions:*
or move
stable
in this flow unless explicitly asked.
Gate every release with
fcode-code-validation
— see the procedure.
通过CLI远程仓库将应用代码从
dev-…
工作区推广到
prod-…
工作区。输入参数:两个工作区的标识(slug)。此操作仅更新生产环境的**当前(未版本化)**代码——发布工作区版本并迁移
stable
别名是独立的平台发布流程(相关模型见
fcode-core-concepts
,流程说明见
fcode-ama
):除非明确要求,否则在此流程中不要执行
team:versions:*
命令或迁移
stable
别名。
所有发布都必须通过
fcode-code-validation
验证——请参照相关流程。

Gotchas

注意事项

  • Prod write access is required. Only operators and the app's Factorial team admins can push to a
    prod-…
    workspace; the admin's grant lands when a release is requested and rides in the access token — if prod access is refused right after requesting, run
    fcode login
    and retry. Who promotes and why:
    fcode-ama
    .
  • A ✅ validation is required before pushing. Run
    fcode-code-validation
    on the dev workspace first; while the report has Blockers, refuse to push. Only an explicit user override ("push anyway despite the Blockers") proceeds — record that the gate was overridden.
  • Always confirm before the final
    fcode push
    .
    Summarize what will change in the prod workspace and wait for an explicit yes — prod code serves live installations.
  • Never
    --force
    .
    If
    fcode pull
    or
    fcode push
    reports a divergence between local and prod, stop, show what diverged, and ask the user how to proceed (
    fcode-cli
    ).
  • The
    fcode pull
    after
    remote:add
    is mandatory
    — it picks up the prod workspace's current metadata. Skipping it pushes stale settings over prod's.
  • Both slugs are encoded tokens (
    dev-…
    /
    prod-…
    ), not the app's UUID (see
    fcode-cli
    ). Verify the prefixes: cloning target and push target must not be swapped.
  • A failing
    fcode clone
    usually means a mistyped token or missing access (see
    fcode-ama
    ) — don't retry blindly.
  • If
    dev-xxx/
    already exists locally, don't reuse it silently
    — ask whether to release from a fresh clone (recommended) or the existing copy, and
    fcode pull
    it first.
  • 需要生产环境写入权限。只有运维人员和应用的Factorial团队管理员才能向
    prod-…
    工作区推送代码;管理员权限会在发布请求时授予并包含在访问令牌中——如果请求后立即被拒绝生产环境访问,请执行
    fcode login
    后重试。关于谁可以执行推广操作及原因,请查看
    fcode-ama
  • 推送前必须通过✅验证。先在开发工作区执行
    fcode-code-validation
    ;如果报告中存在阻塞项,拒绝推送。仅当用户明确覆盖(“尽管存在阻塞项仍要推送”)时才可继续——需记录此次验证门限被覆盖的情况。
  • 最终执行
    fcode push
    前务必确认
    。总结生产工作区将发生的变更,等待用户明确确认——生产环境代码服务于实时安装的应用。
  • 切勿使用
    --force
    参数
    。如果
    fcode pull
    fcode push
    报告本地与生产环境代码存在差异,请停止操作,展示差异内容并询问用户如何处理(相关说明见
    fcode-cli
    )。
  • 添加远程仓库后必须执行
    fcode pull
    ——此操作会获取生产工作区当前的元数据。跳过此步骤会将过时的设置覆盖到生产环境。
  • 两个标识(slug)都是编码令牌
    dev-…
    /
    prod-…
    ),而非应用的UUID(相关说明见
    fcode-cli
    )。请验证前缀:克隆目标和推送目标不能混淆。
  • fcode clone
    失败
    通常意味着令牌输入错误或缺少访问权限(相关说明见
    fcode-ama
    )——不要盲目重试。
  • 如果本地已存在
    dev-xxx/
    目录,请勿静默复用
    ——询问用户是从全新克隆(推荐)还是现有副本进行发布,并先执行
    fcode pull
    更新内容。

Procedure

操作流程

  1. Collect the two slugs. One
    dev-…
    (source) and one
    prod-…
    (target). Wrong prefix or any ambiguity about which app they belong to: stop and ask.
  2. Validation gate. Ensure a current ✅
    APP_VALIDATION_REPORT.md
    exists for the dev workspace — run
    fcode-code-validation
    when it is missing or stale. On ❌, list the Blockers and refuse; proceed only on an explicit user override.
  3. Clone and wire the prod remote:
    sh
    fcode clone --skipSkillsSetup dev-xxx
    cd dev-xxx
    fcode remote:add prod-xxx
    fcode pull          # mandatory: picks up prod's current metadata
    fcode add           # registers resources prod doesn't have yet
    On a divergence reported by
    fcode pull
    : stop and ask (see Gotchas).
  4. Confirm. Run
    fcode status
    , summarize for the user what the push will change in
    prod-xxx
    (processes, modules, variables, settings), and wait for explicit confirmation.
  5. Push:
    sh
    fcode push
    On a divergence: stop and ask — never
    --force
    on your own.
  6. Report the outcome, reminding the user that the platform release (publish a version, move
    stable
    ) is a separate step (
    fcode-ama
    ).
  1. 收集两个工作区标识。一个
    dev-…
    (源)和一个
    prod-…
    (目标)。如果前缀错误或无法确定所属应用,请停止操作并询问。
  2. 验证门限。确保开发工作区存在最新的✅
    APP_VALIDATION_REPORT.md
    文件——如果文件缺失或过时,请执行
    fcode-code-validation
    。如果验证结果为❌,列出阻塞项并拒绝继续;仅当用户明确覆盖时才可推进。
  3. 克隆并配置生产环境远程仓库
    sh
    fcode clone --skipSkillsSetup dev-xxx
    cd dev-xxx
    fcode remote:add prod-xxx
    fcode pull          # 必须执行:获取生产环境当前元数据
    fcode add           # 注册生产环境尚未有的资源
    如果
    fcode pull
    报告存在差异,请停止操作并询问(见注意事项)。
  4. 确认变更。执行
    fcode status
    ,向用户总结
    prod-xxx
    工作区将发生的变更(流程、模块、变量、设置),等待用户明确确认。
  5. 推送代码
    sh
    fcode push
    如果报告存在差异,请停止操作并询问——切勿自行使用
    --force
    参数。
  6. 报告操作结果,提醒用户平台发布流程(发布版本、迁移
    stable
    别名)是独立步骤(相关说明见
    fcode-ama
    )。