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

Feat: Make "No changes" stand out more + add summary of number of (un)changed projects #2069

Open
syphernl opened this issue Feb 16, 2022 · 10 comments
Labels

Comments

@syphernl
Copy link
Contributor

We frequently plan multiple "projects" at the same time. Scanning trough the text looking for ~10-15 "No changes" is rather annoying and could be overlooked easily. Could this somehow stand out more?
E.g. by adding an emoji or making the text bold?

It would also be nice if Atlantis could be more verbose in regards to the number of failed, unchanged projects e.g.:

Ran Plan for 4 projects: 1 will be changed, 2 will be unchanged, 1 has failed (locked)
@dohnto
Copy link

dohnto commented Feb 17, 2022

I have a similar scenario but different view - we often have so many "No changes" modules, that the ones which actually changed are easy to overlook. I would prefer to hide the "No changes" entirely or just a have small summary instead.

@syphernl
Copy link
Contributor Author

I would prefer to hide the "No changes" entirely or just a have small summary instead.

That might actually be better 👍🏻

@inkel
Copy link
Contributor

inkel commented Feb 17, 2022

It seems we are all facing the same issue, which is why I was looking at Atlantis' code last week that renders this plans and there are no current ways of doing it.

The only solution I can think of is forking Atlantis and making the necessary changes. Then we could run our fork with all the things we like, and eventually contribute the changes upstream.

@inkel
Copy link
Contributor

inkel commented Feb 17, 2022

And given we're taking about this: don't you also find it annoying that sometimes when there are no changes the result is something like:

  1. terraform/clusters/dev-us-central-0
Just a few lines of Terraform output saying that there were no changes.

And other times is:

  1. terraform/clusters/dev-us-central-0
Show output
Some lines with Terraform drift.

Just a few lines of Terraform output saying that there were no changes.

I've found why it is inconsistent like this, and it is because of how many lines of output it has. If it's over 11 (I think) then it uses a <details> block. This is another thing I find annoying.

@frimik
Copy link

frimik commented Nov 22, 2022

Please nest the folding (<details>) blocks to give a top-level one like @syphernl suggest but include everything you know in the summary.

  1. The project summary as suggested
  2. The summarized total of all projects (add, change, destroy):

Here's the most exaggerated (but still very useful) target ... maybe a compromise is in order.

Could we perhaps even template this so operators can choose a layout that suits them?

This would help immensely as we sometimes have 50-100 plans in case some central lib or module changed.

Overview

Ran Plan for 9 projects
🔧✔️⚠️🔒
3411
Summary: 59 to add, 24 to change, 18 to destroy.
  1. dir: terraform/infra/foo-infra/buildfarm workspace: default
  2. dir: terraform/infra/foo-infra/prod workspace: default
  3. dir: terraform/infra/foo-infra/corp-stuff workspace: default
  4. dir: terraform/infra/foo-infra/int/test-things workspace: default
  5. dir: terraform/infra/foo-infra/int/ecr-repositories workspace: default
  6. dir: terraform/infra/foo-infra/int/tools-in-there workspace: default
  7. dir: terraform/infra/foo-infra/prd/prod-2-widgets workspace: default
  8. dir: terraform/infra/foo-infra/prd/prod-rest workspace: default
  9. dir: terraform/infra/foo-infra/prd/toolshed workspace: default

Details

59 to add, 24 to change, 18 to destroy.

3. dir: terraform/infra/foo-infra/crp/foobars workspace: default

Show Output
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
! update in-place

Terraform will perform the following actions:

Plan: 3 to add, 1 to change, 0 to destroy.
Releasing state lock. This may take a few moments...
  • ▶️ To apply this plan, comment:
    • atlantis apply -d terraform/infra/foo-infra/prd/prodstuff
  • 🔁 To plan this project again, comment:
    • atlantis plan -d terraform/infra/foo-infra/prd/prodstuff

Note: Objects have changed outside of Terraform
Plan: 3 to add, 1 to change, 0 to destroy.


8. dir: terraform/infra/dice-infra/prd/prodfluff workspace: default

Show Output ```diff

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:

  • create
    ! update in-place

Terraform will perform the following actions:

module.eks.module.efs_csi_irsa_role.aws_iam_policy.efs_csi[0] will be created

  • resource "aws_iam_policy" "efs_csi" {
  •   arn         = (known after apply)
    
  •   description = "Provides permissions to manage EFS volumes via the container storage interface driver"
    
  •   id          = (known after apply)
    
  •   name        = (known after apply)
    
  •   name_prefix = "AmazonEKS_EFS_CSI_Policy-"
    
  •   path        = "/"
    
  •   policy      = jsonencode(
          {
    
  •           Statement = [
    
  •               {
    
  •                   Action   = [
    
  •                       "elasticfilesystem:DescribeMountTargets",
    
  •                       "elasticfilesystem:DescribeFileSystems",
    

</details>
</details>
</details>

@nitrocode
Copy link
Member

We recently merged in custom templating that could be used here to test out different templates like the ones suggested.

IMHO the Github App ChecksAPI would be even better to implement so each project would get it's own page (see #936).

@frimik
Copy link

frimik commented Nov 22, 2022

We recently merged in custom templating that could be used here to test out different templates like the ones suggested.

IMHO the Github App ChecksAPI would be even better to implement so each project would get it's own page (see #936).

Splendid.. will check it out. (We're on GitLab so am trying to abuse what's available in formatting there...).

@samlaf
Copy link

samlaf commented Jun 1, 2023

@nitrocode I think you're referring to #1026?
Is there any doc anywhere giving examples for how to use this custom templating functionality to remove output from plans with no changes? Haven't found anything from googling.

@nitrocode
Copy link
Member

See #3158

https://www.runatlantis.io/docs/server-configuration.html#hide-unchanged-plan-comments

@inkel
Copy link
Contributor

inkel commented Jun 2, 2023

@frimik that idea that you proposed is actually something I had in mind for a while. I've been working on a branch for a while that should at the very least provide plan stats to the Markdown template renderer, which combined with overriding the templates would allow for people to do something similar to what you mention. I'll try and make it a PR soon.

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

6 participants