argocheck 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. argocheck-0.1.0/LICENSE +21 -0
  2. argocheck-0.1.0/PKG-INFO +343 -0
  3. argocheck-0.1.0/README.md +310 -0
  4. argocheck-0.1.0/argocheck/__init__.py +0 -0
  5. argocheck-0.1.0/argocheck/cli.py +102 -0
  6. argocheck-0.1.0/argocheck/display.py +113 -0
  7. argocheck-0.1.0/argocheck/helm.py +275 -0
  8. argocheck-0.1.0/argocheck/models.py +58 -0
  9. argocheck-0.1.0/argocheck/parser.py +120 -0
  10. argocheck-0.1.0/argocheck/recents.py +32 -0
  11. argocheck-0.1.0/argocheck/resolver.py +239 -0
  12. argocheck-0.1.0/argocheck/server.py +202 -0
  13. argocheck-0.1.0/argocheck/static/app.js +1197 -0
  14. argocheck-0.1.0/argocheck/static/github-dark.min.css +10 -0
  15. argocheck-0.1.0/argocheck/static/highlight.min.js +1244 -0
  16. argocheck-0.1.0/argocheck/static/index.html +17 -0
  17. argocheck-0.1.0/argocheck/static/js-yaml.min.js +2 -0
  18. argocheck-0.1.0/argocheck/static/style.css +407 -0
  19. argocheck-0.1.0/argocheck/static/vue.global.prod.js +13 -0
  20. argocheck-0.1.0/argocheck/walker.py +179 -0
  21. argocheck-0.1.0/argocheck.egg-info/PKG-INFO +343 -0
  22. argocheck-0.1.0/argocheck.egg-info/SOURCES.txt +31 -0
  23. argocheck-0.1.0/argocheck.egg-info/dependency_links.txt +1 -0
  24. argocheck-0.1.0/argocheck.egg-info/entry_points.txt +3 -0
  25. argocheck-0.1.0/argocheck.egg-info/requires.txt +10 -0
  26. argocheck-0.1.0/argocheck.egg-info/top_level.txt +1 -0
  27. argocheck-0.1.0/pyproject.toml +56 -0
  28. argocheck-0.1.0/setup.cfg +4 -0
  29. argocheck-0.1.0/tests/test_helm.py +178 -0
  30. argocheck-0.1.0/tests/test_integration.py +218 -0
  31. argocheck-0.1.0/tests/test_parser.py +146 -0
  32. argocheck-0.1.0/tests/test_resolver.py +147 -0
  33. argocheck-0.1.0/tests/test_server.py +65 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jesper Lloyd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,343 @@
1
+ Metadata-Version: 2.4
2
+ Name: argocheck
3
+ Version: 0.1.0
4
+ Summary: Local ArgoCD app-of-apps Helm validator and dry-runner
5
+ Author-email: Jesper Lloyd <jpl.lloyd@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Morlock-Collective/argocheck
8
+ Project-URL: Repository, https://github.com/Morlock-Collective/argocheck
9
+ Project-URL: Issues, https://github.com/Morlock-Collective/argocheck/issues
10
+ Project-URL: Changelog, https://github.com/Morlock-Collective/argocheck/blob/main/CHANGELOG.md
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Software Development :: Testing
15
+ Classifier: Topic :: System :: Systems Administration
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: click>=8.1
24
+ Requires-Dist: rich>=13.0
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: pydantic>=2.0
27
+ Requires-Dist: fastapi>=0.110
28
+ Requires-Dist: uvicorn>=0.27
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=8.0; extra == "dev"
31
+ Requires-Dist: pytest-mock>=3.12; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # argocheck
35
+
36
+ Local validator, dry-runner, and diff tool for ArgoCD app-of-apps Helm
37
+ structures, including multi-source Applications.
38
+
39
+ Point it at a root `kind: Application` manifest and it recursively renders the
40
+ entire application tree using your local `helm` binary — no cluster, no ArgoCD
41
+ installation required. The web interface also lets you structurally diff any
42
+ two apps in the rendered tree, resource by resource, for manual verification
43
+ of changes before they go anywhere near a cluster.
44
+
45
+ ## What it does
46
+
47
+ argocheck walks an ArgoCD Application hierarchy the same way ArgoCD would:
48
+
49
+ 1. Reads the root Application manifest
50
+ 2. Renders the source — runs `helm template` if the source is a Helm chart (has `Chart.yaml`), or reads all YAML files directly if it is a plain manifest directory
51
+ 3. Finds any `kind: Application` resources in the rendered output
52
+ 4. Recurses into each child Application
53
+ 5. Displays the full resource tree with per-app resource summaries
54
+
55
+ If anything fails — a missing chart, bad values, a broken template — the error
56
+ is shown inline at the point of failure, along with the exact `helm` command
57
+ that was run.
58
+
59
+ The web interface additionally supports diffing any two apps in the rendered
60
+ tree against each other, matching child apps and resources up structurally
61
+ and showing a line-level diff per changed resource — see [Diff mode](#diff-mode).
62
+
63
+ ## What it does not do
64
+
65
+ - No ApplicationSet support
66
+ - No target cluster or server resolution — `spec.destination.namespace` is used as `--namespace` in `helm template`, but the server field is ignored
67
+ - No Sync waves or Sync hooks (those resources are treated like any other)
68
+
69
+ ## Requirements
70
+
71
+ - Python 3.11+
72
+ - [`helm`](https://helm.sh/docs/intro/install/) on your `PATH`
73
+ - `git` on your `PATH` (only if you reference remote Git repositories)
74
+
75
+ ## Installation
76
+
77
+ ```bash
78
+ git clone <this repo>
79
+ cd argocheck
80
+ python -m venv .venv
81
+ source .venv/bin/activate
82
+ pip install -e . # installs CLI and web interface
83
+ ```
84
+
85
+ ## Usage
86
+
87
+ ### Web interface
88
+
89
+ ```bash
90
+ argocheck-web
91
+ ```
92
+
93
+ Starts a local web server on `http://localhost:8765` and opens it in your
94
+ browser. The interface is a Vue 3 single-page app served directly by the
95
+ backend — no separate deployment or build step required.
96
+
97
+ The interface provides:
98
+ - **Sidebar** — path input, recent-files list, filesystem browser, options
99
+ (argocd-env toggle, max-depth), and the application tree with `├─`/`└─`
100
+ hierarchy lines and ✅/❌ status icons
101
+ - **Detail panel** — source info, child app links, resources grouped by kind
102
+ with collapsible syntax-highlighted YAML per resource
103
+ - **Application YAML toggle** — switches between the compact source view and
104
+ the raw Application manifest YAML
105
+ - **Error display** — the failing helm command and wrapped stderr output
106
+ - **Diff mode** — structural comparison between any two apps in the rendered
107
+ tree (see below)
108
+
109
+ #### Diff mode
110
+
111
+ Once a tree has rendered, any two applications in it can be compared
112
+ side-by-side — useful for checking that a "staging" and "prod" subtree (or any
113
+ two overlay/environment branches present in the same app-of-apps tree) only
114
+ differ where expected.
115
+
116
+ To use it:
117
+
118
+ 1. Open the **Diff** section in the sidebar and check **Compare two branches**.
119
+ 2. Assign **Branch A** and **Branch B**, either from the dropdowns or by
120
+ right-clicking any row in the application tree and choosing *Assign to diff
121
+ branch A/B* — the assigned rows get an `A`/`B` badge.
122
+
123
+ Child apps under each branch are matched by their path relative to the chosen
124
+ root, and resources within each matched pair are matched by `kind`/`name`.
125
+ Each resource is shown as **Identical**, **Changed** (with a line-level diff),
126
+ **Added**, or **Removed**, and each app subtree as a whole is flagged
127
+ **Only in A** / **Only in B** if it has no counterpart on the other side.
128
+ **Show identical** toggles whether unchanged apps/resources are hidden or
129
+ listed, and **Diff style** switches between a minimal (context-collapsed) and
130
+ full-context line diff.
131
+
132
+ Diff mode compares two subtrees of the *same* render — it does not fetch or
133
+ render a second revision, so to diff two git refs of the same chart, point
134
+ `repoURL`/`targetRevision` in your Application manifest at each ref as
135
+ separate sibling apps (or child apps) in the tree first, then diff those.
136
+
137
+ ### CLI
138
+
139
+ ```
140
+ argocheck [OPTIONS] ROOT_APP
141
+ ```
142
+
143
+ `ROOT_APP` is the path to a YAML file containing the root `kind: Application`
144
+ manifest.
145
+
146
+ ### Options
147
+
148
+ | Option | Description |
149
+ |---|---|
150
+ | `--expand APP_NAME` | Inline-expand all rendered manifests for the named app in the tree. Repeatable. |
151
+ | `--show APP_NAME` | Print the full YAML of every manifest rendered by the named app instead of the tree. |
152
+ | `--argocd-env` | Inject dummy `ARGOCD_APP_*` values into every `helm template` call. |
153
+ | `--max-depth N` | Maximum recursion depth (default: 10). |
154
+ | `--version` | Print version and exit. |
155
+
156
+ ### Examples
157
+
158
+ **Render and display the tree:**
159
+
160
+ ```bash
161
+ argocheck root-app.yaml
162
+ ```
163
+
164
+ ```
165
+ Using v3.17.0
166
+ ✓ root-app [argocd] — 0 resources
167
+ ├── ✓ infra [argocd] — 3 Deployments, 2 Services, 1 ConfigMap
168
+ └── ✓ apps [argocd] — 0 resources
169
+ ├── ✓ frontend [argocd] — 1 Deployment, 1 Service, 1 Ingress
170
+ └── ✓ backend [argocd] — 1 Deployment, 1 Service
171
+ ```
172
+
173
+ **Expand a specific app's manifests inline:**
174
+
175
+ ```bash
176
+ argocheck root-app.yaml --expand frontend
177
+ ```
178
+
179
+ **Dump the full YAML of a specific app:**
180
+
181
+ ```bash
182
+ argocheck root-app.yaml --show backend
183
+ ```
184
+
185
+ **With ArgoCD build environment variables:**
186
+
187
+ ```bash
188
+ argocheck root-app.yaml --argocd-env
189
+ ```
190
+
191
+ This passes the following dummy values to each `helm template` call via
192
+ `--set`, so charts that reference ArgoCD build environment variables as Helm
193
+ values do not fail:
194
+
195
+ ```
196
+ ARGOCD_APP_NAME = <releaseName>
197
+ ARGOCD_APP_NAMESPACE = <namespace>
198
+ ARGOCD_APP_REVISION = HEAD
199
+ ARGOCD_APP_SOURCE_REPO_URL = (empty)
200
+ ARGOCD_APP_SOURCE_PATH = .
201
+ ARGOCD_APP_SOURCE_TARGET_REVISION = HEAD
202
+ ```
203
+
204
+ ### Exit code
205
+
206
+ `argocheck` exits 0 if the entire tree renders without errors, and 1 if any
207
+ application fails.
208
+
209
+ ## Chart source types
210
+
211
+ argocheck resolves chart sources the same way ArgoCD does:
212
+
213
+ ### Local path
214
+
215
+ `repoURL` is a relative or absolute filesystem path. Relative paths are
216
+ resolved from the directory containing the Application manifest (for the root
217
+ app) or from the parent chart's directory (for child apps).
218
+
219
+ ```yaml
220
+ source:
221
+ repoURL: ./charts/my-app # relative to this manifest file
222
+ targetRevision: HEAD
223
+ ```
224
+
225
+ If `repoURL` points at a directory that is itself a git repo and
226
+ `targetRevision` is set to anything other than `HEAD`, that revision (branch,
227
+ tag, or commit) is checked out into a scratch clone instead of using the
228
+ working tree as-is — mirroring ArgoCD's behavior for git sources. `HEAD` (the
229
+ default) always uses the working tree directly, uncommitted changes included.
230
+ The same local repo can be referenced at multiple revisions across sources
231
+ without conflict. Non-git local directories ignore `targetRevision` entirely.
232
+
233
+ ### Helm chart repository (HTTP or OCI)
234
+
235
+ `chart` must be set. `targetRevision` is the chart version.
236
+
237
+ ```yaml
238
+ source:
239
+ repoURL: https://charts.bitnami.com/bitnami
240
+ chart: nginx
241
+ targetRevision: "18.1.5"
242
+ ```
243
+
244
+ ```yaml
245
+ source:
246
+ repoURL: oci://registry-1.docker.io/bitnamicharts
247
+ chart: nginx
248
+ targetRevision: "18.1.5"
249
+ ```
250
+
251
+ ### Git repository
252
+
253
+ `path` specifies the chart directory within the repo. `targetRevision` is the
254
+ branch or tag to check out.
255
+
256
+ ```yaml
257
+ source:
258
+ repoURL: https://github.com/my-org/my-charts.git
259
+ path: charts/my-app
260
+ targetRevision: main
261
+ ```
262
+
263
+ > Git sources require `git` on your `PATH`. The repo is cloned with
264
+ > `--depth 1` into a temporary directory that is deleted when argocheck exits.
265
+
266
+ ## Helm values precedence
267
+
268
+ Values are applied in this order (later entries override earlier ones),
269
+ matching ArgoCD's behavior:
270
+
271
+ 1. `spec.source.helm.valueFiles` — value files relative to the chart root
272
+ 2. `spec.source.helm.values` — inline YAML string
273
+ 3. `spec.source.helm.valuesObject` — inline YAML object
274
+ 4. `spec.source.helm.parameters` — individual key=value overrides (`--set`)
275
+
276
+ ## Supported Application fields
277
+
278
+ ### Single-source (`spec.source`)
279
+
280
+ ```yaml
281
+ spec:
282
+ source:
283
+ repoURL: ...
284
+ chart: ... # Helm repo sources only
285
+ path: ... # Git repo sources only
286
+ targetRevision: ...
287
+ helm:
288
+ releaseName: ...
289
+ values: | # inline values YAML string
290
+ key: value
291
+ valuesObject: # inline values as a mapping
292
+ key: value
293
+ valueFiles:
294
+ - values-prod.yaml
295
+ parameters:
296
+ - name: image.tag
297
+ value: v1.2.3
298
+ - name: replicas
299
+ value: "3"
300
+ forceString: true
301
+ version: v2 # Helm API version hint
302
+ destination:
303
+ namespace: ... # used as the --namespace flag in helm template
304
+ ```
305
+
306
+ ### Multi-source (`spec.sources`)
307
+
308
+ Multiple sources are fully supported. Each source is either a **chart source**
309
+ (rendered by `helm template`) or a **ref source** (provides values files only).
310
+
311
+ A source is a ref source when it has a `ref` field and no `chart` or `path`.
312
+ Chart sources may use `$<ref>/path` in `valueFiles` to reference files from a
313
+ ref source.
314
+
315
+ ```yaml
316
+ spec:
317
+ sources:
318
+ - repoURL: https://charts.example.com
319
+ chart: my-app
320
+ targetRevision: "2.1.0"
321
+ helm:
322
+ valueFiles:
323
+ - $values/prod.yaml # resolved from the "values" ref source below
324
+ - repoURL: https://github.com/my-org/my-values.git
325
+ targetRevision: main
326
+ ref: values # makes this source available as $values
327
+ destination:
328
+ namespace: default
329
+ ```
330
+
331
+ All non-Application resources from all chart sources are combined onto the same
332
+ node in the tree. Each chart source is rendered with its own `releaseName` (or
333
+ the application name if not set).
334
+
335
+ `spec.destination.namespace` is passed as `--namespace` to `helm template`.
336
+ The destination server and cluster fields are ignored.
337
+
338
+ ## Running the tests
339
+
340
+ ```bash
341
+ pip install -e ".[dev]"
342
+ pytest -v
343
+ ```
@@ -0,0 +1,310 @@
1
+ # argocheck
2
+
3
+ Local validator, dry-runner, and diff tool for ArgoCD app-of-apps Helm
4
+ structures, including multi-source Applications.
5
+
6
+ Point it at a root `kind: Application` manifest and it recursively renders the
7
+ entire application tree using your local `helm` binary — no cluster, no ArgoCD
8
+ installation required. The web interface also lets you structurally diff any
9
+ two apps in the rendered tree, resource by resource, for manual verification
10
+ of changes before they go anywhere near a cluster.
11
+
12
+ ## What it does
13
+
14
+ argocheck walks an ArgoCD Application hierarchy the same way ArgoCD would:
15
+
16
+ 1. Reads the root Application manifest
17
+ 2. Renders the source — runs `helm template` if the source is a Helm chart (has `Chart.yaml`), or reads all YAML files directly if it is a plain manifest directory
18
+ 3. Finds any `kind: Application` resources in the rendered output
19
+ 4. Recurses into each child Application
20
+ 5. Displays the full resource tree with per-app resource summaries
21
+
22
+ If anything fails — a missing chart, bad values, a broken template — the error
23
+ is shown inline at the point of failure, along with the exact `helm` command
24
+ that was run.
25
+
26
+ The web interface additionally supports diffing any two apps in the rendered
27
+ tree against each other, matching child apps and resources up structurally
28
+ and showing a line-level diff per changed resource — see [Diff mode](#diff-mode).
29
+
30
+ ## What it does not do
31
+
32
+ - No ApplicationSet support
33
+ - No target cluster or server resolution — `spec.destination.namespace` is used as `--namespace` in `helm template`, but the server field is ignored
34
+ - No Sync waves or Sync hooks (those resources are treated like any other)
35
+
36
+ ## Requirements
37
+
38
+ - Python 3.11+
39
+ - [`helm`](https://helm.sh/docs/intro/install/) on your `PATH`
40
+ - `git` on your `PATH` (only if you reference remote Git repositories)
41
+
42
+ ## Installation
43
+
44
+ ```bash
45
+ git clone <this repo>
46
+ cd argocheck
47
+ python -m venv .venv
48
+ source .venv/bin/activate
49
+ pip install -e . # installs CLI and web interface
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ ### Web interface
55
+
56
+ ```bash
57
+ argocheck-web
58
+ ```
59
+
60
+ Starts a local web server on `http://localhost:8765` and opens it in your
61
+ browser. The interface is a Vue 3 single-page app served directly by the
62
+ backend — no separate deployment or build step required.
63
+
64
+ The interface provides:
65
+ - **Sidebar** — path input, recent-files list, filesystem browser, options
66
+ (argocd-env toggle, max-depth), and the application tree with `├─`/`└─`
67
+ hierarchy lines and ✅/❌ status icons
68
+ - **Detail panel** — source info, child app links, resources grouped by kind
69
+ with collapsible syntax-highlighted YAML per resource
70
+ - **Application YAML toggle** — switches between the compact source view and
71
+ the raw Application manifest YAML
72
+ - **Error display** — the failing helm command and wrapped stderr output
73
+ - **Diff mode** — structural comparison between any two apps in the rendered
74
+ tree (see below)
75
+
76
+ #### Diff mode
77
+
78
+ Once a tree has rendered, any two applications in it can be compared
79
+ side-by-side — useful for checking that a "staging" and "prod" subtree (or any
80
+ two overlay/environment branches present in the same app-of-apps tree) only
81
+ differ where expected.
82
+
83
+ To use it:
84
+
85
+ 1. Open the **Diff** section in the sidebar and check **Compare two branches**.
86
+ 2. Assign **Branch A** and **Branch B**, either from the dropdowns or by
87
+ right-clicking any row in the application tree and choosing *Assign to diff
88
+ branch A/B* — the assigned rows get an `A`/`B` badge.
89
+
90
+ Child apps under each branch are matched by their path relative to the chosen
91
+ root, and resources within each matched pair are matched by `kind`/`name`.
92
+ Each resource is shown as **Identical**, **Changed** (with a line-level diff),
93
+ **Added**, or **Removed**, and each app subtree as a whole is flagged
94
+ **Only in A** / **Only in B** if it has no counterpart on the other side.
95
+ **Show identical** toggles whether unchanged apps/resources are hidden or
96
+ listed, and **Diff style** switches between a minimal (context-collapsed) and
97
+ full-context line diff.
98
+
99
+ Diff mode compares two subtrees of the *same* render — it does not fetch or
100
+ render a second revision, so to diff two git refs of the same chart, point
101
+ `repoURL`/`targetRevision` in your Application manifest at each ref as
102
+ separate sibling apps (or child apps) in the tree first, then diff those.
103
+
104
+ ### CLI
105
+
106
+ ```
107
+ argocheck [OPTIONS] ROOT_APP
108
+ ```
109
+
110
+ `ROOT_APP` is the path to a YAML file containing the root `kind: Application`
111
+ manifest.
112
+
113
+ ### Options
114
+
115
+ | Option | Description |
116
+ |---|---|
117
+ | `--expand APP_NAME` | Inline-expand all rendered manifests for the named app in the tree. Repeatable. |
118
+ | `--show APP_NAME` | Print the full YAML of every manifest rendered by the named app instead of the tree. |
119
+ | `--argocd-env` | Inject dummy `ARGOCD_APP_*` values into every `helm template` call. |
120
+ | `--max-depth N` | Maximum recursion depth (default: 10). |
121
+ | `--version` | Print version and exit. |
122
+
123
+ ### Examples
124
+
125
+ **Render and display the tree:**
126
+
127
+ ```bash
128
+ argocheck root-app.yaml
129
+ ```
130
+
131
+ ```
132
+ Using v3.17.0
133
+ ✓ root-app [argocd] — 0 resources
134
+ ├── ✓ infra [argocd] — 3 Deployments, 2 Services, 1 ConfigMap
135
+ └── ✓ apps [argocd] — 0 resources
136
+ ├── ✓ frontend [argocd] — 1 Deployment, 1 Service, 1 Ingress
137
+ └── ✓ backend [argocd] — 1 Deployment, 1 Service
138
+ ```
139
+
140
+ **Expand a specific app's manifests inline:**
141
+
142
+ ```bash
143
+ argocheck root-app.yaml --expand frontend
144
+ ```
145
+
146
+ **Dump the full YAML of a specific app:**
147
+
148
+ ```bash
149
+ argocheck root-app.yaml --show backend
150
+ ```
151
+
152
+ **With ArgoCD build environment variables:**
153
+
154
+ ```bash
155
+ argocheck root-app.yaml --argocd-env
156
+ ```
157
+
158
+ This passes the following dummy values to each `helm template` call via
159
+ `--set`, so charts that reference ArgoCD build environment variables as Helm
160
+ values do not fail:
161
+
162
+ ```
163
+ ARGOCD_APP_NAME = <releaseName>
164
+ ARGOCD_APP_NAMESPACE = <namespace>
165
+ ARGOCD_APP_REVISION = HEAD
166
+ ARGOCD_APP_SOURCE_REPO_URL = (empty)
167
+ ARGOCD_APP_SOURCE_PATH = .
168
+ ARGOCD_APP_SOURCE_TARGET_REVISION = HEAD
169
+ ```
170
+
171
+ ### Exit code
172
+
173
+ `argocheck` exits 0 if the entire tree renders without errors, and 1 if any
174
+ application fails.
175
+
176
+ ## Chart source types
177
+
178
+ argocheck resolves chart sources the same way ArgoCD does:
179
+
180
+ ### Local path
181
+
182
+ `repoURL` is a relative or absolute filesystem path. Relative paths are
183
+ resolved from the directory containing the Application manifest (for the root
184
+ app) or from the parent chart's directory (for child apps).
185
+
186
+ ```yaml
187
+ source:
188
+ repoURL: ./charts/my-app # relative to this manifest file
189
+ targetRevision: HEAD
190
+ ```
191
+
192
+ If `repoURL` points at a directory that is itself a git repo and
193
+ `targetRevision` is set to anything other than `HEAD`, that revision (branch,
194
+ tag, or commit) is checked out into a scratch clone instead of using the
195
+ working tree as-is — mirroring ArgoCD's behavior for git sources. `HEAD` (the
196
+ default) always uses the working tree directly, uncommitted changes included.
197
+ The same local repo can be referenced at multiple revisions across sources
198
+ without conflict. Non-git local directories ignore `targetRevision` entirely.
199
+
200
+ ### Helm chart repository (HTTP or OCI)
201
+
202
+ `chart` must be set. `targetRevision` is the chart version.
203
+
204
+ ```yaml
205
+ source:
206
+ repoURL: https://charts.bitnami.com/bitnami
207
+ chart: nginx
208
+ targetRevision: "18.1.5"
209
+ ```
210
+
211
+ ```yaml
212
+ source:
213
+ repoURL: oci://registry-1.docker.io/bitnamicharts
214
+ chart: nginx
215
+ targetRevision: "18.1.5"
216
+ ```
217
+
218
+ ### Git repository
219
+
220
+ `path` specifies the chart directory within the repo. `targetRevision` is the
221
+ branch or tag to check out.
222
+
223
+ ```yaml
224
+ source:
225
+ repoURL: https://github.com/my-org/my-charts.git
226
+ path: charts/my-app
227
+ targetRevision: main
228
+ ```
229
+
230
+ > Git sources require `git` on your `PATH`. The repo is cloned with
231
+ > `--depth 1` into a temporary directory that is deleted when argocheck exits.
232
+
233
+ ## Helm values precedence
234
+
235
+ Values are applied in this order (later entries override earlier ones),
236
+ matching ArgoCD's behavior:
237
+
238
+ 1. `spec.source.helm.valueFiles` — value files relative to the chart root
239
+ 2. `spec.source.helm.values` — inline YAML string
240
+ 3. `spec.source.helm.valuesObject` — inline YAML object
241
+ 4. `spec.source.helm.parameters` — individual key=value overrides (`--set`)
242
+
243
+ ## Supported Application fields
244
+
245
+ ### Single-source (`spec.source`)
246
+
247
+ ```yaml
248
+ spec:
249
+ source:
250
+ repoURL: ...
251
+ chart: ... # Helm repo sources only
252
+ path: ... # Git repo sources only
253
+ targetRevision: ...
254
+ helm:
255
+ releaseName: ...
256
+ values: | # inline values YAML string
257
+ key: value
258
+ valuesObject: # inline values as a mapping
259
+ key: value
260
+ valueFiles:
261
+ - values-prod.yaml
262
+ parameters:
263
+ - name: image.tag
264
+ value: v1.2.3
265
+ - name: replicas
266
+ value: "3"
267
+ forceString: true
268
+ version: v2 # Helm API version hint
269
+ destination:
270
+ namespace: ... # used as the --namespace flag in helm template
271
+ ```
272
+
273
+ ### Multi-source (`spec.sources`)
274
+
275
+ Multiple sources are fully supported. Each source is either a **chart source**
276
+ (rendered by `helm template`) or a **ref source** (provides values files only).
277
+
278
+ A source is a ref source when it has a `ref` field and no `chart` or `path`.
279
+ Chart sources may use `$<ref>/path` in `valueFiles` to reference files from a
280
+ ref source.
281
+
282
+ ```yaml
283
+ spec:
284
+ sources:
285
+ - repoURL: https://charts.example.com
286
+ chart: my-app
287
+ targetRevision: "2.1.0"
288
+ helm:
289
+ valueFiles:
290
+ - $values/prod.yaml # resolved from the "values" ref source below
291
+ - repoURL: https://github.com/my-org/my-values.git
292
+ targetRevision: main
293
+ ref: values # makes this source available as $values
294
+ destination:
295
+ namespace: default
296
+ ```
297
+
298
+ All non-Application resources from all chart sources are combined onto the same
299
+ node in the tree. Each chart source is rendered with its own `releaseName` (or
300
+ the application name if not set).
301
+
302
+ `spec.destination.namespace` is passed as `--namespace` to `helm template`.
303
+ The destination server and cluster fields are ignored.
304
+
305
+ ## Running the tests
306
+
307
+ ```bash
308
+ pip install -e ".[dev]"
309
+ pytest -v
310
+ ```
File without changes