ArgoCD Deployment Gate Collector
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.
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.
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.
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 →Example Collected Data
This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:
{
"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 GitHubArgoCD 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.
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.