Repository navigation
Closed
Labels
area:lifecycleplan/diff/apply/observe/drift/prune/search --liveenhancementNew feature or requestepic:self-serviceSelf-service from templates: catalog, add-ons, day-2 actions, agent requests, upgrades
Description
Unit of #4642 (epic: self-service from templates). Paths at chant origin/main b1b9e44.
The Pulumi side of day-2 actions. Pulumi has no action block, so an action is a resource whose replacement is the operation: a command provider resource (command:local:Command, command:remote:Command) named by its URN. Running it is a preview and an update with --target <urn> --replace <urn>, under a gated request, recorded like the stack operations plywood already has (question F on the tracker; this unit builds option a).
Today
lexicons/pulumi/src/stack-ops.tsruns gated stack operations under oppulumi-stack-ops(PULUMI_STACK_OPS_OPat:87), each aGatedRequest, withrequestGateimported at:60andgatedStackExportat:240.lexicons/pulumi/src/run.ts:341already passes--targetfor each URN to an update, and:697builds a preview with targets.- plywood calls these through
packages/plywood/src/stack-ops.ts:86in plywood (gatedStackExport,gatedStackCancel,gatedStackMove).
To build
gatedStackAction({ dir, stack, engine, urn, ... })inlexicons/pulumi/src/stack-ops.ts:pulumi preview --json --target <urn> --replace <urn>; refuse (action-scope) unless the preview's steps are exactly one replace ofurn(plus its own create and delete halves).- The request (kind
stack-action) binds the stack, the URN and the preview's digest;requestGatereturnsgatedwith no counting approval. - With one: spend,
pulumi up --yes --target <urn> --replace <urn>, finish with{ result, exit, tail }.
- The URN's type must be a
command:resource type; any other type is refused (action-type) before a preview. - plunge stacks take the same path through the engine the stack names (
engineoption), as the other stack operations do.
Done when (build, checked in CI)
- With an injected exec and ledger, the first call returns
gatedand the fake exec sawpreview --json --target <urn> --replace <urn>and noup. - A preview fixture with a second resource replaced is refused
action-scope, naming that URN, with no request recorded. - A URN of type
aws:s3/bucket:Bucketis refusedaction-typebefore any exec call. - After a fake approval by a second principal,
up --yes --target <urn> --replace <urn>runs once andappliedandfinishedlines are written; a repeat returnsspent. -
npm run typecheckandnpm test -- lexicons/pulumi/src/stack-opspass.
Done when (run, recorded on the harness)
-
not run: emulator runs dropped by maintainer ruling 2026-10-28pw-action(plywood, claimaction/gated-replace): plain arm:plywood action prod-us rotateexits 3 with a pendingpulumi-stack-opsrequest, a second identity approves, the re-run exits 0 and the ledger shows{op: "pulumi-stack-ops", status: "ok", count: 1}. BREAK arm: the break overlay adds a second resource that depends on the command's output, so the preview replaces two resources and the run exits 1 withaction-scope(caught at theexitoutcome).
Tracker: #4642
Metadata
Metadata
Assignees
Labels
area:lifecycleplan/diff/apply/observe/drift/prune/search --liveenhancementNew feature or requestepic:self-serviceSelf-service from templates: catalog, add-ons, day-2 actions, agent requests, upgrades
Activity
lex00 commentedon Oct 28, 2026
Build note for self-service (2026-10-28): this unit also carries the generator side plywood#39 needs: the
/plywood actioncomment command and workflow_dispatchstackandactioninputs. plywood writes no job YAML itself. It builds on theactionword from #4653.lex00 commentedon Oct 28, 2026
Build note for self-service (2026-10-28): core's productPipelineJobs refuses a product word mapped onto
action, because the pipeline has no job for it. This unit adds an opt-inactions: trueto ProductPipelineOptions that countsactionas answered by the product's own workflow. terragucci#1310 and plywood#39 pass it. Theactioncommand itself landed in packages/core/src/ci-product-words.ts with #4653 (merge 64ac529).Merge unit/ss-chant-4654: pulumi lexicon: a gated stack action, a com…
lex00 commentedon Oct 28, 2026
Landed on integration/self-service in merge ddf94a1 (unit commit 926c3a1).
What landed:
gatedStackAction({ dir, stack, urn, name?, engine?, anew?, ... })in lexicons/pulumi/src/stack-ops.ts, exported from the lexicon root. A URN that does not parse or names another stack is refusedaction-urn, a non-command:typeaction-type, both before any engine call. Each call previewspreview --json --target <urn> --replace <urn> --stack <s>; any changing step on another URN, or a step on the URN that is not part of its replacement, is refusedaction-scope(the error carriescodeandurns), with no request recorded. The request is kindstack-action, subjectaction:<stack>:<name>(the URN when no name is given), fieldsstack,urn,engine,preview(the changed-only preview digest) andname. After an approval by someone other than the requester: spend,up --yes --target <urn> --replace <urn> --stack <s>, finish. The finished line keepsapplied | failed;detailcarriesresult: ok | failed,exit,tailandurn. A repeat of an applied request answersspentunlessanew. plunge stacks take the same two argv under plunge.upform joinsPULUMI_GATED_COMMANDSandPLUNGE_GATED_COMMANDS(same URN after--targetand--replace, nothing else);PULUMI_APPLY_COMMANDSstill refuses--replace. BuilderspulumiActionPreviewArgsandpulumiActionUpArgs.actions: trueon ProductPipelineOptions countsactionas answered by the product's own workflow and fillscomments.action; no job is written.actionJobon the pull request loop options (chant build --pr-loop --action-job, also accepted by productPipelineJobs, returned asaction). On GitHub and Forgejo the workflow gets anactionjob, started by/<product> <action word>(writer association on GitHub) or byworkflow_dispatchwith inputs<noun>andaction(sostackandactionfor plywood; names overridable throughactionJob.inputs). It checks out the target branch's commit, holds the apply identity when one is set, and runs<bin> <action word> --from-event, with the comment and inputs inCHANT_ACTION_COMMENT,CHANT_ACTION_MEMBER,CHANT_ACTION. The verb reads them withproductActionFromEnv(words, env)from@intentius/chant/ci-product, which applies the comment grammar's rules to both. Exit 3 (waiting) is a green job. A dispatch that names an action does not start the green apply. GitLab refuses--action-jobby name. Feature-detect onPRODUCT_ACTIONS_FLOOR(NEXT_RELEASE).Tests (unit tests inject the runner and an in-memory ledger; no engine runs):
CHANT_SKIP_ARTIFACT_CHECK=1 npx vitest run --project unit lexicons/pulumi/src/stack-ops lexicons/pulumi/src/run.test: 2 files, 74 tests passed.CHANT_SKIP_ARTIFACT_CHECK=1 npx vitest run --project unit packages/core/src/components/product-actions packages/core/src/components/product-pipeline packages/core/src/components/pr-pipeline packages/core/src/ci-product-words packages/core/src/cli/parse-args lexicons/github/src/components/generate-pr-pipeline lexicons/forgejo/src/components/generate-pr-pipeline lexicons/gitlab/src/components: 52 files, 346 tests passed. New goldens: lexicons/github/src/components/golden/pr-loop-action.github.yml and lexicons/forgejo/src/components/golden/pr-loop-action.forgejo.yml.npx tsc --noEmit -pfor packages/core, lexicons/pulumi, lexicons/github, lexicons/gitlab: no errors in touched files (the rest is the fresh worktree's missing generated lexicons). Repo-widenpm run typecheckleft to CI, so that box stays unticked.npx eslinton every touched file: clean.npm run lint:docs-prose: no regressions.npm run lint:docs-citations: clean.Build-level choices:
PulumiStackActionRefused(message starts with the code), as the other stack operations throw before asking; the outcome union is unchanged apart from the kind.pulumiPreviewDigest(preview, { changedOnly: true }), so the stack's ownsamestep does not move it.up --target --replacewithout--planis not checked here (plunge is outside the repos this unit reads). The harness run settles it.--from-eventplus the three variables) is for plywood#39 to implement in its action verb.lex00 commentedon Oct 28, 2026
Typecheck checked on integration/self-service at ddf94a1 with generated lexicon artifacts:
npm run typecheckreports 26 baselined failures and no regressions;npx vitest run --project unitover pulumi stack-ops, run.test and core ci-product-words: 3 files, 84 tests pass. One wording note on the first build item: the first call's status iswaiting, the word Pulumi stack operations already use, where the item says "gated"; the behaviour the item describes holds.lex00 commentedon Oct 28, 2026
Ruling for self-service (2026-10-28): Issue or PR (Recommended). Keep today's behaviour. The gate still needs a second approver, and behold can post the request on an issue for an app that has no open pull request.
lex00 commentedon Oct 29, 2026
Handoff (self-service-1, 2026-10-28).
Built: integration/self-service merge ddf94a1. All build items ticked. Ruling (2026-10-28): an action comment is accepted on a plain issue or a pull request.
Not on main yet. chant main moved while this epic ran (ci-products-1 cp6 a0c3037, cp7 4073bb3), and its cp8 is in flight. Next: once ci-products-1 has no chant merge or release in flight, merge origin/main into integration/self-service, rerun the suite one suite at a time, then merge to main with a merge commit and the tree check. integration/self-service was green at 4794d23 (unit 31847 pass, typecheck no regressions, docs prose and citations clean; see chant#4642).
Left: the run item pw-action (plywood; bench prepared by plywood#44). Unverified until then: plunge accepting
up --target --replacewithout--plan.Harness runs have not been made. They run on the emulator only (local Forgejo, floci on 127.0.0.1, wrapped in
chant e2e safe-run --scan), one repo at a time, after ci-products-1's pw22 round, with the products built against chant's integration/self-service (or a chant release carrying chant#4650-4655). Commands and expected verdicts: engine-wt/goals/self-service-1-runs.md.lex00 commentedon Oct 29, 2026
Close-out (2026-10-28)
Merged to main at 8c18b27 (integration/self-service). CI green: chant 40814401598, docs 40814401604, chant-ci-green 40815002521. Released as chant 0.124.58 (publish run 40816550044), which carries chant#4650-4655. Run items are struck: the maintainer dropped the emulator harness runs on 2026-10-28, so they were not run.