Skip to content

fix(argocd): every application pins automated sync enabled in git, so the devops application syncs again and a ui pause is reverted #1626

Closed

Description

@dan-petty

Friction

Application devops has applied nothing from main since 2026-10-11. Its automated sync was turned off by hand for the #1562 emergency stop, and the documented step to turn it back on once #1562 reached main was missed. Git cannot see or repair the toggle: automated.enabled is in neither the manifests nor last-applied-configuration, so the app-of-apps cluster reports devops as Synced and never reverts it, and no alert covers a paused Application. The next change under k8s/devops (the #1562 revert to replicas: 1, or any Image Updater digest bump) will show OutOfSync on devops and never be applied.

Evidence

Live, read-only, 2026-10-17 (Argo CD v3.5.3; main = 3dd7fa6):

  • Application argocd/devops: .spec.syncPolicy.automated = {enabled: false, prune: true, selfHeal: true}. It is the only one of 24 Applications with enabled: false; every other one has no enabled key.
  • managedFields: manager argocd-server, operation Update, 2026-10-11T01:43:49Z, owning only f:spec.f:syncPolicy.f:automated.f:enabled (a UI or API edit). At 01:44:18Z argocd-server also set f:spec.f:replicas on Deployment devops/roadmap-service (live replicas 0).
  • status.operationState started and finished 2026-10-11T01:41:43Z on revision 69c99cf; status.sync is Synced at 3dd7fa6 only because nothing under k8s/devops has changed since.
  • The kubectl.kubernetes.io/last-applied-configuration annotation holds automated {prune, selfHeal} with no enabled key. cluster has synced four times since (6e862cd, de09432, 5dbb86e, 3dd7fa6) and never restored it. cluster has no ServerSideApply option.
  • No live drift today: the only k8s/devops change since 69c99cf (replicas 1 to 0) matches the hand scale, and the Deployment's image digest matches the one Image Updater set on the Application.

Repo:

  • k8s/argocd/apps/devops.yaml:17-20 sets automated: {prune: true, selfHeal: true} with no enabled key; the same holds for every file in k8s/argocd/apps/ and k8s/argocd/bootstrap/{bootstrap,cluster}.yaml.
  • docs/agent/tasks/task-1562-suspend-roadmap-service.md:27: "Pending a person: keep the devops Application's sync off until this change reaches main, then turn it back on." The change reached main at 6e862cd (v0.2.34) on 2026-10-11 21:09Z.
  • k8s/devops/roadmap-service/deployment.yaml:10-12 already holds replicas: 0, so turning sync on starts nothing.
  • tests/test_k8s_argocd_apps.py:72-80 (test_automated_sync_policies) checks prune, selfHeal and retry.limit, not enabled.
  • k8s/README.md says nothing about pausing an Application.

