jason-johnson / azure-pipelines-tasks-terraform

Azure Pipelines extension for Terraform
MIT License
121 stars 52 forks source link

Terraform Plan Tab in Pipeline runs details doesn't show plans #342

Open brampostma opened 1 year ago

brampostma commented 1 year ago

Describe the bug I have a Azure Devops Pipeline in yaml with a Terraform Plan task in every Stage (with stages dev,tst,acc,prd). Those Plan tasks publish their plans, this works fine and I can see the plans from the pipeline run overview page. The problem is that when the plan task of the first stage (dev) does not have any changes it will not publish anything to the pipeline run overview, even tho the other stages plan tasks contain have changes.

To Reproduce Steps to reproduce the behavior:

  1. Setup a pipeline with multiple stages and a terraform@cli tasks in each stage:
    - task: TerraformCLI@0
    displayName: 'Terraform : plan'
    inputs:
      command: plan
      publishPlanResults: ${{ parameters.publishPlanResults }}
  2. Execute pipeline where the first stage doesn't have any changes and further stages do.
  3. Look at Terraform plan tab in pipeline run results page.

Expected behavior I expect to see the plans of the other stages to be visable in the pipeline run overview, but i get this: image

even tho the test stage has changes: image

jason-johnson commented 8 months ago

More details in #390

BHellstream commented 5 months ago

Yeah, this is pretty annoying :) and makes the feature almost unusable for multistage (with plan) pipelines

tomas0620 commented 3 months ago

Same problem, @jason-johnson do you have a fix scheduled for this feature? THX.

sam-bowman commented 1 month ago

Just adding a note to say that I'm seeing the same behaviour. If one plan is empty then none at all will show on the terraform plan tab in a multistage pipeline, despite all publishPlanResults field having unique names per stage. As long as all terraform plan outputs have changes, then the published results shows correctly.