Skip to content

cub draft

cub draft

Draft a change to a space in a space of its own, then land it

Synopsis

The draft subcommands make a change to a space without touching the space until the change is ready, as a branch and a pull request do.

"cub draft create" clones some or all of a space's units into a draft space, with links back to the units they were cloned from. Change the clones there as in any space: functions, Triggers, validation and link resolution all run in the draft. The original space keeps taking edits, upgrades and releases while the draft is open, without being locked, and a space can have several drafts at once, which may change the same units.

Make the draft's changes with --guard Override=Upstream. "cub draft sync" brings into the draft what the original has changed since, and where both changed a path, the guard keeps the draft's value and records the original's change as a conflict on the draft unit, to decide before landing. Without the guard, the sync replaces the draft's value with the original's.

"cub draft propose" creates the change set the draft will land in, in the original space, with a description and review requests, and optionally a ChangeWorkflow that gates its close. Nothing in the original space is locked yet.

"cub draft land" brings the draft's changes home, once the draft is in sync with the original and its conflicts are resolved: it opens that change set on the original units the draft changed, merges each draft revision into its original unit as a revision of its own ("Replayed revision N of /"), and closes the change set. The draft space is then archived, as the record of the change. A change set whose gates refuse the close stays open on the original units with the change in it; land again once they hold.

"cub draft abandon" archives the draft space without landing it.

A draft is named /, where is the original space's slug or ID or its /, or by the draft space's own slug or ID. The draft space is named -draft-. It is in the original space's Component, with the label Stage=Draft, and the label Draft=. It has no release target unless --release-target gives it one, for a preview deployment.

Options

  -h, --help   help for draft

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output

SEE ALSO