Remedy

  1. Pending a person (it changes the cluster): finish task-1562-suspend-roadmap-service.md:27 by turning automated sync on the devops Application back on. Main has held replicas: 0 since 6e862cd, so no workload starts; afterwards kubectl -n devops get deploy roadmap-service still shows 0/0. Merging step 2 also does this through cluster, one release later.
  2. Test first: in tests/test_k8s_argocd_apps.py::test_automated_sync_policies, add assert automated.get("enabled") is True (it fails today), and extend it to the two bootstrap Applications.
  3. Write enabled: true under spec.syncPolicy.automated in every k8s/argocd/apps/*.yaml and in k8s/argocd/bootstrap/{bootstrap,cluster}.yaml. The value then lands in last-applied-configuration, so cluster's three-way diff marks a UI toggle OutOfSync and selfHeal restores it. Do not rely on ServerSideApply or a server-side diff on cluster: a field git does not declare stays owned by argocd-server and is left alone either way.
  4. k8s/README.md GitOps section: an Application is paused in git (enabled: false in its manifest), never in the UI; with the pin, cluster reverts a UI pause within one selfHeal cycle, so an emergency stop goes through git, or through pausing cluster first. Name this in the chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562 revert item when it is filed.
  5. The alert on a paused Application (argocd_app_info{autosync_enabled="false"}) belongs to Metrics for the rest of the platform #551, which owns the Argo CD scrape and sync alerts; this item links it.

Priority: P2. Severity medium (latent; no drift today); it blocks the Image Updater fix for the devops Application (P2) and the future #1562 revert.

Proposed design

Problem statement

The devops Application's automated sync is disabled in Git, but Argo CD's cluster application syncs it back on, causing a drift that blocks future changes. The issue occurs because the enabled field is not present in the manifest or last-applied-configuration, so Argo CD cannot detect when it was manually toggled off.

Acceptance criteria

  • Criterion 1: The devops Application's automated sync policy includes enabled: true in its manifest
    Verification: Run 'kubectl get application devops -n argocd -o yaml' and verify that spec.syncPolicy.automated.enabled is set to true
  • Criterion 2: The test suite verifies the enabled field is present and true for all Applications
    Verification: Execute 'pytest tests/test_k8s_argocd_apps.py::test_automated_sync_policies' and confirm it passes with assert automated.get("enabled") is True
  • Criterion 3: The cluster application detects when the devops Application's sync was manually disabled and reverts it
    Verification: Manually disable the devops Application's sync via UI, wait for selfHeal cycle, and confirm the Application's automated.enabled field is restored to true

Key questions

  • What is the current state of the devops Application's automated sync policy?: The devops Application's spec.syncPolicy.automated has prune: true, selfHeal: true but no enabled field, which means it's effectively disabled since Argo CD's cluster application will not detect manual changes to this field. [sources: k8s/argocd/apps/devops.yaml:3: syncPolicy:
    automated:
    prune: true
    selfHeal: true]
  • What is the expected behavior after implementing the fix?: After implementing the fix, all Applications' manifests will include enabled: true under spec.syncPolicy.automated, and the cluster application will be able to detect when an Application's sync was manually toggled off and revert it through selfHeal. (proposed) [sources: docs/agent/tasks/task-1562-suspend-roadmap-service.md:27: Pending a person: keep the devops Application's sync off until this change reaches main, then turn it back on.]

Fit

Needs splitting into 3 items:

  1. Add enabled: true to all Applications' manifests in k8s/argocd/apps/
  2. Update test suite to validate the enabled field is present and true
  3. Document that Applications are paused in Git, not UI, in k8s/README.md

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    on Oct 18, 2026
  2. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    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.

    • Type: type/bug. The candidate describes a bug where automated sync is incorrectly disabled in the devops application.
    • Priority: P1-High. The issue causes a critical failure in the deployment pipeline and requires immediate attention to restore normal operations.
    • Value: High. This fix restores normal functionality of the CI/CD pipeline by enabling automated sync, which is essential for continuous delivery.
    • Effort: Medium. The fix involves updating configuration files and tests, but does not require major architectural changes or new features.
  3. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Proposal needs splitting into 3 items at 25e2cda (see proposed design in issue body).

  4. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Amendment (2026-10-18): folded here by intake under the agent filing quota

    The cycle's agent filing allowance (#1153) was used, so devops roadmap intake filed nothing and named this item as the nearest. The candidate below is related work that can land with this item or be filed on its own in a later cycle. Candidate title: "fix(argocd): image updater keeps the devops application on the current service:latest digest while no pod runs".

    Friction

    Image Updater stopped moving the devops Application to new service:latest digests on 2026-10-11 and reports success while doing nothing. It only updates images it sees running in status.summary.images; the CronJob devops-cli is a suspended template and roadmap-service is at 0 replicas (#1562), so no pod runs the image and every cycle skips it. Every Job started with devops k8s run-job copies the template and runs v0.2.33, three releases behind, and the release check in k8s/README.md step 4 fails without any condition, metric or alert saying so.

    Evidence

    Live, read-only, 2026-10-17:

    • Application argocd/devops: spec.source.kustomize.images = ghcr.io/dan-petty/devops-cli/service:latest@sha256:e156dd85... (v0.2.33), last written 2026-10-10T14:32:44Z. status.summary has no images.
    • GHCR, read anonymously: v0.2.34 = 42410af0..., v0.2.35 = 058705d1..., v0.2.36 = latest = sha256:52486017....
    • CronJob devops/devops-cli (suspend: true) and Deployment devops/roadmap-service (replicas: 0) both carry the v0.2.33 digest. Namespace devops has no pods and no Jobs.
    • ImageUpdater argocd/devops (controller v1.3.0): Ready=True (ReconcileSucceeded), Error=False, imagesManaged 0, lastUpdatedAt 2026-10-10T14:32:44Z; live spec forceUpdate: false (CRD default).
    • Loki, image-updater container: the last images_considered=1 cycle was 2026-10-11T01:43:23Z; since 01:45:23Z about 4,800 cycles logged images_considered=0 images_skipped=1 images_updated=0.
    • Image Updater v1.3.0 source: GetImagesFromApplication (pkg/argocd/argocd.go:1142-1163) builds the live list from app.Status.Summary.Images plus any image with ForceUpdate; UpdateApplication (pkg/argocd/update.go:62-67) skips the rest. update.go:222-230 skips the write once the spec already names the digest, so forceUpdate does not write every cycle.
    • Prometheus scrapes no argocd_image_updater_* series.

    Repo:

    • k8s/argocd/image-updater-values.yaml:17-23 sets commonUpdateSettings: {updateStrategy: digest} only; the header (:3-9) does not mention needing a running pod.
    • k8s/devops/cronjob.yaml:1-13 makes the CronJob an always-suspended template; Jobs from devops k8s run-job (src/devops_cli/commands/k8s/cluster_jobs.py) set no ownerReference, so their pods never enter the Application tree.
    • k8s/README.md:422 (release step 3) and :432 (Service Image Updates) promise both workloads move within one poll; :423 (step 4) checks the Application names the latest digest.
    • tests/test_k8s_argocd_apps.py:465 (test_image_updater_keeps_only_application_devops_on_the_digest_of_service_latest) pins the strategy.

    Remedy

    1. Test first: extend test_image_updater_keeps_only_application_devops_on_the_digest_of_service_latest to assert forceUpdate is True next to updateStrategy == "digest" (fails today).
    2. k8s/argocd/image-updater-values.yaml: add forceUpdate: true under the service image's commonUpdateSettings, and say in the header why: the CronJob is a suspended template and run-job Jobs are outside the Application tree, so no running pod reports the image.
    3. k8s/README.md Service Image Updates (around :432): the update works with zero replicas because of forceUpdate; imagesManaged: 0 on the ImageUpdater means nothing is tracked.
    4. Detection: make the step-4 release check executable, in devops argo cd apps status devops or the release rehearsal (fix(release): a release pull request rehearses the cut and the release job read-only, so a green pull request means the release job passes on merge #1425/feat(release): a release is cut only after every argo cd application builds at the release head and its live changes are shown #1343): compare the Application's digest with the anonymous GHCR service:latest digest and report a mismatch as an error.
    5. changelog.d/<issue>.md under ### Fixed.
      Depends on: the item that pins automated.enabled and turns the devops Application's sync back on; without it Image Updater writes the new digest into the spec and Argo CD never applies it.

    Verification after both merge: within one 2-minute poll the Application names sha256:52486017... (or the then-current latest), and the CronJob template carries it.

    Priority: P2. Severity medium: every in-cluster run-job runs a release three versions old, unreported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions