argo-rollout

module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: MIT

README

argo-rollout

GitLab CD's deployment execution components: the machinery that decides what version runs where, and drives a deploy driver to make it so.

Three things ship from this repo:

Component What it is
The gitlab-function AutoFlow module kas imports it as a Go library to run the built-in CD Functions; it exposes a single run action to Starlark.
The Argo Rollouts deploy driver Config schemas plus the Starlark step handlers the orchestration engine dispatches to, packaged as a gem the GitLab monolith imports.
The orchestration engine The Ruby and Starlark that owns main(), walks a flow, reports progress, and asks for a governance decision at each gate.

Where things are

  • docs/specs/ — the product and design. Forward looking: it describes what we are building.
  • docs/decisions/ — the architecture decision records. One file per decision, dated, never renumbered. Why the code is the shape it is.
  • CLAUDE.md — the rules for changing anything here. docs/decisions/ is why they are the rules. Read both before editing; this file is only how to bring the thing up.

Running the tests

make go-test          # Go unit tests, plus the fakernetes scenario harness
make go-integration   # the apiserver-backed suite (needs envtest)
make integration-test # the end-to-end bash harness (needs Docker and a cluster)
make go-fmt go-lint   # formatting and linting

The orchestration gem carries the only Ruby in the repo and runs its own checks:

cd gems/gitlab-cd-driver-orchestration && bundle exec rspec && bundle exec rubocop

Contributing

See CONTRIBUTING.md. A change that alters why the code is shaped the way it is gets an ADR in docs/decisions/, in the same commit as the change.

Directories

Path Synopsis
flows
cmd/bundle command
Command bundle inlines the load("./<path>.star") graph rooted at flows/entrypoint.star into the single self-contained deploy.star the driver gem ships.
Command bundle inlines the load("./<path>.star") graph rooted at flows/entrypoint.star into the single self-contained deploy.star the driver gem ships.
integration_test
cmd/autoflow-driver command
autoflow-driver kicks off one AutoFlow workflow run via the AutoFlow.StartWorkflow gRPC on kas's API server, optionally passing the workflow's named kwargs (--kwargs-file).
autoflow-driver kicks off one AutoFlow workflow run via the AutoFlow.StartWorkflow gRPC on kas's API server, optionally passing the workflow's named kwargs (--kwargs-file).
cmd/extractcrd command
Command extractcrd lifts one CustomResourceDefinition out of the pinned argo-rollouts install.yaml and writes it verbatim to a file, so a Go test can install the same CRD the harness applies to its cluster.
Command extractcrd lifts one CustomResourceDefinition out of the pinned argo-rollouts install.yaml and writes it verbatim to a file, so a Go test can install the same CRD the harness applies to its cluster.
kas-shim/mockpolicy
Package mockpolicy makes a workflow's governance requests observable to the integration test: kas's built-in policy module never reads the context it is handed, and nothing on the invocation path logs an action's kwargs, so a request otherwise leaves no trace.
Package mockpolicy makes a workflow's governance requests observable to the integration test: kas's built-in policy module never reads the context it is handed, and nothing on the invocation path logs an action's kwargs, so a request otherwise leaves no trace.
internal
deps
Package deps declares the dependency-update policy the automated sweep and the policy tests share: which modules a sweep must not move, and where each module directory lives.
Package deps declares the dependency-update policy the automated sweep and the policy tests share: which modules a sweep must not move, and where each module directory lives.
deps/cmd/depsupdate command
Command depsupdate raises every module to the latest version within its major, holds the modules internal/deps freezes at the version they are already on, and prints what moved as markdown on stdout — go's own chatter goes to stderr, so the output is usable verbatim as a merge request description.
Command depsupdate raises every module to the latest version within its major, holds the modules internal/deps freezes at the version they are already on, and prints what moved as markdown on stdout — go's own chatter goes to stderr, so the output is usable verbatim as a merge request description.
pollcheck
Package pollcheck compiles a poll() check the way kas does, for the Starlark doubles that stand in for kas.
Package pollcheck compiles a poll() check the way kas does, for the Starlark doubles that stand in for kas.
pkg
api/function
Package function defines the seams kas injects into the CD Functions library.
Package function defines the seams kas injects into the CD Functions library.
gitlabfunctions
Package gitlabfunctions implements the gitlab-function AutoFlow module, which speaks AutoFlow proto Values on its boundary and structpb within.
Package gitlabfunctions implements the gitlab-function AutoFlow module, which speaks AutoFlow proto Values on its boundary and structpb within.
internal/function
Package function holds the helpers shared across the builtin Function implementations.
Package function holds the helpers shared across the builtin Function implementations.
internal/function/argopromote
Package argopromote implements the argo.promote builtin function: clear one canary pause gate on an Argo Rollout, idempotently.
Package argopromote implements the argo.promote builtin function: clear one canary pause gate on an Argo Rollout, idempotently.
internal/function/argosync
Package argosync implements the argo.sync builtin function: set an Argo CD Application's spec.source.targetRevision and trigger a sync.
Package argosync implements the argo.sync builtin function: set an Argo CD Application's spec.source.targetRevision and trigger a sync.
internal/function/commit
Package commit implements the gitlab_project.commit builtin function: create a commit with one or more file changes on a branch in a GitLab project.
Package commit implements the gitlab_project.commit builtin function: create a commit with one or more file changes on a branch in a GitLab project.
internal/function/functiontest
Package functiontest holds an httptest-backed GitLab client for the builtin Function tests.
Package functiontest holds an httptest-backed GitLab client for the builtin Function tests.
internal/function/manifest
Package manifest mutates Kubernetes GitOps manifests by editing a structured YAML document model, never by splicing strings into manifest text: only the matched document is re-encoded, so its siblings survive byte-for-byte.
Package manifest mutates Kubernetes GitOps manifests by editing a structured YAML document model, never by splicing strings into manifest text: only the matched document is re-encoded, so its siblings survive byte-for-byte.
internal/function/pinimages
Package pinimages implements manifest.pin_images: for each service, it finds the workload document matching the service name and sets each artifact's "source image:version" reference on the container already running that artifact's image repository.
Package pinimages implements manifest.pin_images: for each service, it finds the workload document matching the service name and sets each artifact's "source image:version" reference on the container already running that artifact's image repository.
internal/function/readfile
Package readfile implements the gitlab_project.read_files builtin function: read one or more files from a GitLab project at a Git ref.
Package readfile implements the gitlab_project.read_files builtin function: read one or more files from a GitLab project at a Git ref.
internal/function/setcanarystrategy
Package setcanarystrategy implements manifest.set_canary_strategy: it finds the Rollout document matching the target service and sets its spec.strategy.canary.steps to the ladder the given weights describe, leaving every sibling key under canary as the customer wrote it.
Package setcanarystrategy implements manifest.set_canary_strategy: it finds the Rollout document matching the target service and sets its spec.strategy.canary.steps to the ladder the given weights describe, leaving every sibling key under canary as the customer wrote it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL