Repository navigation
Description
Friction
All 28 git sources of the Argo CD applications track main. They sit in 27 files under k8s/argocd. bootstrap.yaml and cluster.yaml are among them.
Under the old pipeline, main changed only when a release merged. So the cluster changed only at a release. After the old pipeline ends, topic pull requests merge to main at any time. An application that tracks main then builds a manifest change before the image for it exists (#1451).
The property "the cluster follows releases" must come from the applications. Argo CD can track the highest semver tag. The release workflow creates the tag as its last write, after the images exist. So the manifests move after the image.
The constraint has a floor and no ceiling. It keeps working after 0.3.0 and after 1.0.0. Nothing in it assumes a version series.
Evidence
The counts below come from commit f3b17488, the tip of release/v0.2.39, on 2026-10-22.
git grep -n "targetRevision: main" -- k8sprints 28 lines in 27 files. The 25 files underk8s/argocd/appshold 26 lines, becauseargocd.yamlholds two git sources. The two parents hold the other two lines.- The 15 chart sources keep their pinned versions, for example
targetRevision: 10.9.6inargocd.yaml. - The remote has 44 tags, and all are
vN.N.N. One clone also holds the tagsbackup/wave1-684,backup/wave1-692andbackup/wave1-693. Argo CD skips such tags. - Argo CD resolves a constraint in
MaxVersioninutil/versions/tags.go. It usesgithub.com/Masterminds/semver/v3. The library accepts thevprefix, and the function skips tags that are not valid semver. This comes from the upstream source, read on 2026-10-22. Nobody ran it on a cluster. - The floor
>=0.2.0marks no change in the manifests. Tagsv0.1.8andv0.2.0hold 3 files underk8s/argocd. Tagv0.2.27holds 26. Argo CD takes the highest tag in range, so the floor never selects a tag. - There is no upper bound, so
0.3.0and1.0.0resolve. After the flip, a tag that matches the constraint deploys. The tag ruleset of ADR 0012 (step 7) limits who can create one. tests/test_k8s_argocd_apps.pyassertsmainin_check_app_git_sources(lines 146-149 and 155-158). It also assertsmainin the expected sources at lines 796 and 816.application_source(lines 42-59 ofsrc/devops_cli/k8s/argocd_overrides.py) readstargetRevisionas text.render_at_revision(lines 80-105) passes that text togit fetch. A constraint is not a git ref, so the fetch fails.- Only the Applications
devopsandingresstake that path (CONST_K8S_ARGOCD_HOMELAB_APPLICATIONS). - Image Updater does not change.
k8s/argocd/image-updater-values.yamlkeeps the digest ofservice:latest. That digest moves only at publish. So the image and the manifests follow two independent pins, and a rollback is two actions. k8s/README.mdstill says that the Applications trackmain(lines 511, 512 and 536). It says thatclustertracks a release branch (line 754). Line 536 also namesrelease/vX.Y.Z.
The parents bootstrap and cluster read their own definitions from the revision that they track. If a person sets them to the constraint before a tag contains the constraint text, they resolve to a tag whose definition says main. They then flip between the two on every refresh. This follows from the semantics of Argo CD. Nobody observed it.
So the parents stay on main with sync policy none until a release publishes a tag that contains the constraint. The child definitions in the cluster do not update in that time. The children keep tracking main.
devops argo cd apps bootstrap-gitops applies the local k8s/argocd/bootstrap/bootstrap.yaml (src/devops_cli/commands/argo.py:327-401). From a checkout that holds this item, it applies the constraint to bootstrap. So nobody runs it from such a checkout before the flip.
Existing tool considered
- Used: the semver
targetRevisionconstraint of Argo CD. Nothing is built for tag resolution, and the repository gets no version logic. - Used: the revision that Argo CD reports. The upstream comment on
status.sync.revisionsays it is "the revision the comparison has been performed to".deploy-stackreads it. It does not resolve tags withgit ls-remoteand a semver parser of its own. - Not used: a commit for each release that rewrites
targetRevision. The old pipeline did this until refactor(release): the release no longer pins, bumps or pre-publishes the service image tag; image updater rolls service:latest #1486 removed it. It needs a writer and a commit for every release. - Not used now: the
semverupdate strategy of Image Updater. It applies to images. The image keeps following the digest ofservice:latest. ADR 0012 lists it as a revisit condition. - Written cost of the build: the only code is the revision read in
application_sourceand its tests. ADR 0012 gives no figure for this step. This item carries the estimate before work starts. The estimate has the tokens to implement, maintain and fix, and the elapsed time. Until then, the build is a proposal.
Proposed remedy
-
Set
targetRevision: ">=0.2.0"on the 28 git sources. Quote the value, because>starts a YAML block scalar. Write no upper bound. Chart sources keep their pins. -
In
src/devops_cli/k8s/argocd_overrides.py, makeapplication_sourcetake the revision fromstatus.sync.revisionwhen the Application has it. When the status is empty, it keepstargetRevision. No list of patterns decides whethertargetRevisionis a constraint.--argocd-revisionstill overrides the result. -
In
k8s/README.md, change the text for the new tracking. Change these lines:- Lines 511 and 512 (the parents). Say that they track
mainuntil a person flips them to the constraint (ADR 0012, step 13). - Line 528 (what
deploy-stackfetches). - Lines 534-537 (the heading and items 1 and 2).
- Lines 753-754 (the tree comments).
Item 1 shows how to stage hosts before a tag exists. For example,
--argocd-revision mainstages the manifests of the next tag. The release pull request changes no file underk8s/. - Lines 511 and 512 (the parents). Say that they track
-
In
src/devops_cli/lang/en/help.py(lines 358-361), reword the help of--argocd-revision. It no longer says "before a release merges". Then rundevops docs generate --sync-readme. This updatesdocs/CLI_REFERENCE.mdanddocs/MCP_TOOLS.md.
The pull request for this item follows these rules:
- The base is
main. The title isfeat(k8s): Argo CD follows release tags. The title is the changelog entry of the first release. - The body says
Closes #1862. It has noPart ofline and no changelog fragment, because nothing collects a fragment afterv0.2.39. - While the task-file rule is in force,
devops pr check-readinessasks fordocs/agent/tasks/task-1862-<slug>.md. The task file shows the completed work.
Items 3 and 4 of the README section "When a release merges into main" (lines 538 and 539) describe release.yml. The item "docs(workflow): the instructions describe trunk, derived versions and the release pull request" rewrites them. It also rewrites line 403, which is the ruleset bypass of the machine account.
The cluster change is person-run and ordered:
- Pending a person: before this item merges, set the sync policy of
bootstrapandclusterto none. The new definitions then do not reach the cluster. Every application keeps trackingmain. - Pending a person: merge no manifest change under
k8s/until a release holds the constraint. - Pending a person: instead of the previous step, set each application by hand after you read
argocd app diff. Useargocd app set <app> --revision ">=0.2.0". This resolves tov0.2.39, the last release of the old pipeline. Its content equalsmainuntil then. - Pending a person: after the first release publishes a tag that contains the constraint, flip
bootstrapandclusterto the constraint. Steps D4 and D5 of chore(settings): the release App, the release environment, the squash settings and the required checks are in place #1864 give the commands and the checks.
If the constraint resolves an unexpected tag, a person pins the application to a tag by hand. ADR 0012 then asks for a new look at the semver strategy of Image Updater.
What it deletes
- The assumption that the revision of an Application is a git ref and is read as text. It leaves
application_source. - The
mainliteral on 28 lines of YAML, and in 4 places oftests/test_k8s_argocd_apps.py(lines 146-149, 155-158, 796 and 816). - The statements in
k8s/README.mdthat namemainor a release branch as the tracked revision (lines 511, 512, 536, 753 and 754).
The item deletes no file and no function.
Tests
tests/test_k8s_argocd_apps.py:_check_app_git_sourcesasserts that every git source of this repository carries exactly">=0.2.0". The exact string means that no upper bound exists. The_all_applications()helper includesbootstrapandcluster, so the test covers both parents. The existing chart check keeps the pinned versions.tests/test_k8s_argocd_overrides.py:application_sourcereturnsstatus.sync.revisionfor an Application JSON with a constraint and a status. It returnstargetRevisionwhen the status is empty.render_at_revisionrenders the manifests at a full commit SHA of the local repository from the_repohelper.tests/test_k8s.py: the_Clusterfake answerskubectl get application. For one test, it returns a constraint and a status revision. Adeploy-stackrun then derives the hosts from the status revision. A second case shows that--argocd-revisionstill wins.devops docs checkanduv run devops cipass.
Order and dependencies
- This item is step 4 of the sequence in ADR 0012. It comes first among the code items. A topic pull request that lands on
mainbefore it deploys manifests ahead of any published image. - It merges after the old pipeline ends. All of these facts must be true:
- The
release.ymlrun is green. - The GitHub Release and both attested images exist.
- Tag
v0.2.39is on the squash commit onmain. - Milestone v0.2.39 is closed.
uv version --shortonmainreads0.2.39.
- The
- It merges after the squash-settings step of chore(settings): the release App, the release environment, the squash settings and the required checks are in place #1864 (ADR step 3). Then the title of this pull request is the squash subject that release-please reads.
- It does not wait for the release App or its environment (ADR step 2). It does not wait for the required checks or the tag ruleset (ADR step 7). Those come after step 6, so this item does not depend on them.
- It merges before ci(image): move the image checks to one path-filtered workflow #1858 (ADR step 5) and before feat(release): release-please opens the release pull request, topic pull requests target main, and its merge publishes #1861 (ADR step 6). Every later step of the sequence waits for it.
- ADR 0012 lists no manifest change under
k8s/in steps 5 to 13. So the rule "merge no manifest change in the window" costs no planned work. - The flip waits for the first release (chore(release): the first release made by release-please is published, with its cost measured #1865). chore(settings): the release App, the release environment, the squash settings and the required checks are in place #1864 tracks the flip as a person-run setting.
- Related: fix(release): the Service image a release pins is published before main pins it, so Argo CD never rolls the roadmap Service onto a missing image #1451 (the order of tag, image and cluster), and feat(k8s): argo cd image updater keeps the devops application on the digest of service:latest #1485 and refactor(release): the release no longer pins, bumps or pre-publishes the service image tag; image updater rolls service:latest #1486 (Image Updater).
Acceptance criteria
-
git grep -n "targetRevision: main" -- k8sprints nothing. All 28 git sources carry">=0.2.0". None has an upper bound. Chart sources keep their pins. -
tests/test_k8s_argocd_apps.pyasserts the exact string>=0.2.0for each git source of this repository,bootstrapandclusterincluded. The test fails for a source that carriesmainor an upper bound. - A test in
tests/test_k8s_argocd_overrides.pyshows thatapplication_sourcereturnsstatus.sync.revisionwhen it exists andtargetRevisionwhen it does not. - A test shows that
render_at_revisionrenders the manifests at a full commit SHA. - A
deploy-stacktest with the_Clusterfake intests/test_k8s.pyshows two facts. The hosts of a constraint come from the status revision.--argocd-revisionwins. - No code uses a list of strings or patterns to decide whether
targetRevisionis a constraint. -
git grep -nE "Tracks .main|track .main|tracking main|tracking release branch|release/vX\.Y\.Z" -- k8s/README.mdprints no line other than line 403. - The help of
--argocd-revisionno longer says "before a release merges".docs/CLI_REFERENCE.mdanddocs/MCP_TOOLS.mdmatch it, anddevops docs checkpasses. - Before this merges, a throwaway Application with
targetRevision: ">=0.2.0"against this repository, in a scratch namespace, resolves tov0.2.39.argocd app getshows that tag.kubectl get application <name> -o jsonpath='{.status.sync.revision}'prints a commit SHA and not the constraint text. The pull request body records both outputs. The throwaway is deleted. - The pull request targets
mainand saysCloses #1862. It has noPart ofline and no changelog fragment. - The estimate of the build is in the "Existing tool considered" section before work starts.
-
uv run devops cipasses with at least 90 percent coverage.
The "Pending a person" bullets in the section "Proposed remedy" are not checks of the pull request.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 22, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate proposes a new feature to make Argo CD follow release tags instead of the main branch.This change affects how the cluster tracks releases and requires careful coordination during the transition, but it's not critical for immediate operation.Improves release consistency and reliability by aligning cluster state with official releases.Involves updating multiple files, tests, documentation, and requires a coordinated cluster update process.feat(release): release-please makes every release from main (#1952)
dan-petty commentedon Oct 23, 2026
Not planned: the owner decided on 2026-10-23 that Argo CD keeps tracking main (ADR 0013).