Skip to content

workspace: declare the promotion order of environments, used by promote and status (#4030) - #4055

Merged
lex00 merged 3 commits into
mainfrom
feat/4030-environment-order
Oct 17, 2026
Merged

lex00 merged 3 commits into
mainfrom
feat/4030-environment-order

Conversation

@lex00

@lex00 lex00 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Closes #4030

A member's promotion order is now declared once, in the order of the environments array in its chant.config.ts, and promote, chant build --promote-to and workspace status read it.

  • Config: an environments entry may carry canary?: boolean (object form); bare strings work as before. Pattern entries such as pr-* are not steps. A component's own environments (component.schema.json) say where it is hosted and never set the order. canary is declared and shown only; nothing acts on it yet, and the docs say so.
  • chant components promote --to <env> defaults --from to the previous step. A --from that skips a step is refused with promote-skips-environment and a fix line, unless --allow-skip. Two more refusals cover a defaulted --from: promote-no-previous-environment (--to is the first step) and promote-to-not-in-order. With no declared environments, promote behaves as before.
  • chant build --components --generate --promote-to <b> applies the same rule at generation time, with --from taken from --env, so a generated promote job can't fail at deploy time on a skip. --allow-skip on the build passes through into the generated job's command (GitHub and GitLab; Forgejo's generator writes no promote job).
  • workspace status --json gains members[].promotionOrder: [{ name, canary }], optional within contract 1, floor 0.124.28, listed in the read contract's "Fields added within version 1" table. The field is named promotionOrder because members[].environments already lists the ledger environments.
  • Status reads the order from the config's text when the environments literal is plain (strings, or { name, endpoint, canary } with literal values, no spread), so workspace status still loads no tsx (workspace status still registers tsx on a steward-index miss, and plugin-loading commands always do #3976). Anything else falls back to loading the config; the field is null when the config can't be read.

Level-0 output changes

Recorded on the level-0 exceptions page and #2525: components promote and build --promote-to refuse a skipped step when the config declares environments (--allow-skip restores the old behaviour); a missing --from now has its own message after the config loads; workspace status --json gains promotionOrder. No level-0 golden moved.

Acceptance

  • The ordering rule and canary field, with schema and docs (config.ts, configuration/config-file.mdx, cli/components.mdx).
  • Promote uses it, with a test that skipping an environment is refused (promote-order.test.ts, the promote handler tests, and three build-generation tests).
  • The order appears in workspace status --json (status-contract.test.ts).

Checks

  • npx tsx scripts/typecheck.ts: no regressions (26 baselined)
  • npx tsx scripts/check-lexicons.ts: no untracked tier-1 failures
  • cli, components, workspace, level-0 goldens, wave-loop goldens and the github, gitlab and forgejo lexicons: 5919 passed, with GITHUB_SHA, GITHUB_RUN_ID and CI set as in CI; rerun after rebasing on workspace: check that trunk commits name their work item, and show it in ci list (#4029) #4054
  • Full vitest: only the known local op/factory.e2e.test.ts failures, plus lineage-adopt, work-history and work-lease, which time out under full-suite load and pass alone
  • lint-docs-sentences (no regressions), lint-prompts, check-docs-diataxis, ./scripts/build-docs.sh: pass

@lex00
lex00 merged commit 374c014 into main Oct 17, 2026
11 checks passed
@lex00
lex00 deleted the feat/4030-environment-order branch October 17, 2026 01:33
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.

workspace: declare the promotion order of environments, used by promote, gates and the trunk lane

1 participant