Change gating

Optional. A PreSync hook asks Syncotta before each gated sync. The sync waits until the gate work item in Jira reaches an allowing status.

Optional. Off by default. Use it only if a production sync must wait until someone approves a Jira work item. Most teams approve in the pull request and do not need it: see Audit trail for that.

The gate is an Argo CD PreSync hook, a small Job that asks Syncotta before each full sync. Syncotta creates a Jira work item for the revision. The sync waits until that work item reaches a status you named as allowing. How the answers work: How it works.

Do Getting started first. Steps 1 and 2 below need the HMAC key from step 1 there.

Step 1: Add the PreSync gate to an application

Who: DevOps engineer. The gate lives in the application’s own chart because Argo CD runs hooks per application. It is not installed by the notifications chart from Getting started. The chart pulls the gate-client image (ghcr.io/syncotta/gate-client:<chart version>, linux/amd64 and arm64) by default.

  1. Create a Secret in the application’s namespace with the gate address and the HMAC key from the admin page (Endpoints, PreSync gate):

    kubectl create secret generic syncotta-gate -n <application namespace> \
      --from-literal=gate-url=<gate url> \
      --from-literal=hmac-key=<hmac key>
    

    Prefer sealed or external secrets for anything that goes through Git.

  2. Add the chart as a dependency of the application chart:

    # Chart.yaml of your application
    dependencies:
      - name: syncotta
        version: 0.2.0
        repository: oci://ghcr.io/syncotta/charts
    
    # values.yaml of your application
    syncotta:
      instanceId: <instance id>
      notifications:
        enabled: false
      gate:
        enabled: true
        existingSecret: syncotta-gate
    
  3. Pass Argo CD’s build environment as Helm parameters of the Application, so the gate knows what it approves:

    spec:
      source:
        helm:
          parameters:
            - { name: syncotta.gate.appName, value: $ARGOCD_APP_NAME }
            - { name: syncotta.gate.revision, value: $ARGOCD_APP_REVISION }
            - { name: syncotta.gate.project, value: $ARGOCD_APP_PROJECT_NAME }
    

    Do not pass $ARGOCD_APP_NAMESPACE as syncotta.gate.appNamespace. Argo CD sets it to the destination namespace, but the gate needs the namespace of the Application object (default argocd). Set syncotta.gate.appNamespace by hand only if your Applications live in another namespace.

    $ARGOCD_APP_REVISION is the revision of the source that holds the chart: the Git commit for a chart in Git, the chart version for a chart from a Helm repository. An empty revision fails the sync.

  4. Optional: set syncotta.gate.deadlineSeconds (default 1800). Keep it below Argo CD’s controller.sync.timeout.seconds if you set that.

All gate values are listed in Helm values.

Step 2: Choose the gate mode and fail policy

Who: Jira admin. In the admin page click Settings on the instance.

Change gate

  • Off (default): deployments are shown, syncs are never stopped. Safe while you set things up.

  • Standard: each gated deployment gets a Jira work item that Syncotta creates. Fill in:

    • Space key and Work type (name or id) where the work items are created. Prefer a software space (for example a Kanban space “Operations”): the approved deployment is linked to the gate work item, and only software spaces show deployments on a work item,
    • Statuses that allow: moving the work item to one of these lets the sync continue,
    • Statuses that reject (optional): moving it to one of these stops the sync.

    Any other status keeps the sync waiting. When you save, Syncotta checks the names against Jira and lists the valid ones if one is wrong. The names it accepts can differ from what you see in the Jira screen (see Troubleshooting).

There is no other gate mode. An older instance that was set to Premium keeps working as before until you switch it to Standard or Off.

Fail policy (applies once the gate is on; default for both is Block the sync)

  • If Syncotta cannot reach Jira: what happens on errors. Block keeps the Job polling and fails the sync at its deadline. Let the sync continue lets the sync through.
  • If the Syncotta licence is not active: block stops the sync with HTTP 422, allow lets it through. Without an active licence or trial no deployments are sent to Jira either, and the admin page shows a warning.
  • A rejected change always stops the sync, whatever the policy says.

The gate only runs in applications that have the PreSync gate from step 1.

Check that it works

Sync the gated application and read the Job log:

kubectl logs job/<release>-syncotta-gate -n <application namespace>

It shows one line per answer: HTTP 202 awaiting approval until the gate work item reaches an allowing status, then HTTP 200 allowed, sync continues. In Jira a new work item “Deploy to ” exists in the space you chose.

Problems? See Troubleshooting.