Skip to content

Terraform report: display more information about affected resources

Problem to solve

As a merge request reviewer I'd like to have more information visible about Terraform plan - affected resource names seem to be a good minimum, Terraform-diff-like would be perfect. Maybe this could be implemented just like in the case of the CodeQuality MR widget where one can "Expand" to see the differences between head and baseline pipeline artifacts/reports

Intended users

User experience goal

The user should be able to have most vital information about the change directly in the merge request, without combing through the raw job log. The user should have available in the widget whatever was revealed as "changed" by the terraform plan

Proposal

Today, we show the number of affected resources in a merge request widget. This is of limited usability. It can easily prevent cases where whole cluster is trashed, but in most cases it's too little information.

  • We want to add a new tab to the MR pages that shows the extended Terraform diff view from a Terraform plan. - Link to the Terraform diff tab from the Terraform widget.

Required Steps for completing the issue

  • Create a new design to handle the additional information
  • Review security issues related to storing the entire tfplan in a report --> Related issue: #235879 (closed)
  • Update the terraform report to allow users to submit the entire JSON file (or just submit the original tfplan file instead of a JSON file). Processing the file would happen on the backend instead of the CI pipeline. --> POC MR
  • Update displays once new information is being sent from the backend and new design is completed

Feature Usage Metrics

Events:

  • clicked_terraform_diff_tab
  • opened_mr_with_terraform_diff

Metrics:

  • MAU checking out a terraform diff tab
  • % of MAU checking out a terraform diff tab / MAU who opened an MR with a Terraform diff
Edited by Viktor Nagy (GitLab)