Repository navigation
refactor(repo)!: adopt snake_case resource and kebab-case module labels - #310
aghassemlouei merged 5 commits into
Conversation
…in stages Rename the stage resource labels to snake_case and the CIS log metric and alert module labels to kebab-case, matching the convention that upstream Cloud Foundation Fabric enforces with tflint. Each renamed resource and module has a moved block, so existing deployments move the state instead of destroying and recreating the resources.
…abels Rename blueprint resource, output, variable and local labels to snake_case and module labels to kebab-case, with a moved block for every renamed resource and module. The fedramp-high symlinks follow the il5 sources. BREAKING CHANGE: Blueprint outputs such as compute-engine-vm-instance and the il5/gcs-project bucket-name variable now use snake_case names. Update terraform.tfvars files and scripts that read these outputs.
…ase modules Use the labels and moved blocks of the upstream organization module in organization-se/logging.tf, so the next upstream sync merges the file cleanly. Rename the private-service-connect pkg_dev module to pkg-dev with a moved block, and use kebab-case module labels in the README examples of the Stellar Engine modules.
Add the upstream terraform_naming_convention rule to .tflint.hcl and a tools/tflint.sh runner that checks every directory under fast, blueprints and modules. The runner skips the modules that still carry pre-v55.4.0 upstream labels until the upstream sync renames them, and enforces only the naming rule because the recommended preset still reports unrelated findings. A new CI job and tools/lint.sh run it, and shell tests cover the runner.
Describe the snake_case and kebab-case label rules and the moved block requirement in docs/naming-convention.md, and add the rule to the review styleguide.
|
More than supportive of this but I think @Calvin-Cheng1 should at least be made aware since if we do this we might as well lint the codebase and issue a breaking change. |
|
This is already marked as a breaking change with the |
aghassemlouei
left a comment
There was a problem hiding this comment.
No additional documentation is needed here since GEMINI.md already specifies snake_case for resources, data sources, variables, and outputs alongside kebab-case for modules. The 81 moved blocks cover state migration cleanly across the stages, blueprints, and custom modules, the tflint wrapper and test suite pass, and the breaking change marker in the title will surface the two renamed blueprint outputs (airflow_dag_gcs_prefix and gke_cluster_name) in the 5.0.0 release notes.
Description
Terraform labels in the code that Stellar Engine owns now follow the naming convention that upstream Cloud Foundation Fabric enforces, and CI enforces it with tflint.
movedblocks, so existing deployments move the state instead of destroying and recreating the resources.fast/stages-aw/, the blueprints underblueprints/, and themodules/organization-se/andmodules/private-service-connect/modules.blueprints/il5/for the directories that theblueprints/fedramp-high/symlinks point to.modules/organization-se/logging.tffile uses the exact labels andmovedblocks of the upstreamorganizationmodule, so the upstream sync in [Feature Request] Sync the modules from upstream Cloud Foundation Fabric and keep them current #308 merges it cleanly.cis-log-alerts,cis-log-metrics,cloud-scheduler,intrusion-detection-systemandprivate-service-connectmodules use kebab-case module labels.tools/tflint.shscript lints every Terraform directory underfast/,blueprints/andmodules/. ItsUPSTREAM_PENDING_SYNClist skips the 11 upstream-tracked module directories that still carry old labels, and [Feature Request] Sync the modules from upstream Cloud Foundation Fabric and keep them current #308 removes that list.recommendedpreset reports 66 unrelated findings onmain.tflintCI job installs tflint v0.64.0 throughterraform-linters/setup-tflint, verifies the release checksum, tests the runner and runs thetools/tflint.shscript. Thetools/lint.shscript runs it too.docs/naming-convention.mdguide and the.gemini/styleguide.mdreview guide document the convention and themovedblock requirement.Fixes #309
Breaking Changes
Blueprint outputs and one blueprint variable change names. State moves automatically, but forks that read these outputs or set this variable need to update. The
!in the title marks the change as breaking, so Release Please cuts a new major release.Type of Change
Deployment & Compliance Impact
Checklist
Code Quality & Reusability
modules/orfast/stages-aw/can be leveraged for this change.docs/naming-convention.md.Documentation
README.mdof the modified module or blueprint.Security
Testing
Testing Performed
The checks below ran locally on the branch, and on an
origin/mainexport where a comparison applies.origin/main, and 152 when it counts the symlinked stage 2a file twice. On the branch, thetools/tflint.shscript checks 137 directories with no findings, and fails on a planted resource or module label.tests/scripts/test_tflint.shscript passes 6 tests under bash 5 and the macOS bash 3.2, and skips when tflint is missing.origin/main. All 84movedblocks, which count the 4 that the symlinkedlog-metric-alerts.tffile adds to stage 2a, map a removed address to an existing one, and no address appears or disappears otherwise.fromside of amovedblock in.tffiles, READMEs, samples,scripts/,docs/andtests/.terraform init -backend=falseandterraform validatepass for all 27 changed roots on the branch and onorigin/main, with Terraform 1.13.3. Stages 1 to 3 use a local stub for thebillingprovider alias that operators otherwise copy from the stage outputs.terraform fmt -recursive -checkpasses.bash tests/scripts/run_shell_tests.shpasses, andpytestpasses 66 tests.zizmorandactionlintreport no findings for.github/workflows/ci.yml, andshellcheckpasses for both new scripts.tools/check_boilerplate.pyreports the same 22 files onorigin/mainand on the branch, which chore(repo): fix repo-wide lint failures and make tools/lint.sh fail closed #286 addresses.tools/check_documentation.pyfails onorigin/mainwith an unknown fixture error, so the README tables changed only for the renamed outputs and the variable.movedblocks follow the pattern that upstream #3930 uses for the same renames.