Description
`atmos terraform deploy --all` has the same CI hook bug that was fixed for `plan --all` in #2430 and `apply --all` in #2475.
`deploy.go`'s `PostRunE` fires unconditionally after all components complete (no `wasMultiComponentExecution` guard), and the error-path defer also fires unconditionally. This means CI summary hooks produce a single misattributed entry for the last component instead of one per component.
Root Cause
- `deploy.go` `RunE` does not reset `wasMultiComponentExecution = false`
- `deploy.go` error defer does not check `!wasMultiComponentExecution`
- `deploy.go` `PostRunE` does not check `wasMultiComponentExecution`
No per-component hook is wired for `subCommand == "deploy"` in `terraformRunWithOptions`.
Fix
Apply the same three-site pattern used for `apply` (#2475):
- Add `wasMultiComponentExecution = false` reset at top of `deploy.go` `RunE`
- Add `&& !wasMultiComponentExecution` guard to error defer
- Add `if wasMultiComponentExecution { return nil }` guard to `PostRunE`
- Add `runCIHooksForDeployComponent` function in `utils.go` using `h.AfterTerraformDeploy`
- Wire `info.PerComponentHook` for `subCommand == "deploy"` in `terraformRunWithOptions`
Related
Description
`atmos terraform deploy --all` has the same CI hook bug that was fixed for `plan --all` in #2430 and `apply --all` in #2475.
`deploy.go`'s `PostRunE` fires unconditionally after all components complete (no `wasMultiComponentExecution` guard), and the error-path defer also fires unconditionally. This means CI summary hooks produce a single misattributed entry for the last component instead of one per component.
Root Cause
No per-component hook is wired for `subCommand == "deploy"` in `terraformRunWithOptions`.
Fix
Apply the same three-site pattern used for `apply` (#2475):
Related
--allmode, producing summary for last component only #2397 — original fix for `plan --all`