Skip to content

Mericstam/feat add plan tab UI #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

mericstam
Copy link
Collaborator

This pull request introduces significant enhancements to the Terraform task in Azure Pipelines, focusing on improving the visualization of Terraform plans and adding new functionality for publishing plan outputs. Key changes include the addition of a "Terraform Plan" tab in the Azure Pipelines UI, updates to task parameters to support plan publishing, and the creation of a React-based view for displaying Terraform plan results.

Enhancements to Terraform Plan Visualization:

  • Task Parameters Updates:

    • Added publishPlan parameter to enable publishing Terraform plans for visualization in the "Terraform Plan" tab. Updated the fileName parameter to also serve as the display name for plans in JSON format. [1] [2]
    • Enhanced the plan and show commands to generate and attach Terraform plan outputs as JSON files for visualization. [1] [2] [3] [4]
  • Terraform Plan Tab in Azure Pipelines:

    • Added a new "Terraform Plan" tab in the build summary to display plan outputs directly in the Azure Pipelines UI.
    • Integrated the tab with the task to support multiple plans using a dropdown selector.

Codebase Updates for Plan Visualization:

  • React-based View Component:
    • Created a new React application (views/terraform-plan) for rendering Terraform plan outputs in the "Terraform Plan" tab. Includes components for handling attachments and displaying plan summaries. [1] [2] [3]
    • Added build scripts and dependencies for the view component in package.json. [1] [2]

Miscellaneous Changes:

  • Documentation Updates:

    • Updated overview.md to include details about the new publishPlan parameter and instructions for using the Terraform Plan visualization feature.
  • Version Updates:

    • Incremented task version in task.json and extension version in azure-devops-extension.json. [1] [2]

These changes collectively enhance the usability of the Terraform task by providing a user-friendly way to visualize plans directly in Azure Pipelines, reducing the need for manual log file analysis.

@mericstam mericstam requested a review from Copilot June 1, 2025 20:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new Terraform Plan tab to the Azure Pipelines UI and enhances the Terraform task to publish plan outputs as JSON for visualization in that tab. Key changes include:

  • Updating task parameters (adding publishPlan and modifying fileName behavior)
  • Creating a new React-based view component for displaying Terraform plans along with associated build scripts and webpack configurations
  • Extending the base Terraform command handler to attach plan outputs as artifacts for visualization

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
webpack.config.js Adds a copy rule to bundle the Terraform Plan view files
views/terraform-plan/** Contains new React components, styles, and configuration for the plan view
Tasks/TerraformTask/TerraformTaskV5/task.json Updates task parameters for output and plan publication
Tasks/TerraformTask/TerraformTaskV5/src/base-terraform-command-handler.ts Enhances plan handling logic to attach JSON plan outputs
overview.md, azure-devops-extension.json, package.json, resources.resjson Updates documentation, extension metadata, and package settings
Comments suppressed due to low confidence (1)

Tasks/TerraformTask/TerraformTaskV5/src/base-terraform-command-handler.ts:230

  • The function 'uuidV4' is used without being imported. Please add the appropriate import (e.g., 'import { v4 as uuidV4 } from "uuid";') to avoid a runtime error.
const tempPlanFile = path.join(tasks.getVariable('System.DefaultWorkingDirectory') || '.', `terraform-plan-${uuidV4()}.tfplan`);

… sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@mericstam mericstam requested a review from jaredfholgate June 1, 2025 20:37
@mericstam
Copy link
Collaborator Author

fixes #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant