Skip to content

Add import, forget, and drift to plan summaries - #790

Merged
emmanuelmaduwuba-lyft merged 2 commits into
mainfrom
plan-summary-import-forget-drift
Oct 7, 2026
Merged

emmanuelmaduwuba-lyft merged 2 commits into
mainfrom
plan-summary-import-forget-drift

Conversation

@emmanuelmaduwuba-lyft

Copy link
Copy Markdown
Contributor

Summary

Brings the neptune plan summary in line with upstream Atlantis's PlanSuccess.Summary():

  • Import and forget counts in the one line summary, using the same wording as the Terraform CLI (Plan: 1 to import, 0 to add, 1 to change, 0 to destroy, 1 to forget.).
  • Drift note in the check run's Plan Summary section when resources changed outside of Terraform (**Note: 2 resources have changed outside of Terraform.**), read from the plan JSON's resource_drift instead of matching log text.

Dependency bump

Change.Importing and Plan.ResourceDrift need hashicorp/terraform-json >= v0.17. This bumps it from v0.14.0 to v0.22.1, the newest release that doesn't also raise hashicorp/go-version (used in ~40 files). The only other go.mod changes are indirect deps with no direct importers here (go-cty, go-cmp, go-textseg). terraform-json itself is only imported by summary.go.

The forget action constant (tfjson.ActionForget) only exists in v0.23+, so it's defined locally rather than taking the go-version bump.

Behavior notes

  • PlanSummary.IsEmpty() is intentionally unchanged (creates/updates/deletes only), since the plan review gate depends on it. Display uses a separate check, so import- or forget-only plans no longer show "No plan summary created".
  • Drift is informational and never counted as a planned change.
  • New fields on PlanSummary are additive, so existing workflow histories and payloads decode with zero values.

Test plan

  • New unit tests for import, forget, import+forget, drift, and the drift note (summary_test.go)
  • New renderer tests for the check-run template with and without drift (renderer_test.go, first tests for this package)
  • go build ./..., go vet, gofmt clean
  • go test ./...: all packages pass except server/neptune/workflows TestDeployWorkflow, which hits its 3s Temporal test-env timeout under full parallel load. It fails the same way on main and passes in isolation with and without this change.

Brings the neptune plan summary in line with upstream Atlantis's
PlanSuccess.Summary(): import and forget counts in the one line
summary (same wording as the Terraform CLI), and a note in the check
run when resources changed outside of Terraform.

Reads Change.Importing and Plan.ResourceDrift from the plan JSON, which
needs terraform-json >= v0.17. Bumps it to v0.22.1, the newest release
that doesn't also raise hashicorp/go-version (used in ~40 files). The
"forget" action constant only exists in v0.23+, so it's defined
locally.

IsEmpty() is unchanged on purpose: the plan review gate auto-approves
empty plans, and counting imports/forgets there would change approval
behavior.
Brings the neptune plan summary in line with upstream Atlantis's
PlanSuccess.Summary(): import and forget counts in the one line
summary (same wording as the Terraform CLI), and a note in the check
run when resources changed outside of Terraform.

Reads Change.Importing and Plan.ResourceDrift from the plan JSON, which
needs terraform-json >= v0.17. Bumps it to v0.22.1, the newest release
that doesn't also raise hashicorp/go-version (used in ~40 files). The
"forget" action constant only exists in v0.23+, so it's defined
locally.

IsEmpty() is unchanged on purpose: the plan review gate auto-approves
empty plans, and counting imports/forgets there would change approval
behavior.

The previous commit on this branch was pushed empty; this one carries
the actual changes.
@emmanuelmaduwuba-lyft
emmanuelmaduwuba-lyft merged commit 540dc02 into main Oct 7, 2026
3 checks passed
@emmanuelmaduwuba-lyft
emmanuelmaduwuba-lyft deleted the plan-summary-import-forget-drift branch October 7, 2026 18:35
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.

2 participants