Skip to content

cub variant approve

cub variant approve

Approve the units of one or more variants

Synopsis

Approve one revision of each unit in one or more variant spaces.

An approval is an attestation of type Approval, recorded per space and covering specific revisions: the ones approved, and later revisions of the same unit with identical content. A new revision with different content is not approved until someone approves it. See cub attestation.

The spaces are the one named as an argument, or those --where-space selects, or those --change-order names -- its own space and the spaces it is headed for -- narrowed to one stage of its change workflow with --stage. These combine as an intersection.

In each space, the units approved are those with a Target -- what a release of the space would publish -- unless --change-order or --all is given, in which case they are every unit. --where narrows the units further. The revision of each is the head, or with --change-order the revision its end tag marks there, or --revision: a number, LastReleasedRevisionNum, Tag:, ChangeSet: or ChangeOrder:, optionally prefixed with Before:. A unit with no such revision is reported and skipped.

--reject records a rejection instead, and --note says why.

While spaces still gate releases with a vet-approvedby Trigger, approving a unit's head revision also clears that Trigger's gate, and this command waits for the space's Triggers to finish evaluating before returning, since a publish issued while evaluation is pending fails on the transient "awaiting/triggers" gate. Pass --no-wait to return as soon as the approvals are recorded.

Examples:

  # Approve the change that has reached this variant, then release it.
  cub variant approve apptique-dev
  cub release publish apptique-dev

  # Approve only the workloads.
  cub variant approve apptique-prod --where "Slug LIKE 'deployment-%'"

  # Approve the revision a release pinned, rather than each unit's head.
  cub variant approve apptique-prod --revision LastReleasedRevisionNum

  # Approve a base, which has no targets of its own.
  cub variant approve apptique-base --all

  # Approve change order checkout-v42 as it stands in every staging space.
  cub variant approve --change-order apptique-base/checkout-v42 --stage staging

  # Reject it in one of them.
  cub variant approve apptique-staging-eu --change-order apptique-base/checkout-v42 --reject --note "breaks the EU ingress"
cub variant approve [<space>] [flags]

Options

      --all                    approve every unit in the space, not only the ones with a Target
      --change-order string    approve this change order: the spaces it is headed for, and the revisions its end tag marks
      --claim stringArray      a key=value pair to record with the attestation, such as servicenow.com/change=CHG0012345; repeatable
      --dry-run                report what would be approved, and record nothing
      --evidence stringArray   the ID of another attestation this one relied on; repeatable
      --expires-in duration    how long the attestation satisfies requirements for, such as 72h; by default it does not expire
  -h, --help                   help for approve
      --no-wait                return as soon as the approvals are recorded, without waiting for triggers to finish evaluating
      --note string            the reason for the claim, in your own words
  -o, --output string          Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
      --quiet                  No default output.
      --reject                 record a Fail result: a rejection, for an approval
      --revision string        revision of each unit to approve; defaults to the change order's, or the head
      --stage string           with --change-order, approve in the spaces of this stage of its change workflow
      --verbose                Detailed output, additive with default output
      --where string           Filter expression using SQL-inspired syntax. Supports conjunctions with AND. String operators: =, !=, <, >, <=, >=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*. Pattern matching with LIKE/ILIKE uses % and _ wildcards. Regex operators (~, ~*, !~, !~*) support POSIX regular expressions. A related entity is referenced by prefix, as in "UpstreamUnit.Slug = 'base'"; when the reference names a list, a * segment matches any element, as in "FromLink.*.Slug = 'upgrade-app'". Examples: "Slug LIKE 'app-%'", "DisplayName ILIKE '%backend%'", "Slug ~ '^[a-z]+-[0-9]+$'"
      --where-space string     select the spaces to approve in with a where expression over spaces

Options inherited from parent commands

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

SEE ALSO