Skip to content

feat(argocd): accept the site repository as an outside source #6643

Closed as not planned

Description

@dan-petty

Problem

Checked at devops-cli main 3f8f7a9.

  • feat(argocd): deploy the danielpetty-com event-stream from its repository #6644 and feat(argocd): deploy the danielpetty-com Pixelfed manifests #6647 add Applications whose Git source is the private repository dan-petty/danielpetty.com. The devops-cli checks cannot handle such a source:
    • check_mainline_git_sources_safety_rule asserts that each Git source is https://github.com/dan-petty/devops-cli (tests/gate/k8s_checks/argocd_apps.py:232-252). Its purpose is GitHub and never Gitea (feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082).
    • discover_path_applications joins each spec.source.path to the devops-cli checkout, whatever the repoURL is (src/devops_cli/k8s/argocd_gate.py:68-89). For an outside repository, it reads a wrong or missing folder.
    • SourceTrees fetches each other repository with no credential: "a private one resolves only where the git configuration of the host gives a credential" (src/devops_cli/k8s/app_sources.py:1-9). write_path_renders (src/devops_cli/k8s/app_render.py:51-75, used by devops k8s lint, the kube-linter row of devops ci, src/devops_cli/commands/k8s/security_audit.py:136-146), collect_image_pins (src/devops_cli/k8s/image_pins.py:290-300, the Image Pins workflow) and check_argocd_gate (argocd_gate.py:235-245) use it.
    • The Image Pins workflow runs on k8s/** with persist-credentials: false and contents: read. In GitHub Actions the fetch of the private site repository fails, so these checks fail on each pull request after feat(argocd): deploy the danielpetty-com event-stream from its repository #6644.
    • If the fetch worked, devops k8s lint would apply the devops-cli .kube-linter.yaml to the site manifests, the Pixelfed pods that start as root included.
  • The site repository checks its own manifests with kubeconform, kube-linter and Trivy (dan-petty/danielpetty.com#29, job validate-k8s).

Proposed remedy

The Argo CD AppProject sourceRepos stays the access control. The devops-cli checks only need to know which sources they do not fetch. No open tool replaces these in-house checks, so the change stays in them.

  • One constant (for example CONST_K8S_ARGOCD_OUTSIDE_SOURCES) maps https://github.com/dan-petty/danielpetty.com to the one AppProject that may use it, danielpetty-com.
  • check_mainline_git_sources_safety_rule: a Git source is devops-cli, or an outside source of the constant in an Application of its project. Keep the Gitea checks.
  • SourceTrees: a source of an outside repository of the constant gets no folder and no fetch. write_path_renders, collect_image_pins, check_argocd_gate and discover_path_applications skip that source and print one line for each skip. Each other repository works as today.
  • A gate check: each outside source of the constant is in sourceRepos of its AppProject in k8s/argocd/apps/projects.yaml, and in no other project.
  • k8s/README.md, Argo CD section: the outside source, its project, and that its repository checks its own manifests.
  • Write the tests first, with fixture Applications.

Premise check: as in #6642 (#5134 plan step 12).

Acceptance criteria

  • New tests fail on main and pass on the branch:
    • the site repository passes in an Application of project danielpetty-com, and fails in project homelab;
    • a third repository fails, and a Gitea URL fails;
    • a dry run of the render records no fetch command for the site repository, and prints one skip line;
    • collect_image_pins and check_argocd_gate skip the site source and keep the result for each devops-cli source;
    • the gate check fails when the site repository is in sourceRepos of project homelab.
  • uv run devops ci --check --only k8s,kube-linter,domain passes.

Dependencies

Alternatives check of 2026-11-21: none.
Tool: none found.
Reason: Searches found only general linters and policy engines (kube-linter, Kyverno, OPA, argocd-diff-preview); none validates AppProject sourceRepos membership or lets the in-house gate skip an outside repository.

Lacks:

  • No allowlist of outside Git sources per AppProject
  • No skip of external source fetch in render and image-pin checks
  • No gate check that an outside source sits only in its project
  • Policy engines need a hand-written rule for sourceRepos

Activity

  1. added
    type/feature
    source/agent
    status/new
    effort/medium
    on Nov 21, 2026
  2. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor
  3. added
    value/high
    scope/argocd
    priority/p2-medium
    on Nov 21, 2026
  4. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • argocd-diff-preview render manifests from external private repository, results: 5
    • validate Argo CD Application source repo against AppProject sourceRepos tool, results: 5
    • argocd-diff-preview github repository, results: 5
    • Argo CD AppProject sourceRepos policy check conftest Kyverno, results: 5
    • kube-linter Argo CD Application manifests lint, results: 5
    • argocd-diff-preview, results: 5
    • argocd-diff-preview github dag-andersen, results: 5
    • argo cd appproject sourceRepos validation policy gate, results: 5
    • tool validates Argo CD Applications and AppProjects manifests offline, results: 5
    • rego policy AppProject sourceRepos conftest argocd, results: 5

    Sources:

  5. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor

    Closed as not planned. Service Applications come from the services ApplicationSet in the environment repository (dan-petty/infra#11, dan-petty/homelab#80), not from Application files in devops-cli. No checked-in Application file names a service repository, so the devops-cli source checks need no exception, and after #5134 step 17 devops-cli holds no Application of the environment. The AppProject of each service (dan-petty/infra#10) keeps sourceRepos as the access control. Each service repository checks its own manifests with the reusable workflow of dan-petty/infra#4 (dan-petty/danielpetty.com#29, job validate-k8s). #5296 must accept dan-petty/infra as a git source (comment there).

  6. removed
    status/new
    on Nov 21, 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/argocdsource/agenttype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions