Skip to content

feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387

Closed as not planned
1 of 2 issues completed

Description

@dan-petty

Tracking issue

This issue is an epic. It tracks the two pull requests of the section "Delivery". One pull request closes each child issue. No pull request closes this issue. This issue closes when all of its child issues close.

The multi-line secret item that the section "Dependencies and order" names is merged as #1962.


Refreshed plan (2026-10-17, unblocking review)

This section supersedes any text below that conflicts with it.

Decisions

  • Decision D5 (owner, 2026-10-17): Argo CD records deployments with its own Deployments-only GitHub App, with no Service hop; opt-in for GitHub-sourced single-source Applications; the App's owner follows D2.
  • Decision D2 (owner, 2026-10-17): in-cluster jobs act as an organization-owned GitHub App installation (organization takes the owner's current login after the personal account is renamed); appeal the suspension in parallel. So the Deployments App is owned by that organization, and every https://github.com/<owner>/devops-cli repoURL stays valid after the move.
  • Two pull requests, not one. A notification service that fails to build stops every notification the controller sends, feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393's included: notifications-engine's NewAPI (pkg/api/api.go) returns the first service factory error, and the controller (pkg/controller/controller.go) then logs "Failed to get api" and skips each Application. So service.github may only merge once the Secret already holds the App's values.
  • All ten single-source Applications sourced from this repository opt in. This keeps the body's one environment per Application for every Application the notifier can serve.
  • The App ID and installation ID are plain settings, and only the private key is a keyring credential. Neither ID is a credential, and settings keep them out of git just the same.
  • The three Secret entries are optional in PR 1, so a stack push keeps working before the organization and the App exist. PR 2 makes them required. From then on, a push that left out an ID would remove it from the live Secret: unlike a keyring value, a setting is not adopted from the cluster, and the server-side apply drops a key that the devops-cli field manager owned. The controller would then send nothing.

Scope

Delivery

  1. PR 1, S, closes feat(k8s): the cluster secret push stores the GitHub App ID, installation ID and private key of the Argo CD deployments app in argocd-notifications-secret #2000, which carries the PR 1 criteria below. Settings argocd.github_app_id and argocd.github_app_installation_id, managed credential argocd.github_app_private_key (keyring argocd_github_app_private_key), the Secret row's three optional entries, the README rows, and tests. If feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393 has already added the row, PR 1 adds only the entries.
  2. A person creates and installs the App and pushes the row (Pending a person, below).
  3. PR 2, S, closes dan-petty/homelab#330. The shared notifications configuration if feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393 hasn't added it, plus service.github, the three entries made required, the template blocks, the opt-in annotations, the README section and tests. It merges only after step 2.

Effort: M in total (was L). Value: S. Priority stays P3, since it blocks nothing.

Acceptance criteria

These replace the body's criteria "Argo CD sends, inside the cluster", "The network admits exactly that", "One token reaches both sides", "A token verifier and an argocd provider", "Consumers can take payloads" and "The Service records the outcome in GitHub", and its Pending-a-person list. The shared configuration criterion and the last three criteria stay.

  • PR 1: argocd.github_app_private_key is in SECRET_CONFIG_OPTIONS and KEYRING_KEYS. The two ID settings are plain settings on ArgoCDConfig.
  • PR 1: row argocd/argocd-notifications-secret (stack infra, no restart target, for the reasons the shared criterion gives) has three entries. github-appID and github-installationID come from the settings (SettingSource), and github-privateKey from the keyring with no generator. In PR 1 all three are optional, so a missing one is skipped with a warning.
  • PR 1, tested over the keyring and cluster fakes: a three-line PEM-shaped keyring value reaches the Secret byte for byte; --plan and --dry-run name the keys without values, and --dry-run makes no request; the Cluster Secrets table in k8s/README.md lists the three rows.
  • PR 2: service.github holds only appID: $github-appID, installationID: $github-installationID and privateKey: $github-privateKey. No App ID, installation ID or key value is in git.
  • PR 2: the three entries are required, and the Cluster Secrets table says so. Tested over the fakes: with an ID setting unset and the key adopted from the live Secret, the push fails naming the setting and writes nothing, so no key is dropped from the live Secret.
  • PR 2: each of the four catalog templates gains a github.deployment block. state is the constant success (app-deployed), failure (app-sync-failed) or error (app-health-degraded, app-sync-status-unknown), and environment is {{.app.metadata.name}}.
  • PR 2: each block writes out autoMerge: false and requiredContexts: [], because the notifier defaults autoMerge to true and passes requiredContexts through as given. No block sets environmentURL, logURL, reference or transientEnvironment.
  • PR 2: each template's message is built only from the sync status, health status and operation phase, each read with sprig's dig and an empty default (for example Synced, Healthy, Succeeded). The notifier writes message as the status description, cut to 140 characters. No template references .context, and no message holds free text.
  • PR 2: subscriptions are opt-in. The annotations notifications.argoproj.io/subscribe.<trigger>.github: "", one for each of the four triggers, sit on exactly the Applications in git that have one spec.source whose repoURL is this repository (https://github.com/<owner>/devops-cli, with or without .git; 10 today), and notifications.subscriptions has no github entry.
  • PR 2: a test derives the subscribed set from the files. The gate fails if the annotation stays on a multi-source Application, an Application sourced from another repository, or one feat(k8s): Read homelab config from in-cluster Gitea, drop overrides #1291 moves to Gitea. The notifier fails on a repoURL it cannot split (a multi-source Application has no spec.source), and it cannot write to a repository the App is not installed on.
  • PR 2: tests in tests/test_k8s_argocd_apps.py, or the tests/test_k8s_argocd_notifications.py that feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393 may add, assert every PR 2 criterion above.
  • PR 2: the GitOps section of k8s/README.md describes the App: its owner, its two permissions, its single installation, and how its IDs and key are stored and pushed.
  • Pending a person, before PR 2 merges, once D2's organization exists: create and install the App as in Scope. Run devops config set argocd.github_app_id <id> and the same for argocd.github_app_installation_id, then store the key with the multi-line secret item's file or stdin input. Run uv run devops k8s push-secrets --only argocd/argocd-notifications-secret --plan, then the same without --plan. The plan must show all three keys before PR 2 merges.
  • Pending a person, after PR 2 merges and Argo CD syncs argocd: kubectl -n argocd get deploy argocd-notifications-controller shows 1/1, and its log has no error for service github.
  • Pending a person, after the next merge into main that changes the monitoring Application: within about two minutes, uv run devops gh api "repos/<owner>/<name>/deployments?environment=monitoring" lists a deployment for the synced commit whose creator is the App's bot, and uv run devops gh api "repos/<owner>/<name>/deployments/<id>/statuses" shows its success status.

Current references (main 3dd7fa6)

  • k8s/argocd/values.yaml:84-85: notifications.enabled: false.
  • src/devops_cli/commands/k8s/stack_lifecycle.py:90-96: the argocd Helm release in stack infra (the body's :79-93 is stale).
  • src/devops_cli/commands/k8s/stack_lifecycle.py:178: deploy-stack applies the argocd perimeter (the body's "synced by no Application" is stale).
  • k8s/argocd/networkpolicy.yaml:75-87: egress on TCP 443 (and 80 and 22) to 0.0.0.0/0, with 169.254.169.254/32 excepted.
  • Single-source GitHub Applications: k8s/argocd/apps/{base,devops,gpu-feature-discovery,ingress,llm,logging,monitoring,otel}.yaml:11 and k8s/argocd/bootstrap/{bootstrap,cluster}.yaml:9. The other 14 Applications under k8s/argocd/apps/ are multi-source, so git holds 24 Applications in all.
  • src/devops_cli/k8s/cluster_secrets.py:56-65 (SettingSource), :109-123 (SecretEntry: required, generator, adopt_from), :161 (CLUSTER_SECRETS).
  • src/devops_cli/k8s/secret_push.py:486-505 (_plan_entry: an empty keyring entry adopts the live value, while a setting is only read), :147-153 (SecretPlan.data: a skipped entry is left out), :581-590 (server-side apply under field manager devops-cli), :688-690 (a Secret with any data is applied), :710-711 (a missing required entry stops the push before any write).
  • src/devops_cli/config/options.py:228-244 (SECRET_CONFIG_OPTIONS), :246 (KEYRING_KEYS); src/devops_cli/config/settings.py:186-188 (ArgoCDConfig, url only).
  • src/devops_cli/commands/config.py:173-183: today's hidden prompt reads one line, which is why the key needs the multi-line secret item.
  • tests/test_k8s_push_secrets.py:100 (the table's pinned rows), :330-334 (restart targets), :387 (README table), :617 (optional source skipped).
  • k8s/README.md:307: Cluster Secrets.
  • notifications-engine, read on its default branch on 2026-10-17 (PR 2 rechecks them at the commit Argo CD v3.5.3 pins). In pkg/services/github.go: appID and installationID are cast to int64, the description is trunc(notification.Message, 140), AutoMerge defaults to true, RequiredContexts is copied as given, and the default paths are {{.app.spec.source.repoURL}} and {{.app.status.operationState.syncResult.revision}}. In pkg/api/api.go: NewAPI returns the first service factory error. In pkg/controller/controller.go: a failed GetAPI is logged and the Application is skipped.

Dependencies and order


Problem

A failing Application tells no one

Nothing in GitHub says what runs in the cluster

  • The check after a merge is manual. The Applications track main (k8s/README.md, "When a pull request merges into main", step 1), so Argo CD applies every merge into main. After a merge, a person checks devops argo cd apps status devops and ingress (step 4).
  • Nothing records the result.
    • No commit, release or pull request shows it.
    • Nothing under src/ creates a GitHub deployment or a commit status. A search for /deployments finds only the LLM gateway's model deployments.
  • Only the Service can write it as the machine account.

What the cluster and Argo CD do today

  • Only the devops side blocks this traffic.
    • roadmap-service admits only Traefik and the monitoring namespace (k8s/devops/roadmap-service/networkpolicy.yaml:15-33).
    • The argocd perimeter (k8s/argocd/networkpolicy.yaml) is synced by no Application, by design (tests/test_k8s_argocd_apps.py:353; feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082). Namespace argocd holds only the chart's four Ingress-only policies, so its egress is open.
  • Only some Applications report one revision.
    • On 2026-10-08, 10 of the 22 Applications have one git source in this repository and report status.operationState.syncResult.revision.
    • The other 12 are multi-source Helm Applications (a chart plus the $values ref) and report no single revision there.
    • One Application has never run an operation, so it has no operation state at all.
  • The chart ships no triggers or templates. argo-cd chart 10.9.6 sets notifications.triggers: {} and notifications.templates: {}. Argo CD's catalog comes only from notifications_catalog/install.yaml. In v3.5.3, that catalog's on-deployed, on-sync-failed, on-health-degraded and on-sync-status-unknown each fire once per app.status.operationState?.syncResult?.revision, and each sends its own template.
  • The webhook notifier sends only the headers it is given. It sets no Content-Type (notifications-engine pkg/services/webhook.go), and feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386 answers 415 without application/json.
  • An absent field doesn't render as empty. The notifier parses bodies with Go's text/template and no missingkey option (webhook.go:35). An absent key, or a field under one, prints <no value>. The controller's templates do have sprig's functions (pkg/templates/service.go:20), including dig and toJson.

Acceptance criteria

  • The shared notifications configuration. feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393 uses the same controller, so this is defined once, here. Whichever of the two items lands first adds it, and the second adds only its own service, template bodies, subscriptions and Secret entry:

    • notifications.enabled: true, and notifications.secret.create: false, so devops k8s push-secrets owns argocd-notifications-secret;
    • notifications.argocdUrl left empty, so no homelab host enters git;
    • controller requests of 10m and 32Mi, and limits of 100m and 128Mi;
    • the triggers each item subscribes, in notifications.triggers, copied from the catalog of the running Argo CD version (v3.5.3) with their catalog when, oncePer and template names (app-deployed, app-sync-failed, app-health-degraded, app-sync-status-unknown). An item adds only the triggers that are missing, and never redefines one;
    • one template per trigger, holding one webhook.<service> body for each service that receives it;
    • row argocd/argocd-notifications-secret, stack infra, whose Helm releases include argocd (src/devops_cli/commands/k8s/stack_lifecycle.py:79-93). It restarts nothing: the controller reads the Secret through an informer (nc_controller.go:94, :102 in v3.5.3), and notifications-engine drops its cached configuration on every change (pkg/api/factory.go:60-70). A restart target would also fail test_every_restart_target_is_a_manifest_workload_or_helm_release (tests/test_k8s_push_secrets.py:330-334), because argocd-notifications-controller is neither a manifest workload nor a Helm release.
  • Argo CD sends, inside the cluster. On top of the shared configuration, k8s/argocd/values.yaml sets:

    • A webhook service, service.webhook.devops-service, that posts to http://roadmap-service.devops.svc.cluster.local:8000/webhooks/argocd. It sends the headers Content-Type: application/json and Authorization: Bearer $devops-service-token, and sets retryMax: 1 (see Key questions).

    • The four catalog triggers on-deployed, on-sync-failed, on-health-degraded and on-sync-status-unknown, in the shared configuration.

    • A webhook.devops-service body in each of their four templates. Each body is a JSON object with:

      • a constant trigger: deployed, sync-failed, health-degraded or sync-status-unknown;
      • the Application's name;
      • its source repoURL;
      • the sync revision (status.operationState.syncResult.revision, the value oncePer uses);
      • the sync status, the health status and the operation phase.

      Every optional field is read with sprig's dig and an empty default and written with toJson, so an absent field renders "". A body has no message text. No template references .context: the chart fills context.argocdUrl from global.domain when notifications.argocdUrl is empty.

    • A default subscription that sends those four triggers to devops-service for every Application.

    Checked in tests/test_k8s_argocd_apps.py:

    • the URL is the Service's cluster DNS name;
    • both headers are set, the Authorization header names the Secret key, and retryMax is 1;
    • the four triggers are subscribed, each with its catalog when and oncePer;
    • each template's webhook.devops-service keys equal the payload model's fields, and its trigger matches its trigger;
    • every field except trigger and the name is read through dig;
    • no template mentions .context.
  • The network admits exactly that.

    • roadmap-service's ingress policy gains ingress on TCP 8000 from the notifications controller only: one peer with namespace argocd and pod label app.kubernetes.io/name: argocd-notifications-controller, the shape of its Traefik peer (k8s/devops/roadmap-service/networkpolicy.yaml:15-25). This is the only rule with a live effect today.
    • The argocd perimeter gains egress to namespace devops on TCP 8000, so the file is right when it is applied (fix(k8s): deploy-stack applies the monitoring namespace perimeter #913's follow-up, feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082). The peer is a namespace selector alone, with ports:, the shape kube-router accepts (k8s/devops/networkpolicy.yaml:25-26).

    Checked in tests/test_k8s_network_policies.py and tests/test_k8s_roadmap_service.py.

  • One token reaches both sides. It is the keyring entry service_argocd_token, behind the managed credential service.argocd_token.

    • Key devops-service-token in the shared row argocd/argocd-notifications-secret.
      • It is generated with token_urlsafe(32) when neither the keyring nor the cluster has it, and a live value that the keyring lacks is adopted.
      • The controller picks up a change without a restart (the shared configuration).
    • devops/devops-cli gains DEVOPS_CLI_SERVICE_ARGOCD_TOKEN from the same keyring entry, adopted from that row's key (adopt_from). DEVOPS_CLI_AI_API_KEY does the same with the gateway's master key (src/devops_cli/k8s/cluster_secrets.py:229-233).

    The Cluster Secrets table in k8s/README.md gains both rows. Checked in tests/test_k8s_push_secrets.py over the keyring and cluster fakes (tests/cluster_secret_fakes.py). --dry-run prints the requests with placeholders and makes none.

  • A token verifier and an argocd provider. feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386's registry gains:

  • Consumers can take payloads. A feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386 consumer may declare that it takes payloads.

    • Its batch then carries every validated payload since its last batch, in arrival order, up to CONST_SERVICE_MAX_PENDING_PAYLOADS per worker.
    • When that is full, the route answers 503, and the sender re-sends.
    • Consumers that don't declare it are unchanged.

    Tests: such a consumer receives the validated payloads, and a full worker gets 503.

  • The Service records the outcome in GitHub. A deployments consumer takes payloads, on its own worker per repository. It handles each payload that has a subject and a revision:

    • The outcome comes from trigger, never from the status fields: success for deployed, failure for sync-failed, and error for health-degraded and sync-status-unknown.
    • The first payload for an Application and revision creates a deployment: ref is the revision, environment is the Application's name, auto_merge: false and required_contexts: []. A later payload finds that deployment by sha and environment.
    • A status is added only when the outcome differs from the deployment's latest status, so a re-sent notification adds nothing.
    • A status's description comes from the enum fields alone (for example Synced, Healthy, Succeeded), with no environment_url and no log_url.
    • Every call goes through the store's GitHub seam, as the machine account, and never in the request handler. That seam is GhRunner today (src/devops_cli/roadmap/github_store.py:136), and refactor(github): the github session owns transport, ledger, error classes and link pagination #983's session once it lands.
    • A failed call is logged and counted with the Application and revision.

    Checked with the runner fake:

    • a deployed payload makes one deployment and one success status;
    • a second deployed payload for the same revision makes no write, and a health-degraded one adds one error status;
    • a sync-status-unknown payload with phase Succeeded and health Healthy is recorded as error;
    • a multi-source payload (empty repository URL and revision), a payload for an unmanaged repository, and a payload for an Application that never synced (empty phase and revision) each validate and make no call;
    • a request without the token gets 401, a body with an extra field gets 400, and neither makes a call.
  • No new test reaches the network, and each call phase stays under 1 s.

  • uv run devops ci passes within its 5-minute budget.

  • Pending a person, after merge:

    • run uv run devops k8s push-secrets --only argocd/argocd-notifications-secret --plan, then the same without --plan, then --only devops/devops-cli;
    • once Argo CD has synced the argocd Application, check that kubectl -n argocd get deploy argocd-notifications-controller shows 1/1;
    • after the next merge into main that changes the monitoring Application, which feat(k8s): Read homelab config from in-cluster Gitea, drop overrides #1291 leaves on GitHub, check that roadmap-service is Ready;
    • then check, within about two minutes, that uv run devops gh api "repos/<owner>/<name>/deployments?environment=monitoring" lists the synced commit with a success status, and that devops_cli_service_webhook_deliveries_total{provider="argocd"} counts the delivery.

Key questions

  • What if the Service is down when Argo CD sends, as it is while its pod restarts after a release? Delivery is at least once, for as long as the trigger's condition holds.
    • Argo CD retries the request. If it still fails, the controller clears its already-notified mark (notifications-engine pkg/controller/controller.go:234-243, at the commit v3.5.3 pins).
    • The controller re-evaluates every Application at its 60 s resync (notification_controller/controller/controller.go:39 in v3.5.3).
    • So a release's on-deployed events arrive within about a minute of roadmap-service being Ready again.
    • An event whose condition clears before then, such as a Degraded state that recovers, leaves no record. A lost event means a missing record, never a wrong one.
    • A 4xx is re-sent too, so a wrong token shows up as rejected deliveries every minute.
  • Why retryMax: 1? Because the resync already re-sends.
  • Should the Service read Application status on its poll tick instead (ADR 0003)? Proposed: no.
    • roadmap-service has no Kubernetes token (automountServiceAccountToken: false, k8s/devops/roadmap-service/deployment.yaml:27), and the devops perimeter allows no egress to the API server (k8s/devops/networkpolicy.yaml).
    • Giving the public-facing pod a cluster token, to repeat what Argo CD's own resync already does, isn't worth it.
  • Argo CD's own GitHub notifier instead? Proposed: no.
  • One environment per Application, or one for the whole cluster? Proposed: one per Application.
    • Argo CD reports per Application, and GitHub shows each environment's latest deployment.
    • A single environment would need the Service to know the full set of Applications and wait for all of them.
  • Multi-source Helm Applications? Proposed: logged and counted, but not written to GitHub. They report no single revision, and their git revision is only the $values ref inside syncResult.revisions.
  • What about the Applications that feat(k8s): Read homelab config from in-cluster Gitea, drop overrides #1291 moves to Gitea? devops and ingress will render from a private repository on the in-cluster Gitea. Their repository URL then matches no managed repository, so they are logged and counted like multi-source Applications, with no GitHub record. The live check uses monitoring.
  • Do deployments on a public repository expose the homelab? Proposed: no more than the repository already does.
    • The Application names are in k8s/argocd/apps/, and the revisions are public commits.
    • Statuses carry no URL and no message.
    • They do show when the cluster deployed.
  • Should the Service also post to chat? Proposed: no. Argo CD's own mattermost webhook service does that (feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393). A down Service still slows it through the shared processor, which retryMax: 1 bounds, and feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393 sets retryMax: 1 on its own service too.
  • Who enables the controller if feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393 lands first? Whichever lands first adds the shared notifications configuration (Acceptance criteria). The second adds only its own service, template bodies, subscriptions and Secret entry.

Strategic alignment

Alternatives check of 2026-11-01: covers.
Tool: argoproj/notifications-engine (https://github.com/argoproj/notifications-engine), Apache-2.0, last activity 2026-10-01, maintained.

Proposed design

Problem statement

Argo CD has no way to record a deployment outcome in GitHub. A failed sync or a broken build is found only when a person checks by hand. This item uses Argo CD's own GitHub notifier (notifications-engine) to write a deployment and its status on the synced commit for each single-source Application of this repository, through a dedicated Deployments-only GitHub App owned by the D2 organization.

Acceptance criteria

Requirement: PR 1 settings and credential

argocd.github_app_private_key SHALL be in SECRET_CONFIG_OPTIONS and KEYRING_KEYS, and the two ID settings SHALL be plain settings on ArgoCDConfig.

Scenario: Settings registered

  • WHEN The code in src/devops_cli/config/options.py and src/devops_cli/config/settings.py is read
  • THEN argocd.github_app_id and argocd.github_app_installation_id are plain settings on ArgoCDConfig, and argocd.github_app_private_key is in SECRET_CONFIG_OPTIONS and KEYRING_KEYS

Requirement: PR 1 secret row optional entries

Row argocd/argocd-notifications-secret SHALL have three optional entries: github-appID from a setting, github-installationID from a setting, and github-privateKey from the keyring with no generator.

Scenario: Missing entry skipped with warning

  • WHEN A push runs over the keyring and cluster fakes with one entry unset
  • THEN The push succeeds, the missing key is absent from the Secret, and a warning names the missing entry

Requirement: PR 1 PEM key integrity

A three-line PEM-shaped keyring value SHALL reach the Secret byte for byte, and --plan and --dry-run SHALL name the keys without values.

Scenario: PEM value preserved

  • WHEN A push runs over the keyring and cluster fakes with a three-line PEM value in the keyring
  • THEN The Secret holds the value byte for byte, --plan names the keys without values, and --dry-run makes no request

Requirement: PR 2 service.github config

service.github SHALL hold only appID, installationID and privateKey, and no App ID, installation ID or key value SHALL be in git.

Scenario: No credential in git

  • WHEN The repository is searched for the App ID, installation ID and key values
  • THEN None appear in any tracked file, and k8s/argocd/values.yaml shows service.github with exactly three keys

Requirement: PR 2 required entries

The three entries SHALL be required, and a push with an ID setting unset SHALL fail naming the setting and write nothing.

Scenario: Push fails on missing setting

  • WHEN A push runs over the fakes with an ID setting unset and the key adopted from the live Secret
  • THEN The push exits with an error naming the setting, and no write request is made

Requirement: PR 2 template blocks

Each of the four catalog templates SHALL gain a github.deployment block with the correct state constant and environment set to the Application name.

Scenario: State and environment correct

  • WHEN The four templates in k8s/argocd/values.yaml are read
  • THEN Each has a github.deployment block with state as success, failure or error, and environment as {{.app.metadata.name}}

Requirement: PR 2 autoMerge and requiredContexts

Each block SHALL write autoMerge: false and requiredContexts: [], and SHALL NOT set environmentURL, logURL, reference or transientEnvironment.

Scenario: Excluded keys absent

  • WHEN The four templates are read
  • THEN autoMerge is false, requiredContexts is an empty list, and the four excluded keys are absent

Requirement: PR 2 message construction

Each template's message SHALL be built only from the sync status, health status and operation phase, each read with sprig's dig and an empty default, and SHALL NOT reference .context or hold free text.

Scenario: Message uses dig only

  • WHEN The four templates are read
  • THEN Each message uses dig with an empty default for the three fields, no template references .context, and no message holds free text

Requirement: PR 2 opt-in annotations

The subscribe annotations SHALL sit on exactly the Applications in git that have one spec.source whose repoURL is this repository, and notifications.subscriptions SHALL have no github entry.

Scenario: Annotations on correct set

  • WHEN The Application manifests under k8s/argocd/apps/ and k8s/argocd/bootstrap/ are read
  • THEN The annotations are on exactly the single-source GitHub Applications, and notifications.subscriptions has no github entry

Requirement: PR 2 test gate

A test SHALL derive the subscribed set from the files and SHALL fail if the annotation stays on a multi-source Application, an Application from another repository, or one that #1291 moves to Gitea.

Scenario: Gate fails on wrong annotation

  • WHEN The test in tests/test_k8s_argocd_apps.py runs against the Application files
  • THEN It parses the files, builds the expected set, and fails on a mismatch

Requirement: PR 2 README documentation

The GitOps section of k8s/README.md SHALL describe the App: its owner, its two permissions, its single installation, and how its IDs and key are stored and pushed.

Scenario: README names all details

  • WHEN The GitOps section of k8s/README.md is read
  • THEN It names the owner, the Deployments read/write and Metadata read permissions, the single installation, and the storage and push steps

Existing Tool Considered

argoproj/notifications-engine (https://github.com/argoproj/notifications-engine), Apache-2.0, last activity 2026-10-01, maintained. It provides the service.github notification service that writes a GitHub deployment and its status via a GitHub App (appID, installationID, privateKey). It lacks: the project must wire the three secret entries into argocd-notifications-secret, add the per-Application opt-in annotations, add the four github.deployment template blocks, and a person must create and install the App.

Key questions

  • The alternatives check found argoproj/notifications-engine covers the need. Adopt the tool or keep the item with a reason?: Adopt the tool. The plan already configures Argo CD's built-in notifications-engine as the GitHub notifier. The project writes only configuration (values.yaml, annotations, templates) and secret push code. No replacement is needed. (a person decides)
  • How does Argo CD record deployments?: Decision D5 (owner, 2026-10-17): Argo CD records deployments with its own Deployments-only GitHub App, with no Service hop. Opt-in for GitHub-sourced single-source Applications. The App's owner follows D2. (best practice) [sources: k8s/argocd/values.yaml, src/devops_cli/k8s/cluster_secrets.py]
    • Chosen: Argo CD's own GitHub notifier with a Deployments-only App. Chosen by D5. No Service hop, no second identity on the roadmap Service, and the App is limited to two permissions on one repository.
    • Rejected: Roadmap Service writes to GitHub as the machine account. Rejected by D5. The Service already has a broader token, and a notification service that fails to build stops every notification the controller sends.
  • Who owns the Deployments-only GitHub App?: Decision D2 (owner, 2026-10-17): in-cluster jobs act as an organization-owned GitHub App installation. The organization takes the owner's current login after the personal account is renamed. The App is owned by that organization. (best practice) [sources: docs/adr/0002-roadmap-jobs-act-as-a-machine-account.md]
    • Chosen: Organization-owned App (D2). Chosen by D2. Every https://github.com//devops-cli repoURL stays valid after the move.
    • Rejected: Personal-account App. Rejected. D2 moves to an organization, and the App must be installable only on that organization.
  • What is the scope of retryMax?: retryMax applies only to feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393's webhook service. Argo CD's GitHub notifier has no retryMax setting. The controller's own 60 s resync re-sends a failed delivery. (best practice) [sources: k8s/argocd/values.yaml]
  • Do multi-source Helm Applications opt in?: No. Only single-source GitHub Applications whose repoURL is this repository get the subscribe annotation. Multi-source Applications have no spec.source and the notifier cannot write to them. (proposed)
    • Chosen: Exclude multi-source Applications. Chosen. They report no single revision, and the notifier cannot split a repoURL it does not have.
    • Rejected: Include multi-source Applications. Rejected. The notifier fails on a repoURL it cannot split, and it cannot write to a repository the App is not installed on.
  • What about the Applications that feat(k8s): Read homelab config from in-cluster Gitea, drop overrides #1291 moves to Gitea?: Same as multi-source. Their repoURL will be the Gitea address, which matches no managed GitHub repository. They do not get the annotation and get no GitHub record. (best practice) [sources: k8s/argocd/apps/devops.yaml, k8s/argocd/apps/ingress.yaml]
    • Chosen: Exclude Gitea-sourced Applications. Chosen. The App is installed on the GitHub repository only, and the Gitea URL matches no managed repository.
    • Rejected: Include Gitea-sourced Applications. Rejected. The App is not installed on Gitea, and the notifier cannot write there.
  • Do deployments on a public repository expose the homelab?: No more than the repository already does. The Application names are in git, the revisions are public commits, and the status description is made of three status values with no free text, no URL and no log link. (proposed)
    • Chosen: Accept the exposure. Chosen. The information is already public in the repository. The status adds only when the cluster deployed.
    • Rejected: Make the repository private. Rejected. The repository is public by design, and making it private is out of scope.
  • Should the Service also post to chat?: No. Argo CD's own mattermost webhook service does that (feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393). A down Service still slows it through the shared processor, which retryMax: 1 bounds. (best practice) [sources: k8s/argocd/values.yaml]
  • Who enables the notifications controller if feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393 lands first?: Whichever of the two items lands first adds the shared notifications configuration. The second adds only its own service, template bodies, subscriptions and Secret entry. (best practice) [sources: k8s/argocd/values.yaml, src/devops_cli/k8s/cluster_secrets.py]
    • Chosen: First-lands-first adds shared config. Chosen. Avoids duplication and keeps the configuration in one place.
    • Rejected: Each item adds its own copy. Rejected. Duplicates the configuration and risks drift.

Open questions

  • The alternatives check found argoproj/notifications-engine covers the need. Adopt the tool or keep the item with a reason? (a person decides)
  • The alternatives check found that https://github.com/argoproj/notifications-engine covers this item. Adopt the tool, or keep the item and give the reason. (a person decides)

Fit

Needs splitting into 2 items:

  1. PR 1 (feat(k8s): the cluster secret push stores the GitHub App ID, installation ID and private key of the Argo CD deployments app in argocd-notifications-secret #2000): cluster secret push stores the GitHub App ID, installation ID and private key in argocd-notifications-secret
  2. PR 2 (#2003): Argo CD's GitHub notifier writes a deployment and its status on the synced commit for each single-source Application

Suspected block

D2's organization move is not yet filed. The Deployments-only GitHub App must be created and installed under that organization before PR 2 merges. The multi-line secret item is also not yet filed, and PR 2 waits on it.

Dependencies

#1393

Sub-issues

Sub-issues

1 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added
    type/feature
    scope/k8s
    scope/github
    on Oct 8, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    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.

    • Priority: P2-Medium. It improves visibility of deploy outcomes but does not block operations; failures are still discoverable manually and via dan-petty/devops-cli#1393's chat notifications.
    • Value: Medium. It gives a persistent, per-commit record of what actually ran in the cluster, reducing manual checking, but the system remains operable without it.
    • Effort: High. It requires wiring Argo CD notifications to the service, handling the missing Content-Type and template-rendering quirks, resolving multi-source Applications that report no single revision, and implementing GitHub deployment API calls from
  3. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    The '#913 follow-up' this item names is #1371 (v0.2.31), which applies k8s/argocd/networkpolicy.yaml; whichever lands second rebases on the file. Found by the 2026-10-08 backlog review.

  4. added
    status/blocked
    on Oct 11, 2026
  5. dan-petty commented on Oct 11, 2026

    @dan-petty
    OwnerAuthor

    Blocked by #1562: the roadmap Service's machine account is suspended, and the Service is held at 0 replicas. This item develops the Service or can only be checked on it, so it waits until the account is reinstated or the jobs act as a GitHub App.


    Generated by Claude Code

  6. changed the title [-]feat(k8s): argo cd reports each application's deploy outcome to the service inside the cluster, and the service records it as a github deployment on the synced commit[/-] [+]feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app[/+] on Oct 18, 2026
  7. removed
    status/blocked
    on Oct 18, 2026
  8. dan-petty commented on Oct 26, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Priority: P2-Medium. This item is important but not urgent for the project's core functionality.
    • Value: High. Users will see automated deployment status updates, improving workflow visibility.
    • Effort: Medium. The change requires moderate development effort and integration with existing systems.
    • Possible duplicate: dan-petty/homelab#330, which may ask for the same change. The model names argo cd's github notifier writes a deployment and its status on the synced commit for each single-source application of this repository as the change that both ask for. The candidate and item dan-petty/homelab#330 ask for the same change to Argo CD's GitHub notifier. A person closes one of the two if that is so.
  9. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Refine cannot set this item to Ready at 0b76871 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • Argo CD retries the request. If it still fails, the controller clears its already-notified mark (notifications-engine pkg/controller/controller.go:234-243, at the commit v3.5.3 pins).
    • The controller re-evaluates every Application at its 60 s resync (notification_controller/controller/controller.go:39 in v3.5.3).
    • So a release's on-deployed events arrive within about a minute of roadmap-service being Ready again.
    • An event whose condition clears before then, such as a Degraded state that recovers, leaves no record. A lost event means a missing record, never a wrong one.
    • A 4xx is re-sent too, so a wrong token shows up as rejected deliveries every minute.
    • The controller has one processor by default (--processors-count, cmd/argocd-notification/commands/argocd_notification.go:179 in v3.5.3).
    • While the Service is down, each failed send holds that processor through its retry waits, which also delays Argo CD's other notifiers, feat(k8s): argo cd's notifications controller posts the devops application's deploys and every failed sync to mattermost's deploys channel #1393's included.
    • With retryMax: 1, a failed send waits 1 s instead of up to 7 s (1 + 2 + 4). retryMax: 0 would mean the default of 3.
    • roadmap-service has no Kubernetes token (automountServiceAccountToken: false, k8s/devops/roadmap-service/deployment.yaml:27), and the devops perimeter allows no egress to the API server (k8s/devops/networkpolicy.yaml).
    • Giving the public-facing pod a cluster token, to repeat what Argo CD's own resync already does, isn't worth it.
    • It takes only a GitHub App: a second identity, an installation on each repository, and a private key in the cluster.
    • The Service already writes to these repositories as the machine account (ADR 0002, refactor(github): one github session per identity owning token, quota and transport #767).
    • The trade-off: an App could be limited to deployments, while the machine token can do more. But that token is already in the cluster.
    • Argo CD reports per Application, and GitHub shows each environment's latest deployment.
    • A single environment would need the Service to know the full set of Applications and wait for all of them.
    • The Application names are in k8s/argocd/apps/, and the revisions are public commits.
    • Statuses carry no URL and no message.
    • They do show when the cluster deployed.
  10. added
    priority/p2-medium
    status/new
    effort/medium
    value/high
    on Oct 28, 2026
  11. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    Alternatives check: covers

    Tool: argoproj/notifications-engine (https://github.com/argoproj/notifications-engine)

    • License: Apache-2.0
    • Last activity: 2026-10-01
    • Maintained: yes

    Covers:

    • Provides the service.github notification service (pkg/services/github.go) that writes a GitHub deployment and its status on the synced commit via a GitHub App (appID, installationID, privateKey)
    • Casts appID/installationID to int64, truncates the message to 140 chars, and defaults AutoMerge to true with requiredContexts copied as given, matching the issue's template criteria

    Lacks:

    • It is the Argo CD in-cluster notifier library, not a standalone service; the project still must wire the three secret entries into argocd-notifications-secret, add the per-Application opt-in annotations and the four github.deployment template blocks, and run a person step to create/install the App

    Sources:

    Checked on 2026-11-01. A person decides what this means for the item. The check changes no label and closes no issue.

  12. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 6c57c85 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • The alternatives check found argoproj/notifications-engine covers the need. Adopt the tool or keep the item with a reason? (a person decides)
    • The alternatives check found that https://github.com/argoproj/notifications-engine covers this item. Adopt the tool, or keep the item and give the reason. (a person decides)
  13. dan-petty commented on Nov 4, 2026

    @dan-petty
    OwnerAuthor

    This tracker closes as not planned, and dan-petty/homelab#330 stays open. Its text says that it closes when all its child issues close. That text no longer applies, because dan-petty/homelab#330 is now the only open child, it stands alone, and its parent link does not gate it. The tracker adds no work.

    Proof:

    What moved, in the section Scope from dan-petty/devops-cli#1387 of dan-petty/homelab#330: D5; the App scope, with the owner changed to the personal account; the NewAPI reason, with its effect on the Mattermost notifier; the server-side apply reason; the Applications, recounted to 14; the step that the plan must show all three keys; the behavior of the notifier for a multi-source Application; and the answers on one environment per Application and on a public repository.

  14. removed
    status/new
    on Nov 4, 2026
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

    effort/mediumpriority/p2-mediumscope/githubscope/k8stype/featurevalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions