Repository navigation
feat: run summary report of terraform plan changes and step errors - #83
Merged
Merged
Conversation
Capture terraform plan changes per step and render a run summary as Markdown (echoed to stdout at the end of a run) plus summary.json/summary.md when RUNIAC_OUTPUT_DIR is set. Additive and best-effort: file output is opt-in, writer failures are logged not fatal, and exit codes and existing logs are unchanged.
…r-exec Bind-mount <project>/.runiac/report to /runiac/report and default RUNIAC_OUTPUT_DIR to it unless the caller set one, so the run report is available on the host without coupling to the tfstate mount.
Test Results72 tests 72 ✅ 0s ⏱️ Results for commit 3c1954f. |
mkrouse
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a run summary report (plan changes + step errors)
Problem
When runiac runs as a Docker-based GitHub Action, the only output is the container's stdout, streamed into the job log. To find the terraform plan or the reason a step failed, you have to scroll the entire log — the plan and errors are interleaved with everything else and there's no machine-readable artifact. There's no easy "what changed / what broke" view.
What this PR does
Adds a first-class run summary that runiac produces at the end of a deploy, without changing any existing output or exit behavior.
terraform show -jsoninto grouped resource changes; this now stores them on the step output (StepOutput.PlanResourceChanges).pkg/reportingpackage — renders aRunReport(per-step status, error, and plan change counts) into:summary.json+summary.mdwritten toRUNIAC_OUTPUT_DIRwhen that env var is set (for CI artifact upload /$GITHUB_STEP_SUMMARY).main.gowiring — collects per-step results in the existing summary loop and calls the reporter. Includes a panic-safestatusString(the existingDeployResult.String()indexes a 4-element array and would panic onNa).runiac deploy, container-exec mode) — bind-mounts<project>/.runiac/reportto/runiac/reportand defaultsRUNIAC_OUTPUT_DIRto it (unless the caller set one), so the report is available on the host with zero configuration (locally and in CI).Example (stdout, end of run)
Error: subnet overlaps existing range
Backward compatibility (non-breaking)
StepOutput.PlanResourceChangesis new; no existing field changed.RUNIAC_OUTPUT_DIRis set (the CLI sets a default only in container-exec mode, into the gitignored.runiac/); the default library behavior just adds a stdout summary block.Executed X/Y …summary line are unchanged; the report is purely additive.RUNIAC_OUTPUT_DIRstill wins.Tests
pkg/reporting/report_test.go— change tally (+create ~update -delete, replace, no-op), Markdown rendering (table + collapsible errors; success has no error section),Write(no dir = nothing written; with dir = valid JSON + MD), deterministic step sorting.cmd/runiac/main_test.go—statusStringmapping incl. theNanon-panic guard.cmd/cli/cmd/deploy_test.go—defaultReportOutputDir(default injected when unset/whitespace, preserved when caller-provided).go build ./...,go vet,gofmt, and existingpkg/config/plugins/terraform/cmd/clitests all pass.Consuming the report in CI
Set
RUNIAC_OUTPUT_DIR(or use the container-exec default at.runiac/report), then appendsummary.mdto$GITHUB_STEP_SUMMARYand upload the directory as an artifact — full logs remain available for deep triage.