Skip to content

cub draft sync

cub draft sync

Bring what the original space changed into a draft

Synopsis

Sync a draft: bring into it what its original space has changed since the draft last took it, as "cub variant promote " does. Every unit the draft cloned is upgraded from its original, and units created in the original since are cloned into the draft.

A draft has to be in sync before it lands, so that landing writes over nothing the original changed that nobody has seen, and its conflicts have to be resolved. "cub draft land" refuses a draft whose units are behind their originals or have conflicts outstanding.

Where the draft and the original changed the same path, a sync replaces the draft's value with the original's, unless the draft guards the path. Make the draft's changes with --guard Override=Upstream to keep them: the original's change to such a path is then withheld, and recorded as a conflict on the draft unit. Decide each one in the draft space with "cub unit conflicts": --dismiss keeps the draft's value, which landing then writes over the original's, and --apply --clearance Override=Upstream takes the original's. The units with conflicts outstanding are listed after the sync.

While the draft's change set holds original units, as it does after a landing whose change set did not close, those originals may be partway through the draft's own change, which cannot be taken until the change set closes. Their draft units are synced only as far as where the change set began on them, which is what landing checks them against, and the other draft units are upgraded as usual. No new units are cloned until it closes.

Examples:

  cub draft sync acme-base/raise-web-memory --dry-run
  cub draft sync acme-base/raise-web-memory
  cub unit conflicts --space acme-base-draft-raise-web-memory deployment --dismiss
cub draft sync <draft> [flags]

Options

      --dry-run            report what the command would write, and write nothing
      --fail-on-timeout    exit with status 4 rather than 0 when the wait for Triggers runs out before they finish, or cannot read a unit to tell. The changes are saved either way, so do not make them again
  -h, --help               help for sync
  -o, --output string      Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
      --quiet              No default output.
      --timeout duration   how long to wait for the Triggers of the units the command writes, as a duration such as 30s or 2m. The changes are saved whether or not the Triggers finish in time; when they do not, the command names the units and exits 0, unless --fail-on-timeout (default 2m0s)
      --verbose            Detailed output, additive with default output
      --wait               wait for the Triggers of the units the command writes to finish (default true)

Options inherited from parent commands

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

SEE ALSO

  • cub draft - Draft a change to a space in a space of its own, then land it