GloriousFlywheel

Multi-Repo Layout

This document describes how the repositories are hosted, mirrored, and connected through CI/CD pipelines.

Repository Topology

graph TB
    GH["GitHub: attic-iac (public)"]
    GL_O1["GitLab: Overlay 1 (CI/CD)"]
    GL_O2["GitLab: Overlay 2 (CI/CD)"]
    GH_M["GitHub: org overlay (mirror)"]
    DC["Dev K8s"]
    PC["Prod K8s"]
    GH_M -->|push| GL_O1
    GL_O1 -->|"CI clones upstream"| GH
    GL_O2 -->|"CI clones upstream"| GH
    GL_O1 -->|deploys| DC
    GL_O2 -->|deploys| PC

The Repositories

attic-iac (public upstream)

Organization Overlay (example)

Pushes to the GitHub mirror are forwarded to GitLab, which triggers the CI pipeline.

Additional Overlays

Additional overlay repositories follow the same pattern. Each targets a different Kubernetes cluster with its own organization-specific configuration, while sharing the same upstream modules.

CI Pipeline Flow

All overlay repositories follow the same CI pattern:

  1. A push to the overlay repository triggers a GitLab CI pipeline.
  2. The pipeline clones the public upstream repository from GitHub.
  3. It symlinks upstream modules and source files into the overlay workspace, replicating the @attic_merged layout that Bazel produces locally.
  4. OpenTofu runs plan and apply against the merged file tree.
  5. On the main branch, deploys are automatic (not gated by manual approval).

This means the CI pipeline does not depend on Bazel itself. It reproduces the overlay merge with shell-level symlinks, keeping the CI environment lightweight.

GitLab Accounts

Each overlay repository is typically managed by a separate GitLab account (or group):

Deployment Targets

All clusters receive the same upstream infrastructure components (Attic cache, runners, dashboard) but with organization-specific configuration provided by their respective overlays.