Skip to content

feat(github): show a single multi-env plan change inline#680

Draft
Kiran01bm wants to merge 1 commit into
mainfrom
kiran01bm/plan-inline-single-ddl
Draft

feat(github): show a single multi-env plan change inline#680
Kiran01bm wants to merge 1 commit into
mainfrom
kiran01bm/plan-inline-single-ddl

Conversation

@Kiran01bm

@Kiran01bm Kiran01bm commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Multi-environment plan comments collapse each environment's DDL behind a
<details> block so a large plan doesn't dominate the comment. For a plan
with just one change that collapse adds a needless click. This renders a
single change inline and only collapses when there is more than one.

The threshold is the total change count (DDL statements + VSchema diffs),
so a lone VSchema change is also shown inline, not just a lone SQL
statement. Single-environment plans already rendered inline; this only
affects the per-environment sections of a multi-env comment.

Behavior

0 changes  ->  "No schema changes detected"
1 change   ->  rendered inline (no <details>)
1 change  ->  <details><summary>Show SQL (N statements)</summary> ...

Only collapse a multi-environment plan section's DDL behind a details
block when it has more than one change. A single statement (or a lone
VSchema diff) is small enough to read without a click, so render it
inline while keeping the summary below.
Copilot AI review requested due to automatic review settings July 4, 2026 06:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the UX of multi-environment plan comments by rendering per-environment plan output inline when there is exactly one total change (DDL statements + VSchema diffs), and only collapsing the “detailed changes” section behind a <details> block when there is more than one change.

Changes:

  • Update multi-env per-environment rendering to inline a single change and collapse only when totalChanges > 1.
  • Add/adjust tests to cover the new “single change inline” behavior while preserving collapse behavior and singular/plural summary text.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/webhook/templates/plan.go Inline-render single-change environment sections; keep <details> collapse for multi-change sections.
pkg/webhook/plan_test.go Add a new test for single-change inline rendering; keep coverage for collapse summary wording.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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