Commit 03a1f84
authored
Add HelmChart manifest validation for linter (#636)
* Add validation for chart-to-HelmChart manifest mapping
Validates that every configured Helm chart has a corresponding HelmChart
manifest (kind: HelmChart). This ensures templates can be properly rendered
with builder values during preflight checks.
Key changes:
- New validation layer with batch error reporting for missing manifests
- Refactored extraction to consolidate HelmChart discovery (eliminates duplicate calls)
- Separated discovery (lenient) from validation (strict) layers
- Added auto-discovery support for HelmChart manifests
- Made manifest paths optional in config (validation happens at runtime)
The validation runs after resource discovery but before linting, catching
configuration errors early with clear, actionable error messages.
* Add comprehensive tests and documentation for HelmChart validation
Adds unit tests, integration tests, CLI tests, and documentation for the
chart-to-HelmChart manifest validation feature to ensure correctness and
provide clear guidance for users.
Changes:
- Add 11 unit tests in validation_test.go covering all validation scenarios
- Add 6 integration tests in validation_integration_test.go with test fixtures
- Add 3 CLI integration tests in lint_test.go for end-to-end validation
- Create 6 test scenario fixtures in testdata/validation/
- Add HelmChart Manifest Requirements section to docs/lint-format.md
- Update existing tests to reflect lenient discovery pattern
The tests cover success cases, error cases (single and batch), warnings for
orphaned manifests, auto-discovery mode, and edge cases. Documentation
includes configuration examples, validation behavior, error messages, and
troubleshooting guidance.
* Fix test: update expected error message for empty manifest path1 parent 9c17c20 commit 03a1f84
File tree
41 files changed
+1559
-113
lines changed- cli/cmd
- docs
- pkg
- lint2
- testdata/validation
- scenario-1-success
- chart
- manifests
- scenario-2-missing-helmchart
- chart
- manifests
- scenario-3-multiple-charts
- chart1
- chart2
- chart3
- manifests
- scenario-4-orphaned-manifest
- chart
- manifests
- scenario-5-auto-discovery
- chart
- manifests
- scenario-6-no-manifests-config
- chart
- tools
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
41 files changed
+1559
-113
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
110 | 109 | | |
111 | 110 | | |
112 | | - | |
113 | | - | |
114 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
115 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
250 | | - | |
| 252 | + | |
| 253 | + | |
251 | 254 | | |
252 | 255 | | |
253 | 256 | | |
| |||
257 | 260 | | |
258 | 261 | | |
259 | 262 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
266 | 267 | | |
267 | 268 | | |
268 | | - | |
269 | | - | |
270 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
271 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
272 | 276 | | |
273 | 277 | | |
274 | 278 | | |
| |||
316 | 320 | | |
317 | 321 | | |
318 | 322 | | |
319 | | - | |
| 323 | + | |
| 324 | + | |
320 | 325 | | |
321 | 326 | | |
322 | 327 | | |
| |||
327 | 332 | | |
328 | 333 | | |
329 | 334 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
336 | 339 | | |
337 | 340 | | |
338 | | - | |
339 | | - | |
340 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
341 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
342 | 348 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | | - | |
86 | | - | |
| 86 | + | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 90 | + | |
97 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
98 | 96 | | |
99 | 97 | | |
100 | 98 | | |
| |||
104 | 102 | | |
105 | 103 | | |
106 | 104 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 105 | | |
127 | 106 | | |
128 | | - | |
129 | | - | |
| 107 | + | |
| 108 | + | |
130 | 109 | | |
131 | 110 | | |
132 | 111 | | |
| |||
197 | 176 | | |
198 | 177 | | |
199 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
200 | 186 | | |
201 | 187 | | |
202 | 188 | | |
203 | 189 | | |
204 | | - | |
| 190 | + | |
| 191 | + | |
205 | 192 | | |
206 | 193 | | |
207 | 194 | | |
| |||
231 | 218 | | |
232 | 219 | | |
233 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
234 | 252 | | |
235 | 253 | | |
236 | 254 | | |
| |||
0 commit comments