Skip to content

chore(#1609): name the release-named files by domain - #1667

Merged
scttfrdmn merged 2 commits into
mainfrom
chore/v0132-cfn-file-names
Nov 24, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
chore/v0132-cfn-file-names

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Part of #1609 — this is part 1 (release-named files). Part 2 (the comment rule, gates and trims) is W3's PR; part 3 (tagging behind a plugin interface) follows as refactor/v0132-tagging-providers, stacked on this branch.

  • Files: the 30 release-named files in emulator/ are renamed or regrouped by domain: the 28 matching _v[0-9], plus v016_extra_test.go and v030_coverage_test.go. No logic changes.
  • Guard: TestFileNames_AreNamedByDomainNotRelease fails on any emulator/*.go name matching (^|_)v[0-9].
  • Comments: comments citing the old file names now cite functions. That includes cfn_resource_tags.go's file:line cites, which were already stale: cfn_resources_v21.go:196 and :241 both pointed into deployECSTaskDefinition. They now name deployECSService and deployECSTaskDefinition, and the Config pair names cfgsvcCFNRuleAttributes and cfgsvcCFNRecorderARN. Each old file header ("The name records the substrate release…") is replaced by a one-line domain header. The ----- v0.NN.0 — X ----- separators lose their release number. The cross-cutting header of v129 (the three rules every in-place updater follows) moves to cfn_update.go, beside cfnUpdateUnmodelledProperties.
  • Docs: docs/contributing.md gets one line saying where CFN resources live. CHANGELOG has one line under Changed.
  • Routed operations: the catalog count is unchanged at 1,128.

Mapping

Old New
cfn_resources_v19.go cfn_resources_acm.go (ACM), cfn_resources_apigateway.go (REST + v2)
cfn_resources_v20.go cfn_resources_stepfunctions.go
cfn_resources_v21.go cfn_resources_ecr.go, cfn_resources_ecs.go
cfn_resources_v22.go cfn_resources_cognito.go
cfn_resources_v23.go cfn_resources_kinesis.go, cfn_resources_cloudfront.go
cfn_resources_v25.go cfn_resources_rds.go, cfn_resources_elasticache.go
cfn_resources_v26.go cfn_resources_efs.go, cfn_resources_glue.go
cfn_resources_v27.go cfn_resources_budgets.go
cfn_resources_v28.go cfn_resources_sesv2.go, cfn_resources_firehose.go
cfn_resources_v31.go cfn_resources_appsync.go
cfn_resources_v32.go cfn_resources_stubs.go
cfn_resources_v34.go deployRDSDBCluster → rds, deployMSKCluster → cfn_resources_msk.go, cfnIntProp → cfn_resource_helpers.go
cfn_resources_v41.go cfn_resources_ec2.go
cfn_resources_v43.go cfn_resources_fsx.go
cfn_resources_v77.go EC2 → ec2, deployIAMInstanceProfile → iam, cfnTypeServiceOverrides/servicePluginLoaded → cfn_resource_table.go, resolveStringList → helpers
cfn_resources_v101.go cfn_resources_config.go (cfnSetMetadata → helpers)
cfn_resources_v128.go cfn_resources_backup.go; updateTransferServer → stubs; updateEC2LaunchTemplate → ec2; cfnCopyMetadata → helpers
cfn_resources_v129.go generic helpers (cfnUpdateUnmodelledProperties, cfnChooseIf, cfnResolveStructured, cfnChangedAny, cfnUpdateDispatch, cfnJSONRequest) → cfn_update.go; updaters → lambda, dynamodb, sqs, sns, s3, kms, ec2 (security group), ecs; cfnBoolValue → helpers
cfn_resources_v129_iam.go cfn_resources_iam.go (cfnTagMap → helpers)
cfn_resources_v131.go routes and subnet associations → ec2, AWS::Lambda::Permission → lambda, AWS::SQS::QueuePolicy → sqs
tagging_scan_v129.go / _test.go tagging_scan_records.go / _test.go
cfn_iam_v129_test.go cfn_resources_iam_test.go
cfn_update_v129_test.go cfn_update_inplace_test.go
cfn_resources_v32_test.go cfn_resources_stubs_test.go
cfn_resources_v77_test.go cfn_resources_ec2_test.go
cfn_resources_v101_test.go cfn_resources_config_test.go
v016_extra_test.go split by service: kms_plugin_test.go, ssm_plugin_test.go, sns_plugin_test.go, sqs_plugin_test.go, secretsmanager_plugin_test.go; the CFN deploy tests and both helpers (newV016Deployer, newV016FullDeployer) → cfn_deployer_test.go; GetAtt → cfn_getatt_coverage_test.go; ResolveValue and dynamic refs → cfn_intrinsics_test.go
v030_coverage_test.go split by service: servicequotas_plugin_test.go, sqs_fifo_test.go, s3_versioning_test.go, dynamodb_streams_test.go, lambda_esm_test.go, lambda_plugin_test.go, and the two CFN tests → cfn_deployer_test.go
ec2_v0126_review_test.go split into ec2_spot_requests_test.go, ec2_fleet_test.go, ec2_security_group_canonical_test.go, ec2_security_group_duplicates_test.go, ec2_default_vpc_test.go

cfn_resources_<service>.go was used throughout, because the existing cfn_<service>*.go files are about one concern each (delete, GetAtt, bucket policy) rather than a service's resource helpers.

Proof that the moves are pure

A throwaway go/ast program in ~/.xtmp, not committed, listed every top-level declaration in emulator/ (package, kind, receiver and name), sorted. It ran before and after. A second pass added a SHA-256 of each declaration's comment-free go/printer output, so a changed body would show up even under an unchanged name.

  • Names: 19,602 before, 19,604 after. The diff is empty apart from the two declarations of the new guard test, and it stays empty after the second commit (the v016/v030 split) (func TestFileNames_AreNamedByDomainNotRelease, var releaseNamedFile).
  • Name + source hash: the diff is empty apart from those two lines and writeFailureCases. Its only change is the subtest label "cfn_resources_v32.go" → "cfn_resources_stubs.go".

The moves were done by a script that cut each declaration's source span verbatim, together with its doc and the floating comments before it. goimports then rebuilt the import blocks.

Gates (local, after the change)

  • make lint: 0 issues
  • make test (race)
  • make e2e
  • SUBSTRATE_IAC=1 make iac-e2e: Terraform and CDK journeys pass
  • operation-catalog-check, docs-reference-check, docs-headings-check, operation-docs-check, authz-reference-check, cfn-schema-check
  • wire-bookkeeping-check, discarded-unmarshal-check, discarded-marshal-check, discarded-state-check, nondeterminism-check
  • docs-versions, docs-counts-check
  • VitePress build, then rm -rf docs/node_modules

No follow-up issues filed from this part.

Rename and regroup the 28 files named after releases (cfn_resources_v19.go
... v131.go, tagging_scan_v129.go, ec2_v0126_review_test.go and the v129
tests) into cfn_resources_<service>.go, cfn_resource_helpers.go,
cfn_update.go and the existing EC2 test files. Pure moves: the set of
top-level declarations and their comment-free source is unchanged.
Comments that cited the old file names now cite functions.

Adds TestFileNames_AreNamedByDomainNotRelease and a contributing.md line.
@scttfrdmn scttfrdmn added this to the v0.132.0 milestone Nov 24, 2026
@scttfrdmn scttfrdmn added type: chore Build, tooling, dependency updates area: cloudformation Issues relating to the CloudFormation component labels Nov 24, 2026
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

v016_extra_test.go and v030_coverage_test.go move into the matching service
test files (kms, ssm, sns, sqs, secretsmanager, servicequotas, s3_versioning,
dynamodb_streams, lambda_esm, lambda_plugin, cfn_deployer, cfn_intrinsics,
cfn_getatt_coverage). The guard now refuses (^|_)v[0-9], so a file that starts
with a version is caught too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cloudformation Issues relating to the CloudFormation component type: chore Build, tooling, dependency updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant