Terraform: `tofu -chdir=<dir> validate` / `fmt -check` with -chdir before the subcommand is not matched; .tftpl/.tpl templates are unrecognised; clowdhaus/terraform-min-max versions
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
Start in project_validator/ecosystems/terraform.py: the _CLI tuple near line 34, the flagged(*_commands("fmt")) rule near lines 47-50, the analyses=when(starts(*_commands("validate")...)) rule near line 63, and the source_suffixes/ambiguous_suffixes mapping near lines 171-172. Done means tofu -chdir=<dir> validate and fmt -check in a GitLab job are recognised, and .tftpl/.tpl files are classed as templates rather than unrecognised. The min/max version expression case is a separate, larger design question.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
kubespray's seven GitLab jobs run OpenTofu validate and fmt -check -diff as tofu -chdir="contrib/terraform/$PROVIDER" validate; starts(("tofu", "validate")) fails because -chdir= precedes the subcommand → code-formatting and static-analysis FAIL. .tftpl is Terraform's documented template suffix (templatefile()), .tpl the older convention. The terraform-aws-modules' min/max Terraform versions come from clowdhaus/terraform-min-max (two versions) and read as "0 Terraform versions".
Evidence from the corpus audit
kubernetes-sigs/kubespray / code-formatting, static-analysis (Terraform)
- kind: FALSE_NEGATIVE
- actual:
code-formattingFAIL "Terraform: CI never runs terraform fmt; its formatting is not enforced";
static-analysisFAIL "Terraform: no static analyzer runs";.map.jsonjobs
.gitlab-ci/terraform.yml: terraform_validate (openstack|aws|exoscale|hetzner|vsphere|opennebula|upcloud)all have
ecosystems: []. - expected: PASS for both: seven GitLab CI jobs run OpenTofu
validateandfmt -check -diffon every
contrib/terraform/<provider>. The validator supportstofu(terraform.py:34: _CLI = ("terraform", "tofu"))
but matchesstarts(("tofu", "validate"))/flagged(("tofu", "fmt"), checks=("-check",)), and here the global
option-chdir=<dir>sits betweentofuand the subcommand. - evidence:
.gitlab-ci/terraform.yml:19:- tofu -chdir="contrib/terraform/$PROVIDER" init;
:26:- tofu -chdir="contrib/terraform/$PROVIDER" validate;
:27:- tofu -chdir="contrib/terraform/$PROVIDER" fmt -check -diff;.gitlab-ci.yml:68-71:include:...
- .gitlab-ci/terraform.yml(the jobs were read: they appear in.map.json).
Validator:project_validator/ecosystems/terraform.py:47-50:flagged(*_commands("fmt"), checks=("-check",));
:63:analyses=when(starts(*_commands("validate"), ("terraform_validate",)), analysed). - repro:
main.tf+.gitlab-ci.ymljobscript: - tofu -chdir=infra validate/- tofu -chdir=infra fmt -check
(same forterraform -chdir=infra validate). - confidence: high
terraform-aws-modules/terraform-aws-vpc, -eks, -lambda / platform-matrix, detection (ci)
- kind: UNSUPPORTED
- actual: FAIL:
platform-matrix: CI covers 0 OS(es) (none), 0 Terraform version(s) (none)...Min TF pre-commit (matrix computed by an expression): linux / no Terraform version - expected: ERROR: the Terraform version is an expression from
clowdhaus/terraform-min-max(min and max ofrequired_version, i.e. 2 versions); the composite action and the min-max action are the standard CI of the ~60 terraform-aws-modules repositories and deserve either modelling or an honest "unknown". - evidence:
.github/workflows/pre-commit.yml:79:terraform-version: ${{ steps.minMax.outputs.minVersion }},:169:terraform-version: ${{ steps.minMax.outputs.maxVersion }};versions.tf:2:required_version = ">= 1.0". - repro: the same workflow; expect "Terraform version: unknown (an expression)" rather than "no Terraform version".
- confidence: medium
terraform-google-modules/terraform-google-kubernetes-engine, terraform-aws-modules/terraform-aws-eks / detection (suffixes)
- kind: UNSUPPORTED
- actual: map
unrecognised_suffixes: [{".tmpl": 16}, {".tftpl": 1}](GKE),[{".tpl": 8}](eks) - expected:
.tftplis Terraform's documented template-file suffix (fortemplatefile()), and.tplis its older convention; a Terraform profile should claim them (as templates, roletemplate). - evidence:
examples/safer_cluster_iap_bastion/templates/startup-script.tftpl; ekstemplates/al2023_user_data.tpl. Validator:ecosystems/terraform.py:171-172:source_suffixes={".tf": ..., ".tofu": ..., ".tfvars": ...},ambiguous_suffixes={".hcl": TERRAFORM}. - repro:
templates/x.tftplin a Terraform project; expect it recognised, not listed as unrecognised. - confidence: medium
Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.
🤖 Generated with Claude Code
- Vorherrschende Sprache
- Python
- Sterne
- 4
- Forks
- 1
- Ø Merge
- 10 Std. 41 Min.
- Gemergte PRs (30 T.)
- 79
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus cpp-best-practices/project_validator
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
cpp-best-practices/project_validator#267 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
cpp-best-practices/project_validator#263 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
cpp-best-practices/project_validator#260 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
cpp-best-practices/project_validator#259 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
cpp-best-practices/project_validator#255 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in cpp-best-practices/project_validator
Ähnliche Issues
-
add entry to blockOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"Evtl. vergeben @0z5a hat das heute übernommen. Offenneeds-triage
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 2 Tagen
-
plot_graph crashes when a mesh node has no m2m edgeEvtl. vergeben @tygvi hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
mllam/neural-lam#883 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
future-agi/future-agi#4092 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld wholeOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
WingedGuardian/GENesis-AGI#4641 ·
Maintainer antworten meist innerhalb von 1 Tag