Skip to content

feat(cli): kates conformity check fits the terminal: details go on lines under each row - #433

Merged
bmscomp merged 1 commit into
mainfrom
feat/conformity-output
Oct 20, 2026
Merged

bmscomp merged 1 commit into
mainfrom
feat/conformity-output

Conversation

@bmscomp

@bmscomp bmscomp commented Oct 20, 2026

Copy link
Copy Markdown
Owner

kates conformity check's table had a Detail column, and it put pod lists inside Observed. One waived rule with a long reason, or a few pod names, padded every row. On panda's payments-krafter report the table ran to about 200 columns.

Before, panda's payments-krafter report (banner omitted, cut at 120 columns):

  Status    Rule                      Expected  Observed                                                                               Detail
  ▲ WARN    brokers.antiAffinity      required  preferred (krafter-brokers-alpha-0, krafter-brokers-gamma-1, krafter-brokers-sigma-2)
  ○ WAIVED  monitoring.kafkaExporter  true      false                                                                                  FAIL, waived until …

After, the same report:

  Status    Rule                      Expected  Observed
  ────────  ────────────────────────  ────────  ─────────
  ▲ WARN    brokers.antiAffinity      required  preferred
            krafter-brokers-alpha-0, krafter-brokers-gamma-1, krafter-brokers-sigma-2
  ○ WAIVED  monitoring.kafkaExporter  true      false
            FAIL, waived until 2027-03-31 by platform-team: The Kind overlay turns Kafka Exporter off; enable it before…

✓ PASS: 0 fail, 1 warn, 1 waived, 22 pass, 0 unknown

What changes

  • Four columns: Status, Rule, Expected and Observed.
  • One fact per line under each row: the subjects that fall short, the waiver, the detail and the note. The lines are dimmed, start at the Rule column, and are each cut to the terminal's width. -o json keeps everything whole.
  • Expected and Observed share the remaining width. They get what Status and Rule leave. A value cut to fit gets its own line underneath, whole, so a required listener still shows everything it expects and has (fix(conformity): show what a required listener expects and has #423's test still holds). The rule id is never cut.
  • A shorter banner state line: not Ready, results may change.
  • JUnit: failure messages keep the first three subjects and +N. A waived rule's facts are joined with · instead of ; , so a reason ending in a period stops rendering as .;.
  • output.TableNotes: the house Table with an optional note per row. Table itself is unchanged.
  • Docs: the Conformity Checks chapter's captured outputs and the CLI Reference's description of the table follow the new layout.

Tests

  • TestTableNotes: a note starts under the second column, fits the terminal and ends with an ellipsis when cut.
  • TestConformityCheckShowsTheGaps now has a four-pod rule with a long detail. It asserts that no line runs past the terminal and that the pods aren't on the rule's row.
  • The JUnit test asserts the subjects in a failure message.

Checked locally: go vet, go test ./... under cli/, golangci-lint --new-from-rev=origin/main (0 issues), scripts/check-cli-style.sh, scripts/check-cli-compat.sh and scripts/check-book-style.sh. The before/after outputs above are panda's real reports, rendered through the old and new builds.

Not checked: a real colour terminal (the captures are non-TTY), and ASCII mode.

…nes under each row

The table had a Detail column and pod lists inside Observed, so one
waived rule with a long reason, or a few pod names, padded every row:
on panda's payments-krafter report the table ran to about 200 columns.

The table is now Status, Rule, Expected and Observed. Under each row,
dimmed and starting at the Rule column, come its facts one per line:
the subjects that fall short, then the waiver, the detail and the note,
each cut to the terminal's width. Expected and Observed share the width
Status and Rule leave, and a value cut to fit gets a line of its own
underneath, whole, so a required listener still shows everything it
expects and has. The rule id is never cut. The banner's not-Ready line
is shorter. JUnit keeps the subjects in its failure message and joins a
waived rule's facts with " · " instead of "; ", so a reason ending in a
period no longer prints ".;".

output.TableNotes is the house Table with an optional note per row;
Table itself is unchanged. Widths are measured with ansi.StringWidth,
since the status label carries colour codes on a terminal.

The Conformity Checks chapter's captured outputs and the CLI
Reference's description of the table follow the new layout.
@bmscomp
bmscomp merged commit 2a90865 into main Oct 20, 2026
58 checks passed
bmscomp added a commit that referenced this pull request Oct 20, 2026
…hipped (#434)

Two planning documents that stayed untracked in the main checkout:

- plans/conformity-spec.md: the design of KafkaReference and
  POST /api/conformity/check. A "Shipped" row now names the PRs that
  delivered it (#407 to #416, then #419 to #433), and its file
  references point at cli/examples/conformity, where the schema and
  examples live. Its inline examples stay as the 2026-10-19 drafts and
  say so.
- plans/conformity-enhancements.md: the four-lens review of 2026-10-20,
  29 verified findings. An Outcome table maps each finding to the PR
  that fixed it: 17 fixed, 2 partly covered by the book chapter, 10 open.

The draft schema and examples in plans/conformity/ are left out: the
shipped copies in cli/examples/conformity supersede them, and the draft
schema lacks kafka.source and topics.
bmscomp added a commit that referenced this pull request Oct 21, 2026
…hipped

Two planning documents that stayed untracked in the main checkout:

- plans/conformity-spec.md: the design of KafkaReference and
  POST /api/conformity/check. A "Shipped" row now names the PRs that
  delivered it (#407 to #416, then #419 to #433), and its file
  references point at cli/examples/conformity, where the schema and
  examples live. Its inline examples stay as the 2026-10-19 drafts and
  say so.
- plans/conformity-enhancements.md: the four-lens review of 2026-10-20,
  29 verified findings. An Outcome table maps each finding to the PR
  that fixed it: 17 fixed, 2 partly covered by the book chapter, 10 open.

The draft schema and examples in plans/conformity/ are left out: the
shipped copies in cli/examples/conformity supersede them, and the draft
schema lacks kafka.source and topics.
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.

1 participant