HOMELAB-1865: ci(atlantis): zitadel root applies via prod infra-apply, not Atlantis #582
No reviewers
Labels
No labels
operator-review
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Homelab/infra-core!582
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "plane/HOMELAB-1865-atlantis-leg"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Removes
core/terraform/live/zitadelfrom the Atlantis project remit ininfra-core:atlantis.yaml. The root's sanctioned apply path is the prod repo's.forgejo/workflows/infra-apply.yamlwithtarget: zitadel.Closes HOMELAB-1865. Duplicate analysis: HOMELAB-1864.
Evidence (primary source, not inference)
The failing leg's job output, read from the live
atlantis-0pod log for this repo's PR #581 / commit9c12fb5:Cause chain, all verified:
backend.hclis untracked by design.gitignore→*.hcl+!*.hcl.example; the root tracks onlybackend.hcl.example(whose comment says "Real values live in the private prod repo.")infra-corealonerepo is at correct commit "9c12fb5…"in/atlantis-data/repos/Homelab/infra-core/581/zitadelworkflow demands the missing fileatlantis.yaml→init: {extra_args: ["-backend-config=backend.hcl"]}atlantis-repo-configConfigMaprepos.yamldeclares onlyid: /.*/+ asopsworkflow — no zitadel-specific backend mountprod/.forgejo/workflows/infra-apply.yaml→target: zitadelchecks infra-core out atref: liveand inits with-backend-config="$GITHUB_WORKSPACE/zitadel/backend.hcl"Debt: this leg was already red on merged commits
failureon648cfd8,c05c0e3,4d893e4and9c12fb5. The zitadel changes in648cfd8/c05c0e3/4d893e4are onlivevia PRs #546/#552 — i.e. they landed while this leg was red. What changed is enforcement: the landing lock (HOMELAB-1679, no override) now requiresci.state === "success"on the head sha, so a leg that was always broken became a hard merge blocker. This is pre-existing debt, not a defect in #581's diff — #581 never reached a plan.Change
zitadelproject block, with a comment recording the failure mode, the sanctioned path, and the precondition for re-enabling.workflows.zitadelis retained but marked DORMANT — it encodes the broken-backend-config=backend.hclstep and its env, and keeping it makes re-enable one block.es-atlantis.yaml's comment about that workflow therefore stays accurate.backend.hcl(backend/state config is prod-side; the alternative was rejected).Scope / review notes
atlantis.yamlonly — 1 file, +26/−11.projectsis now exactly[network, bootstrap]with theirdir/workflow/autoplanunchanged;version: 3intact; the file parses.networkandbootstrapuseworkflow: defaultand do not reference an untracked backend file — unaffected.docs/and root*.mdfor any claim that Atlantis covers the zitadel root: none. ADR-004's "Atlantis plans only on PRs" is about the cluster root. No doc line needed.Expected effect
PRs touching only
core/terraform/live/zitadel/**get no Atlantis plan context instead of a permanentfailure, so the combined status on a downstream PR head is driven by the real legs.terraform-validate(.forgejo/workflows/lint.yaml) still validates this root on every PR, and the apply path is unchanged and untouched.Note for #581: its head
9c12fb5already carries the stalefailurestatus. A re-run/refresh (empty push or re-request checks) will be needed after this merges to clear it — the orchestrator can handle that.Verification
$ python3 -c "import yaml; d=yaml.safe_load(open('atlantis.yaml')); print([p['name'] for p in d['projects']])" ['network', 'bootstrap']After merge the real confirmation is the negative test: a zitadel-touching PR whose combined status contains no Atlantis
failure.Verification evidence — negative test executed (head-vs-base finding)
A scratch probe (PR #583, now closed, not merged; branch deleted, worktree removed) was branched off this branch and touched
core/terraform/live/zitadel/main.tfwith a no-op comment — a change matching the removed project'swhen_modified: ["*.tf"].Atlantis log for
"pull":"583":Commit status on
39bd744:'' → success | 0/0 projects applied successfully.Under
origin/live's config (which still declares thezitadelproject) that same commit would have planned 1 project and failed. It planned 0 and passed → the fix works.Finding that matters for the handoff
Atlantis resolves repo-level
atlantis.yamlfrom the PR head, not the base branch. So merging this PR does not by itself clear the stale failure on #581: its head9c12fb5still carries the oldatlantis.yamlin its own tree. #581 needs one new commit on its branch carrying the fixed config — cheapest isgit merge origin/liveand push. A bare "re-request checks" will not suffice.This PR's own CI is green on
6ecd475(shellcheck, yaml-lint, terraform-validate, helm-validate, dispatcher-test, alert-receiver-test, receiver-test).Independent review verdict — head
6ecd475Fresh reviewer, separate context, primary sources only (diff vs
origin/live, both file revisions, prod repo, live Atlantis/Forgejo API).All 7 required checks PASS:
git diff --name-status origin/live..origin/plane/HOMELAB-1865-atlantis-leg→M atlantis.yamlonly; 1 commit ahead;git diff -widentical counts (26/11) → no whitespace-only rewrite;git diff --checkexit 0.['network','bootstrap']; no renamed-dirproject pointing at the zitadel root.workflows.zitadelretained byte-for-byte and still encodes- init: extra_args: ["-backend-config=backend.hcl"]; zero projects referenceworkflow: zitadel. Real Atlantis accepts the unused workflow: combined status on head issuccess | 0/0 projects applied successfully.ExternalSecretatlantis-zitadel-key(ns atlantis) verified againstcore/manifests/external-secrets/es-atlantis.yaml, matchingTF_VAR_zitadel_key_file.network/bootstrap(dir, workflow, autoplan) = True/True;version: 3in both.prod/.forgejo/workflows/infra-apply.yamldeclareszitadelas atarget, checks infra-core out atref: live, and inits with-backend-config="$GITHUB_WORKSPACE/zitadel/backend.hcl"; prod trackszitadel/backend.hcl+terraform.tfvars.backend.hcl/secrets;.forgejo/workflows/*untouched; terraform-validate / shellcheck / yaml-lint intact.['network','bootstrap'],workflows: ['zitadel'],version: 3.Concerns (non-blocking, comment wording only):
[concern]"Atlantis plan coverage of this root was redundant with that path" overstates it —infra-apply.yamlisworkflow_dispatch(apply-only), and the automatedplan-zitadeljob inprod/.forgejo/workflows/infra-plan.yamlearly-exits whenzitadel/*.tfis absent. The accurate statement is impossible, not redundant. Not a regression: the leg was never green (648cfd8/c05c0e3/4d893e4/9c12fb5allfailure | 0/1 projects planned).[concern]"fired on every commit" is overstated — autoplan was scopedwhen_modified: ["*.tf"], so unrelated live commits carried no Atlantis leg. The stated consequence for #581 is accurate.[suggestion]core/terraform/live/zitadel/versions.tf:5documents a non-existent backend path (../../../../environments/prod/zitadel/backend.hcl). Pre-existing, untouched here.[suggestion]New comment lines exceed 80 chars (no CI impact; yamllint scopes tocore/manifests/ core/ansible/).Claim honesty: yes — the diff does what the PR body says. Both imprecisions are confined to explanatory comments and do not misstate the change's behavior; the body is already candid that Atlantis resolves
atlantis.yamlfrom the PR head, so merging does not itself clear #581's stale failure.Merging on 0 blockers + green combined status.