Skip to content

Bug: CI hooks fire only once in deploy --all mode, producing summary for last component only #2476

Description

@thejrose1984

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):

  1. Add `wasMultiComponentExecution = false` reset at top of `deploy.go` `RunE`
  2. Add `&& !wasMultiComponentExecution` guard to error defer
  3. Add `if wasMultiComponentExecution { return nil }` guard to `PostRunE`
  4. Add `runCIHooksForDeployComponent` function in `utils.go` using `h.AfterTerraformDeploy`
  5. Wire `info.PerComponentHook` for `subCommand == "deploy"` in `terraformRunWithOptions`

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions