Skip to content

grouped plan summary across roots: same changes grouped, every destroy named, sized for an MR note (#3048, choudoufu#1753) #3188

Closed

Description

@lex00

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), ...

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

  1. added
    enhancement
    area:ops
    area:terraform
    orchestration
    on Oct 1, 2026
  2. lex00 commented on Oct 3, 2026

    @lex00
    ContributorAuthor

    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:terraform file. 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.

  3. lex00 commented on Oct 4, 2026

    @lex00
    ContributorAuthor

    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.

  4. lex00 commented on Oct 4, 2026

    @lex00
    ContributorAuthor

    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 now packages/core/src/__fixtures__/plan-summary/normalization-vectors.json, format plan-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 a live-plan-set -json document, the input both sides already read. An instance pair is two resource_changes of one stock plan. overEagerFalselyGroups names the must-not rows a string-blanking grouper must group, so both repos prove the table red the same way.

    Where it runs. groupChangeSet in @intentius/chant/plan-summary, and chant change-set summary <change-set.json> on the command line. No workspace-wide plan command exists, so the command reads the document a composeChangeSet step 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.

  5. lex00 commented on Oct 4, 2026

    @lex00
    ContributorAuthor

    Measured on choudoufu#1750's fixture, the shared-module bump, with chant change-set summary (PR #3432).

    The plans are real. choudoufu's TestLargeSetBaselineAgainstFloci ran from choudoufu origin/main 52bef26fa3 against floci (ghcr.io/lex00/floci@sha256:6c3d5c2d…), at N=5 and at N=20 with LARGESET_MAINTAINER_GO=1. It wrote each run's set document (LARGESET_SUMMARY_DOC) and record. chant read each document through choudoufuSetPlanParts and composeChangeSet, then summarized it. Plan lines are the record's summary.plan_lines: the sum of each estate's live-plan -no-color output for the bump.

    N Plan lines Summary lines (text) Summary lines (markdown) Markdown characters Groups
    5 1,093 12 22 606 4 + 1 (e04)
    20 4,372 12 22 824 16 + 4 (e04, e09, e14, e19)

    The summary stays at 12 lines while the plans grow fourfold. The groups match choudoufu's own live-summary in 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, 79cd3ea7ffaf and 36dca470b879, because the change is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:opsarea:terraformenhancementorchestration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions