feat: integrate Claude Terraform Plan Review action into plan-terraform workflow#43
feat: integrate Claude Terraform Plan Review action into plan-terraform workflow#43
Conversation
bkrem
left a comment
There was a problem hiding this comment.
Thanks for tackling this! 💯 LGTM generally, think some things may still be a bit implicit in terms of documenting needed config (raised in the review)
We should be able to test drive this by referencing via uses: WalletConnect/actions/claude/terraform-plan-review@chore/tf-plan-cc-review elsewhere
(I also just realised we're missing Claude auto-review on this repo, resolving in another PR)
| 1. **Standalone**: As a separate step in your workflow after generating a Terraform plan. | ||
| 2. **Integrated**: Automatically as part of the `plan-terraform` action. | ||
|
|
||
| ### Standalone Usage |
There was a problem hiding this comment.
Would be good to have an explicit full workflow file example (similar to https://github.com/WalletConnect/actions/tree/master/claude/auto-review#quick-start) bc I think the needed permissions are currently implicit here.
E.g. if we want to have Claude write this back to the PR it will need pull-requests: write etc
|
@claude review |
|
Claude finished @bkrem's task —— View job Code Review: Claude Terraform Plan Review IntegrationI've reviewed this PR which adds Claude-powered Terraform plan analysis. The implementation is generally solid, but I've identified several issues that need attention. Critical IssuesIssue 1: Missing Required Permissions DocumentationFile: The README lacks a complete workflow example showing required GitHub permissions. The reviewer (bkrem) correctly identified this gap. Users need explicit guidance on the Required permissions: permissions:
contents: read
pull-requests: write
issues: write
id-token: writeRecommendation: Add a "Quick Start" section similar to Issue 2: Deprecated
|
ac61d81 to
ec27799
Compare
…rm workflow - Added `anthropic_api_key` input to `plan-terraform` for optional plan review. - Enhanced Terraform plan execution to log output and errors to a file. - Introduced a new `Claude Terraform Plan Review` action for automated analysis of Terraform plans. - Updated README to include usage instructions for the new review action and its integration with `plan-terraform`.
ec27799 to
64ad66f
Compare
| 🧭 **Warnings/Errors** | ||
| - Provider warnings, deprecations, errors | ||
|
|
||
| ## Verdict |
There was a problem hiding this comment.
UX thought: the full output is useful but I think it would be best to have Verdict up top and then have a Click to expand section underneath with the detailed report, similar to what the plan output step is currently doing.
I'm a bit worried that PRs will become super long if there's more than a couple of plans that happen.
afd65f9 to
faffa6a
Compare
Terraform Plan: Automated Summary, Alignment Check, and Diagnostics
Closes https://linear.app/reown/issue/ISAI-151/ai-claude-code-review-gha-to-analyse-terraform-plan-ci-runs
Example run: https://github.com/reown-com/infra-monitoring-grafana/pull/92#issuecomment-3456401594
Why
What’s changed
anthropic_api_key(default: empty).terraform showand exposes it asplan_content.terraform planlogs and exposesplan_log(for warnings/errors).anthropic_api_keyis provided.terraform_plan_logto summarize warnings/errors.How it works
anthropic_api_keyis empty: the review step is skipped, preserving existing behavior.plan_log.Backward compatibility
plan-file,output-file,plan) are unchanged.terraform planis piped throughteewithset -o pipefail, preserving failure semantics.Potential issues and mitigations
terraform show.Testing notes
anthropic_api_key: verify plan generation remains unchanged and no review runs.anthropic_api_key: verify the review includes:plan_log.Files touched
actions/plan-terraform/action.ymlclaude/terraform-plan-review/action.ymlclaude/terraform-plan-review/README.mdReferences