Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idea: support for condensed display of multiple plans? #12

Open
simonblake-mp opened this issue Jun 6, 2024 · 8 comments
Open

idea: support for condensed display of multiple plans? #12

simonblake-mp opened this issue Jun 6, 2024 · 8 comments
Labels

Comments

@simonblake-mp
Copy link

This is total pie in the sky, I'm just spitballing.

I suspect many folks use a matrix to run multiple terraform plans concurrently (to different environments or cloud accounts or whatever) then feed each plan through a comment action to get a comment per matrix element in the PR. So if you've got, say, 8 environments, then you get 8 plan comments, which can add excessive scrolling to the PR.

What would be super sweet would be for a way to combine all those plans into a single uber-comment that showed a one line summary of all the changes across all the plans, making it easy for a reviewer to see if a single plan is out of whack versus all the rest, then allowing drill down to a specific plan.

Gitlab does something like this, although not in a comment (they have native TF support in a widget) - I'm struggling to find an actual picture of it in use (I no longer use gitlab), but their design ideas are visible here - https://gitlab.com/gitlab-org/gitlab/-/issues/222964

Obviously there are constraints, particularly around total comment size, and how to handle updating reruns and whatnot, so it wouldn't be trivial.

@borchero
Copy link
Owner

borchero commented Jun 6, 2024

Interesting thought! I am not entirely sure how to implement the "drill-down" in a single plan since you need to persist the plan somewhere. One option would be to add a bunch of collapsed comments to the PR which contain the full plan and add a link to these collapsed comments (example). I'll have to think a bit more about other options 👀

@borchero

This comment was marked as resolved.

@simonblake-mp
Copy link
Author

At the moment it's the calling action's responsibility to ensure the plan is available in the local filesystem before calling terraform-plan-comment? So I was naively assuming that would contInue - instead of this

token: ${{ github.token }}
planfile: planfile
working-directory: some_dir
id: some_id

then the caller would have to ensure all the plans were available in the local file system, then call uber-terraform-plan-comment with something like:

token: ${{ github.token }}
jobs:
   - id: job1_id
      planfile: job1_planfile
      working-directory: job1_dir
   - id: job2_id
      planfile: job2_planfile
      working-directory: job2_dir

then uber-terraform-plan-comment would have all the plan files available, and then could iterate over the jobs to make the uber comment?

@rdhar
Copy link

rdhar commented Jun 25, 2024

@simonblake-mp Looking at the GitLab issue linked, I really like their proposal diagram, particularly this one:

View GitLab's proposal diagram for Terraform report widget.

image

Like yourself, I too run Terraform in matrix strategy for multiple different directories in various configurations, and I relate to noisy PRs with a whole bunch of comments. With that said, what do you think about this view?

image

The list in this screenshout is a product of TF-via-PR GitHub Action and integrated with GitHub's native status checks, enabling you to easily scan through multiple plan summaries in one place.

It also includes support for commenting TF plan in PR comments and job summaries, as shown here.

View TF-via-PR's output for plans with matrix strategy.

image

You can probably tell I'm the Action's author, which is why I'm on the look-out for use-cases/feature-requests that users are seeking and connecting them to the relevant Action.

@simonblake-mp
Copy link
Author

@rdhar sorry for the delay! That's super pretty - putting the plan/apply output directly into status check line - in a lot of circumstances that would remove the need to post plan comments to the PR at all.

@rdhar
Copy link

rdhar commented Jul 17, 2024

@simonblake-mp Agreed! So if the PR comment is disabled to reduce clutter in the conversation thread, a copy of the plan is attached to the workflow summary for ease of reference/audit (also accessible by clicking Details on the status check line).

@borchero
Copy link
Owner

putting the plan/apply output directly into status check line - in a lot of circumstances that would remove the need to post plan comments to the PR at all.

Up until few weeks ago, I didn't know how easy this would be 😄 so, definitely possible to write a condensed summary to the status check and put the details somewhere else. I'd be grateful for a PR (following some more concrete proposal) unless it is fine that this feature will still take some time 😄

Copy link

🤖 Stalebot

This issue hasn't seen updates in the last 60 days.

If it has been resolved or won't be worked on, please consider closing the issue. Otherwise, it will be closed automatically in 30 days.

@github-actions github-actions bot added the stale label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants