Repository navigation
Deploy by committing, and gate every deployment on the fuzz suite - #20
Merged
Merged
Conversation
Staging and production as two ArgoCD Applications reading the same chart with different value files, and a pipeline that never touches a cluster: it builds an image tagged with the commit SHA, writes that tag into a values file, and commits. ArgoCD does the rest. The deployed version stays knowable from the repository and revertible by reverting a commit. Everything is downstream of the correctness gate — the fuzz campaign over the simulator, the mutation gate, the race suite and the determinism guards — so a commit that breaks consensus under simulated faults never produces an image. That ordering is deliberate rather than conventional. A consensus bug does not announce itself: it is a stale read served once under a partition that healed, or a committed entry lost in an election nobody noticed. Catching it in staging needs the same unlucky interleaving that hid it in testing, so deploying and watching is not the safety net here that it is for a web service. The simulator searches those interleavings deliberately and is the only thing in the pipeline that can. Staging runs the same chart as production, three nodes against five. Different manifests would stop it being a rehearsal, and the bugs it exists to catch are exactly the ones that only appear on a real cluster. Three nodes still exercise election, catch-up and a rolling upgrade holding quorum; what they do not exercise is the two-failure case, which is why production runs five. Production's approval gates the commit rather than the sync, which is the opposite of the obvious arrangement. A human clicking Sync in ArgoCD means git no longer describes production: the commit is merged, the cluster is not running it, and reverting would not roll back — removing the single property that makes this worth doing. Production is promoted rather than rebuilt for a related reason: rebuilding from the same source can produce a different image, so the artifact exercised in staging is the one that ships. Three things here were found by running it rather than reading it. An empty clusterResourceWhitelist fails every sync with "resource :Namespace is not permitted" when CreateNamespace is set, before a single workload is created. The resources-finalizer needs its AppProject to still exist, so deleting both in one command wedges the Application and orphans its workloads. And a needs on the staging job made the production promote path unreachable, because staging does not run on a workflow_dispatch and a skipped dependency skips its dependents. Both environments were verified against this branch before it was merged: staging formed consensus across three nodes, production across five, and drift introduced by hand was corrected in one second.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Staging and production as two ArgoCD Applications reading the same chart with different value files, and a pipeline that never touches a cluster.
Deployment is a commit
The pipeline builds an image tagged with the commit SHA, writes that tag into a values file, and commits. ArgoCD does the rest. Nothing here runs
kubectlorhelmagainst a cluster, which is what keeps the deployed version knowable from the repository and revertible by reverting a commit.Everything is downstream of the correctness gate, and that ordering is deliberate rather than conventional. A consensus bug does not announce itself — it is a stale read served once under a partition that healed, or a committed entry lost in an election nobody noticed. Catching it in staging requires the same unlucky interleaving that hid it in testing, so "deploy and watch" is not the safety net here that it is for a web service. The simulator searches those interleavings on purpose and is the only thing in this pipeline that can.
Two environments, one chart
Same chart deliberately: different manifests would stop staging being a rehearsal, and the bugs it exists to catch are exactly the ones that only appear on a real cluster. Three nodes still exercise election, catch-up and a rolling upgrade holding quorum; what they do not exercise is the two-failure case, which is why production runs five.
Production's approval gates the commit, not the sync — the opposite of the obvious arrangement. A human clicking Sync in ArgoCD means git no longer describes production: the commit is merged, the cluster is not running it, and reverting would not roll back, which removes the single property that makes this worth doing. Production is also promoted rather than rebuilt, because rebuilding from the same source can produce a different image (a moved base layer, a different toolchain patch), so the artifact exercised in staging is the one that ships.
Verified against this branch before merging
Both Applications were pointed at
feat/cd-pipelineon a freshly rebuilt cluster:The tag-rewriting logic that staging and production deployment depend on was tested locally end to end before being trusted in CI.
Three bugs found by running it rather than reading it
clusterResourceWhitelist: []withCreateNamespace=truefails every sync withresource :Namespace is not permitted in project raftkv, before a single workload is created. Namespace is now the one cluster-scoped exception, which is still far narrower than the default project.resources-finalizerneeds itsAppProjectto still exist. Handing both to onekubectl delete -fwedges the Application: the finalizer never completes, the delete blocks until timeout, and the workloads it should have removed are orphaned.argocd.sh downnow deletes in dependency order and clears a stuck finalizer.needs: [staging]on the production job made the promote path unreachable, because staging does not run on aworkflow_dispatchand a skipped dependency skips its dependents.Note on the approval gate
The
productionGitHub Environment needs required reviewers configured in repository settings. Without them the gate is decorative — the job will run unattended.Verification
make checkpasses: vet, determinism guards,-racesuite, 22/22 mutations caught.