Hamburger Cross Icon
ArgoCD Deployment Gate Collector - Lunar Collector

ArgoCD Deployment Gate Collector

Collector Experimental Ci CdOrchestration

Pulls a service's ArgoCD deployment posture from a central GitOps component onto its own component at the collected sha, so policies gate at PR time. The GitOps mapping defaults to a cataloger-set meta annotation (catalog-info opt-in). Use this or argocd-deployment-tracking per service, not both.

Add argocd-deployment-gate to your lunar-config.yml:
uses: github://earthly/lunar-lib/collectors/argocd-deployment-gate@v1.0.5

What This Integration Collects

This integration includes 1 collector that gather metadata from your systems.

Collector code

gate

Runs on a SERVICE repo and materializes that service's ArgoCD deployment posture onto its own Component JSON. Resolves which GitOps component + Application(s) to pull from — by default — the component's argocd/gitops-component (+ argocd/application) meta annotations, typically set by a company-specific cataloger via lunar catalog component --meta argocd/gitops-component <id>; falls back to the explicit gitops_component / application inputs, and optionally to Backstage catalog-info.yaml annotations when catalog_info_paths is set. Pulls the matching Application(s) from the GitOps component via lunar component get-json and writes them at the sha being collected (including a PR head sha), so the gitops/argocd policies gate it at PR time. Skips when no mapping is found.

argocd gitops cross-component get-json pull pr enforcement deployment posture catalog-info continuous delivery
Book a demo

How Collectors Fit into Lunar

Lunar watches your code and CI/CD systems to collect SDLC data from config files, test results, IaC, deployment configurations, security scans, and more.

Collectors are the automatic data-gathering layer. They extract structured metadata from your repositories and pipelines, feeding it into Lunar's centralized database where guardrails evaluate it to enforce your engineering standards.

Learn How Lunar Works
1
Collectors Gather Data This Integration
Triggered by code changes or CI pipelines, collectors extract metadata from config files, tool outputs, test results, and scans
2
{ } Centralized as JSON
All data merged into each component's unified metadata document
3
Guardrails Enforce Standards
Real-time feedback in PRs and AI workflows

Example Collected Data

This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:

{ } component.json Component JSON
{
  "cd": {
    "gitops": {
      "source": {
        "tool": "argocd",
        "integration": "pull",
        "pulled_from": "github.com/org/gitops"
      },
      "applications": [
        {
          "name": "payment-api",
          "path": "apps/payment-api.yaml",
          "valid": true,
          "kind": "Application",
          "project": "platform",
          "sync_policy": {
            "automated": true,
            "prune": true,
            "self_heal": true
          },
          "destination": {
            "server": "https://kubernetes.default.svc",
            "namespace": "payments"
          },
          "source_ref": {
            "repoURL": "https://github.com/org/gitops.git",
            "path": "payment-api",
            "targetRevision": "HEAD"
          },
          "images": ["myregistry.io/payment-api"]
        }
      ]
    }
  }
}

Configuration

Configure this collector in your lunar-config.yml.

Inputs

Input Required Default Description
gitops_component Required GitOps component id to pull the deployment posture from. Optional if the component has an `argocd/gitops-component` meta annotation set by a cataloger.
application Required ArgoCD Application name(s) to pull, comma-separated. Optional; defaults to the `argocd/application` meta annotation, or every app the GitOps component holds when neither is set.
catalog_info_paths Required Opt-in: comma-separated Backstage catalog-info file paths to read the mapping from (first match wins). Empty (default) uses the component meta annotation instead. Set e.g. "catalog-info.yaml,catalog-info.yml" to enable.
gitops_component_annotation Optional lunar.earthly.dev/gitops-component catalog-info annotation key carrying the GitOps component id (only used when catalog_info_paths is set).
application_annotation Optional lunar.earthly.dev/argocd-application catalog-info annotation key carrying the ArgoCD Application name(s) (only used when catalog_info_paths is set).

Documentation

View on GitHub

ArgoCD Deployment Gate Collector

Pulls a service's ArgoCD deployment posture from a central GitOps component onto the service's own component, gating at PR time.

Overview

Experimental. Runs on an app/service repo: it resolves which GitOps component + Application(s) to pull, then lunar component get-jsons them and materializes .cd.gitops onto the service's own component. The mapping defaults to the component's argocd/gitops-component (+ argocd/application) meta annotations set by a cataloger, falls back to explicit inputs, and optionally reads Backstage catalog-info.yaml when catalog_info_paths is set. It lands on the sha being collected — including a PR head sha — so the gitops/argocd policies gate the upcoming deployment at PR time. Don't also target the same service with argocd-deployment-tracking (both write .cd.gitops.applications and the hub appends across records, so pick one path per service).

Collected Data

This collector writes to the following Component JSON paths on the service's own component (in-band, at the collected sha):

Path Type Description
.cd.gitops.applications[] array The Application(s) pulled from the GitOps component
.cd.gitops.projects[] array The AppProjects referenced by those Applications
.cd.gitops.source object {tool: argocd, integration: pull, pulled_from}

Installation

Add to the service repo's lunar-config.yml:

collectors:
  - uses: github://earthly/lunar-lib/collectors/argocd-deployment-gate@v1.0.0
    on: ["domain:your-service-repo"]

By default the mapping comes from cataloger-set component meta annotations — set them (typically from your own cataloger) with:

lunar catalog component --meta argocd/gitops-component github.com/org/gitops
lunar catalog component --meta argocd/application payment-api   # optional; omit to pull every app the GitOps component holds

Alternatively pass gitops_component / application directly as inputs, or opt into Backstage catalog-info.yaml by setting catalog_info_paths (it then reads the lunar.earthly.dev/gitops-component + lunar.earthly.dev/argocd-application annotations).

Open Source

This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.

View Repository

Ready to Automate Your Standards?

See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 200+ built-in guardrails.

Works with any process
check AI agent rules & prompt files
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Paste your AGENTS.md or manual process doc and get guardrails in minutes
Book a Demo