Repository navigation
Description
Question 3 of #3048, and the chant side of choudoufu#1753. Builds on the change-set document of #3181.
Problem
When one change touches many roots (a shared module bump, a provider upgrade, a common-config edit), nobody reads hundreds of plan logs. The prospective user behind #3048 named this alongside time and cost: at that size the GitLab UI stops working, and nobody can see what is actually changing. A reviewer needs to see how many roots take the same change, which take something more, and every destroy, in one place they already look: the MR or PR note.
What
A grouped summary across roots: normalize each root's change set, hash it, and group roots whose changes are the same.
180 roots: identical change X (update aws_iam_role.app, tags)
15 roots: X plus Y (+ replace aws_lambda_function.worker)
5 roots: read these individually
destroys: prod-eu/db (delete aws_db_instance.main), ...
- It is a view over one change-set document across lifecycle, terraform/choudoufu, warden and release plans #3181's change-set document, so it covers every planner that emits one: chant members,
terraformandtofuroots, choudoufu estates, and Terragrunt units once research: cutting CI time for a large Terragrunt + OpenTofu monorepo - affected-only runs, small estates, and a readable summary of what changed #3048 settles that runner. - Destroys, replacements and refusals are never folded into a group. Every one is listed by name.
- It works on a single root too. A big
for_eachorcountexpansion is the same problem inside one root. - Output formats: text, JSON, and markdown sized for an MR or PR note. The note is what the generated pipelines post (generated CI: merge- or comment-triggered apply bound to the PR's plan, affected members only #3183, and one job per wave in gated waves: a gate per wave bound to the wave's set digest, for any Terraform-family root (choudoufu#1749) #3049).
- It is something reviewers read, and approvals do not bind to it. Gates bind plan digests and wave set digests (a gate resolution binds nothing about the plan it approved, so approve-then-change-then-apply proceeds #2300, gated waves: a gate per wave bound to the wave's set digest, for any Terraform-family root (choudoufu#1749) #3049).
The design risk: normalization rules
Two changes that differ only in a name, identifier or address prefix must group together. Two that differ in a real value must not. choudoufu#1753 faces the same rules for choudoufu plans, and two rule sets would drift: a chant summary that groups differently from choudoufu's would be worse than none. Decide in this issue, and record it:
- one rule table shared by both, as test vectors both repos run; or
- chant calls choudoufu's grouping for choudoufu members, and its own for everything else, with the shared vectors.
Either way the vectors are table-driven, with both kinds of pair, and proved red.
Acceptance criteria
- A table-driven test of the normalization rules: name-only differences group, value differences don't, each case proved red first.
- Destroys and replacements are always listed by name, and a test proves none is ever folded into a group.
- Text, JSON (schema documented, golden test) and markdown output.
- Measured on choudoufu#1750's fixture at N=5 and N=20 (a shared-module bump): summary lines against total plan lines.
- The rule-sharing decision with choudoufu#1753 is recorded here and on choudoufu#1753.
Activity
lex00 commentedon Oct 3, 2026
The terragucci plan report (#3349) renders from this issue's JSON output. It adds a run header, wave state and per-root plan digests around the groups and named destroys, and from that JSON it renders the PR note, a self-contained HTML report and a GitLab
reports:terraformfile. Keep the group ids stable across runs of the same change so a report index can link one group across commits. Research: INTENTIUS/terragucci#5.lex00 commentedon Oct 4, 2026
Ruling (user, 2026-10-03), the normalization-rule decision INTENTIUS/terragucci#3 asks for before this starts: one shared rule table. A single set of test vectors (pairs that must group, pairs that must not: a change differing only in a name, a tag carrying the estate or root, an address index groups; a different instance size, CIDR or policy document does not) that chant and choudoufu both run in CI. Each repo keeps its own grouping code, and the vectors keep them from drifting. No runtime dependency between them. Recorded on choudoufu#1753 too.
lex00 commentedon Oct 4, 2026
Decisions taken from the code while building this (PR #3432).
The shared vectors. choudoufu's table for #1753 is Go code (
internal/live/plansummary/normalize_table_test.go), with no file to adopt. The vectors are nowpackages/core/src/__fixtures__/plan-summary/normalization-vectors.json, formatplan-summary-normalization-vectors/1. It holds every row of choudoufu's table plus one, a tag carrying the root directory name. A root pair is two roots of alive-plan-set -jsondocument, the input both sides already read. An instance pair is tworesource_changesof one stock plan.overEagerFalselyGroupsnames the must-not rows a string-blanking grouper must group, so both repos prove the table red the same way.Where it runs.
groupChangeSetin@intentius/chant/plan-summary, andchant change-set summary <change-set.json>on the command line. No workspace-wide plan command exists, so the command reads the document acomposeChangeSetstep returns.Sensitive values. The change-set document carries no value for a sensitive attribute (#3181). chant compares such an attribute by its path. choudoufu reads the raw plan and compares the values. The two can differ only on plans with sensitive values, and no vector has one.
Read entries. chant's terraform adapter carries no attributes for a
read. choudoufu compares a read's values. No vector has a read.Destroys. The summary lists every delete and replace in the document, a failed member's included. A destroy is part of its member's change, so a member that destroys something never groups with one that does not.
Holes. A member with holes stays in its group. Each hole is listed with its member and reason.
Note size. GitHub refuses a comment body over 65,536 characters. A GitLab note holds 1,000,000 (https://docs.gitlab.com/api/notes/). The markdown default is 65,536, which fits both. It drops whole groups from the end and names what it dropped. Destroy, failure and hole lines go first.
lex00 commentedon Oct 4, 2026
Measured on choudoufu#1750's fixture, the shared-module bump, with
chant change-set summary(PR #3432).The plans are real. choudoufu's
TestLargeSetBaselineAgainstFlociran from choudoufu origin/main 52bef26fa3 against floci (ghcr.io/lex00/floci@sha256:6c3d5c2d…), at N=5 and at N=20 withLARGESET_MAINTAINER_GO=1. It wrote each run's set document (LARGESET_SUMMARY_DOC) and record. chant read each document throughchoudoufuSetPlanPartsandcomposeChangeSet, then summarized it. Plan lines are the record'ssummary.plan_lines: the sum of each estate'slive-plan -no-coloroutput for the bump.The summary stays at 12 lines while the plans grow fourfold. The groups match choudoufu's own
live-summaryin both records: groups of [4, 1] and [16, 4], with the same outliers. Each outlier group reads as the main group's change plus~ module.shared.aws_sqs_queue.extra: tags, tags_all. The bump destroys nothing.The group ids are the same at both sizes,
79cd3ea7ffafand36dca470b879, because the change is the same.feat(plan-summary): grouped plan summary over a change-set document, …