ArgoCD previews via the shared CI component
- Deciders: David Bauer, Julian Bäume
- Date: 2026-06-12 (revised 2026-07-03, 2026-07-29)
Status
Accepted
Context
Merge requests need a live, reviewable preview environment before merge, and main needs a persistent equivalent. A full App Suite stack per environment is unnecessary and expensive; only Booking itself plus the minimum it needs (a database, and enough of App Suite to exercise the plugin end-to-end) should be per-environment.
The web-foundation platform ships a reusable GitLab CI/CD component, openxchange/ci/argocd (mr-preview / preview / rollout templates). It either drives the ArgoCD CLI imperatively from CI (create / sync / wait / teardown, with a GitLab environment tracking the deployment) or, via rollout, nudges an app that ArgoCD already manages declaratively. The sibling glam service uses it in the shape adopted here, and we deliberately mirror that layout.
The alternative for previews — per-MR ApplicationSets discovered via the GitLab pullRequest generator and a cluster-side scm-discovery ApplicationSet (bootstrapped by a preview-apps repo topic) — was booking's original approach. It works, but every consuming repo re-implements the slug/namespace/URL derivation, the pullRequest generator wiring, and a bespoke CI wait-for-deployment job, and it needs an MR label plus cluster-side discovery machinery. GitLab's on_stop/auto_stop_in lifecycle is only cosmetic in that model.
Decision
Use the openxchange/ci/argocd component, mirroring glam: the CI argocd surface is two includes, and the environment logic lives in the ArgoCD resources.
- MR previews — imperative, via
mr-preview(zero inputs). It deploys the two manifests under.gitlab/argocd/—preview-app.yaml(helm/bookingplus the in-namespacecore-ui-middleware) andpreview-infra.yaml(helm/booking-preview: owned Namespace, MariaDB operator CRD, redis, a Garage S3 companion, the shared-middlewareExternalName, the IstioVirtualService). The component derives naming, namespace and thebooking-<slug>URL (from$CI_COMMIT_REF_SLUG) and the GitLab environment lifecycle (auto-stop, teardown on merge/close) by convention. These manifests live in.gitlab/argocd/, deliberately notargocd/(which ArgoCD auto-discovers), and carry no automatedsyncPolicy— the component drives sync imperatively, so an auto-sync would collide with the explicit sync. booking-main— declarative. AnApplicationSetcommitted inargocd/application.yamlowns it (selfHeal,prune), rendering the same three sources into namespacebooking-main. CI never creates/syncs/deletes it; therollouttemplate bumpsglobal.commitShaon thehelm/bookingsource (source-position: "1") and waits for synced+healthy, so a freshly built image rolls out. AnignoreApplicationDifferencesjq rule on that parameter stops the reconciler reverting the trigger. No manual bootstrap: the cluster'sscm-discoveryApplicationSetscans theopenxchange/appsuitegroup and applies theargocd/directory of any repo carrying theargocd(orpreview-apps) GitLab topic — booking already has theargocdtopic (as does glam), so mergingargocd/tomainis enough for it to create thebootstrap-bookingApplication and, in turn,booking-main.- Image tag: mutable per-branch slug. The buildah job pushes
:$CI_COMMIT_REF_SLUG(somain→:main); manifests setimage.pullPolicy: Always, and theio.ox.commit-shapod annotation (driven byglobal.commitSha) forces a fresh roll on each commit. This is what letsmaindeploy via a one-linerolloutand keeps the preview flow uniform. - No cross-app ordering step: the migration Job's
backoffLimitcovers the window while the MariaDB operator provisions the database, so the app and infra sync independently. - Ephemeral storage for MR previews — they run an in-namespace MariaDB/Garage, so
pruneis safe and no reclaim policy is needed. booking-mainuses a persistent database (amended 2026-07-29) — Garage and redis stay ephemeral there too, but the database is the shared PVC-backed MariaDB in the cluster'sdatabasesnamespace, with itsDatabase/User/GrantCRs in the dev-cluster repo. The preview chart renders an in-namespaceExternalNamealias, so the app chart connects tomariadbeither way. The in-namespace MariaDB keeps/var/lib/mysqlon anemptyDir, so a pod reschedule drops the schema and the service 503s until the operator is forced to recreate it — acceptable for a throwaway preview, not for a shared environment.
No full App Suite deployment per environment: shared middleware and core-ui are reused via ExternalName services and Istio routing; only Booking-specific pieces (database, its UI plugin's middleware companion) are per-namespace.
Consequences
Positive
- The CI argocd surface is two component includes; previews' naming, namespace, URL and GitLab environment lifecycle come from the component's conventions. No bespoke deploy/teardown/wait jobs.
booking-mainis declarative — it self-heals and surfaces drift like any GitOps app, and CI shrinks to an imagerollout.- The
rolloutstep is identical whether theApplicationSetlives in this repo'sargocd/or later moves into the sharedqa/e2e-environmentsdeployment — so this is forward-compatible with foldingbooking-mainthere.
Negative
- Mutable image tags drop the immutable-artifact property: a rebuilt
:main/:<slug>changes what a running pod would pull. Rollouts still key off the immutable$CI_COMMIT_SHAannotation, so a given deploy is reproducible, but the tag alone no longer identifies the artifact. booking-maindepends on the cluster'sscm-discoveryApplicationSetbootstrappingargocd/; it does so automatically via theargocdtopic, but until it has run,rollouthas nothing to roll. Previews are unaffected —mr-previewapplies their Applications imperatively. One-time migration: the pre-existing, imperatively-created standalonebooking-mainApplication must be deleted so theApplicationSetcan own the name (see preview apps).- The stack still depends on cluster capabilities (
k8s.mariadb.comandgarage.rajsingh.infooperators, ESO, Istio, the sharedappsuite-mainstack) and on the component's pinned version (@0.1.0) plus theARGOCD_SERVER/ARGOCD_AUTH_TOKENandKUBE_INGRESS_BASE_DOMAINCI variables. - Sharing the middleware/core-ui stack means these environments can't exercise middleware-side changes; they validate Booking-side behavior against a known-good shared backend.
References
openxchange/ci/argocdcomponent (mr-preview,rollout).gitlab-ci.yml,.gitlab/argocd/preview-app.yaml,.gitlab/argocd/preview-infra.yaml,argocd/application.yamlhelm/booking-preview/,helm/booking/openxchange/appsuite/web-foundation/glam— the reference layout- ADR-0009 — the migration Job the app sync runs

