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 a release of the change would bundle there, which its release tag marks -- the revision its end tag marks, for a unit the release tag does not mark -- so one approval satisfies both the change order's entry gates and its release gates. 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.

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 [<variant>] [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 in each unit the revision a release of it would bundle, which its release tag marks, or for a unit the release tag does not mark, the revision 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
      --include-hidden string[="*"]   Also select hidden entities, to list or to act on: those hidden for the given HiddenReasons, comma-separated, as in --include-hidden=BackingUnit, or for any reason when given no value or "*". ConfigHub/YAML Units, which hold the configuration of other entities, are hidden with the reason BackingUnit. A --where naming entities by Slug or ID selects them whether hidden or not
      --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>
      --permission strings            permission in format Action:UserIDOrUsername, Action:group:GroupSlugOrID for a group you belong to, or Action:serviceaccount:ServiceAccountSlugOrID (e.g., Manage:user@example.com, View:group:platform, View:serviceaccount:deploy-bot, can be repeated)
      --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