Fix expand pipeline: stale cleanup, tf-plan checkout, terraform fmt#42
Merged
Conversation
Three fixes for the module expander CI pipeline: 1. expand-modules.py: clean up stale generated .tf files that have the GENERATED marker but aren't produced by the current expansion. This handles the old main.tf (app-stack reference) automatically. 2. tf-plan.yml: checkout ref instead of github.sha so tf-plan sees the files that expand just committed and pushed. 3. expand-terraform.yml: install terraform so `terraform fmt` works during expansion (prevents fmt-check failure in tf-plan).
Terraform PlanNo changes — infrastructure is up to date. Plan output |
Alexanderamiri
added a commit
that referenced
this pull request
May 9, 2026
) ## Summary - **expand-modules.py**: Auto-remove stale generated `.tf` files (with `GENERATED` marker) that the current expansion didn't produce. Handles the old `main.tf` app-stack reference automatically. - **tf-plan.yml**: Checkout `github.ref` instead of default `github.sha` so tf-plan picks up the files that expand just committed and pushed. - **expand-terraform.yml**: Install terraform via `setup-terraform` so `terraform fmt` works during expansion (prevents fmt-check failure in tf-plan). ## Context The module expander (`expand-modules.py` + `registry.py`) replaces the old `app-stack` module approach. The test app (`platform-test-app`) still has an old generated `main.tf` referencing `app-stack`. These fixes ensure the full CI pipeline works end-to-end: 1. Expand cleans up stale `main.tf`, generates new flat resource files, formats them, commits 2. tf-plan checks out the latest ref (including expand's commit), inits, validates, plans 3. Review + apply proceed as normal ## Test plan - [ ] Merge to main - [ ] Delete old test app TF state from S3 - [ ] Push trigger commit to `platform-test-app` - [ ] Verify full pipeline: detect → expand → tf-plan → review → apply - [ ] Verify generated files: platform.tf, ecr.tf, routing.tf, iam.tf, service.tf, alarms.tf - [ ] Verify AWS resources created: ECR, ALB TG, Route53, ECS service, CloudWatch alarms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.tffiles (withGENERATEDmarker) that the current expansion didn't produce. Handles the oldmain.tfapp-stack reference automatically.github.refinstead of defaultgithub.shaso tf-plan picks up the files that expand just committed and pushed.setup-terraformsoterraform fmtworks during expansion (prevents fmt-check failure in tf-plan).Context
The module expander (
expand-modules.py+registry.py) replaces the oldapp-stackmodule approach. The test app (platform-test-app) still has an old generatedmain.tfreferencingapp-stack. These fixes ensure the full CI pipeline works end-to-end:main.tf, generates new flat resource files, formats them, commitsTest plan
platform-test-app