Commit f93539d
✨ github/gitlab: discover CloudFormation, Dockerfile, Bicep, Helm, and Kustomize IaC
Extend the GitHub and GitLab providers' infrastructure-as-code discovery
beyond Terraform and Kubernetes manifests to also detect CloudFormation
templates, Dockerfiles, Bicep files, Helm charts, and Kustomize
configurations in repositories.
Discovery (github + gitlab):
- New targets: cloudformation, dockerfiles, bicep, helm, kustomize —
wired into org()/repo(), the "all" expansion, and the CLI config.
- CloudFormation is detected via a content heuristic (the
AWSTemplateFormatVersion marker) since templates share .yaml/.json with
many other files; one child asset per template. On GitLab this uses
project blob search and is skipped gracefully on instances without
advanced search.
- Dockerfiles via the filename:Dockerfile qualifier, accepting the common
Dockerfile.* / *.Dockerfile conventions; one child asset per file.
- Bicep via extension:bicep; one child asset per repo (the connection
walks the checkout).
- Helm via filename:Chart.yaml; one asset per chart directory.
- Kustomize via filename:kustomization (kustomization.yaml/.yml /
Kustomization); one asset per kustomization directory, so base and
overlays each become their own asset.
- Deduped the credential-cloning into a gitCredentials helper, and routed
GitHub code search through a paginating searchCode helper (100/page,
follows NextPage) so large repos aren't truncated to the first page.
Existence checks (hasBicep) use searchCodeExists, which pages with an
early return on the first non-hidden match instead of pulling every page.
Git-clone support (downstream providers):
- None of bicep, cloudformation, helm, kustomize, or the os dockerfile
connection could clone before. Each now clones on http-url, resolves a
repo-relative path/dir within the checkout where applicable, and cleans
up its temp dir via Close(). A deferred cleanup guard is armed right
after the clone and disarmed once the connection owns the closer, so
every error path removes the checkout.
Repo-based naming & stable identity:
- k8s, bicep, cloudformation, helm, and kustomize now name discovered
assets from the git repo (org/repo[/path]) like Terraform/Dockerfile,
instead of the temporary clone directory.
- Platform IDs and asset.Id are derived from the repo (and template/dir
path) rather than a hash of the temp clone path, which previously
changed on every scan. The bicep connection no longer overwrites
cc.Options["path"] with the non-deterministic clone directory.
- Asset names dropped the verbose "Static Analysis" verbiage (e.g.
"CloudFormation template tas50/iac_tests/...", "Helm Chart tas50/...").
Note: on GitLab, Chart.yaml and kustomization.yaml now match their own
discovery cases ahead of the k8s YAML branch, so a repo whose only YAML
files are Helm/Kustomize entry points no longer also registers as a k8s
manifest asset. This is intentional — those files aren't k8s manifests.
Verified end-to-end against tas50/iac_tests: discovery, naming, and
content queries resolve for all IaC types.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 19483cc commit f93539d
19 files changed
Lines changed: 1024 additions & 98 deletions
File tree
- providers
- bicep
- connection
- provider
- cloudformation
- connection
- provider
- github
- config
- connection
- resources
- gitlab
- config
- provider
- helm
- connection
- provider
- k8s/connection/manifest
- kustomize
- connection
- provider
- os/connection/docker
- terraform/provider
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
63 | 77 | | |
64 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
65 | 97 | | |
66 | 98 | | |
67 | 99 | | |
| |||
108 | 140 | | |
109 | 141 | | |
110 | 142 | | |
| 143 | + | |
111 | 144 | | |
112 | 145 | | |
113 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
114 | 154 | | |
115 | 155 | | |
116 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
144 | 160 | | |
145 | 161 | | |
146 | 162 | | |
| |||
150 | 166 | | |
151 | 167 | | |
152 | 168 | | |
153 | | - | |
| 169 | + | |
154 | 170 | | |
155 | 171 | | |
156 | 172 | | |
| |||
182 | 198 | | |
183 | 199 | | |
184 | 200 | | |
185 | | - | |
| 201 | + | |
186 | 202 | | |
187 | 203 | | |
188 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
33 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
34 | 49 | | |
35 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
36 | 65 | | |
37 | 66 | | |
38 | 67 | | |
| |||
50 | 79 | | |
51 | 80 | | |
52 | 81 | | |
| 82 | + | |
53 | 83 | | |
54 | 84 | | |
55 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
56 | 93 | | |
57 | 94 | | |
58 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
142 | 166 | | |
143 | 167 | | |
144 | 168 | | |
| |||
148 | 172 | | |
149 | 173 | | |
150 | 174 | | |
151 | | - | |
| 175 | + | |
152 | 176 | | |
153 | 177 | | |
154 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
0 commit comments