feat(github): show a single multi-env plan change inline#680
Draft
Kiran01bm wants to merge 1 commit into
Draft
Conversation
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.
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 planwith 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