Project Trying it on real PRsMenu

Project

Trying it on real pull requests

Infraglass is a beta. The question it has to answer is simple: does it change Terraform reviews enough that a team keeps using it? This page is how to find out with your own pull requests, in about an hour of setup and a few weeks of normal work.

What to try

Pick a repository where pull requests change Terraform, ideally with someone who reviews them regularly. Add this workflow as .github/workflows/terraform-review.yml. It has no gates, so it comments on each pull request and never blocks one:

name: Terraform review
on: pull_request

permissions:
  contents: read
  pull-requests: write   # to post and update the summary comment

jobs:
  review:
    runs-on: ubuntu-latest
    # defaults:
    #   run:
    #     working-directory: infra   # if your Terraform isn't at the repository root
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1
        with:
          terraform_wrapper: false
      # Give Terraform the same cloud and backend credentials your other plan jobs use here.
      - run: terraform init -input=false
      - run: terraform plan -input=false -out=tfplan
      - uses: ityashag/infraglass@a986fa72abbd3a3458944d9b17784c7d07a1a492 # v0.2.3
        with:
          plan-file: tfplan
          version: v0.2.3
          # working-directory: infra   # the same directory as above

Every action is pinned to a commit, as GitHub recommends; the comment names the release. The action installs the release named in version, checks its checksum and signed build provenance, and uploads the HTML, Markdown and JSON reports as the infraglass-report artifact. The other inputs are in CI and pipelines.

Or, without CI, run it locally on the plan you're reviewing:

terraform plan -out=tfplan
infraglass serve --plan-file tfplan

Nothing leaves your machine or your CI runner. See Security.

What to note, for each pull request

  • Did it change the review? Something caught that would have been missed, the same things found faster, or nothing new.
  • What was wrong or missing? A false alarm, a missed replacement, a misread resource.
  • What mattered? Which part, if any, you looked at: Review first, blast radius, the plan diff, the explorers, the comment.

After a few pull requests, ask the people reviewing them whether they'd keep it, and if not, what would have to change.

Sending it back

Open a pilot feedback issue for each pull request, or one with a summary. "It didn't help" is just as useful. Anything Infraglass got wrong is best as a wrong or missed result issue: those become new cases in the accuracy tests.

Warning

Never paste state files, plans or anything private into an issue. Describe what you saw instead.

What happens with the answers

They decide what comes next: keep going on what helps, narrow what doesn't, or stop. The roadmap says the same.

Improve this page on GitHub · Report a problem