https://www.runatlantis.io/ logo
Title
y

Yunchi Luo

04/11/2023, 9:47 PM
hello, I can’t seem to get Atlantis to hide previous comments. It’s deployed using the ECS fargate terraform module, and I checked that it has the
ATLANTIS_HIDE_PREV_PLAN_COMMENTS=true
environment variable set. Pasted some debug logs that said the
atlantis.github.hide_prev_plan_comments.execution_success
counter got ticked up. But the previous comment isn’t being hidden. Any idea what might the problem be?
Untitled
running
v0.23.3
p

PePe Amengual

04/11/2023, 9:55 PM
does the Atlantis user have permissions to comments?
y

Yunchi Luo

04/11/2023, 9:56 PM
this is what it has, I think so?
p

PePe Amengual

04/11/2023, 9:57 PM
seems right
t

Tyler Allen

04/11/2023, 10:25 PM
Could be one of these conditions causing it to continue before minimizing
!strings.Contains(firstLine, strings.ToLower(command)) 

comment.User != nil && !strings.EqualFold(comment.User.GetLogin(), g.user)

len(body) == 0
Seems like the only one that might be doing it is the second one, where the user configured on atlantis side doesn't match the commented username
It will also only hide the subsequent command of the same type, i.e. plan hides plan
p

PePe Amengual

04/11/2023, 10:29 PM
atlantis will hide any of it’s own comments
y

Yunchi Luo

04/11/2023, 11:07 PM
hmm yeah it’s definitely a comment by atlantis. I’m using a GitHub App so it’s got its own name and is marked
bot
.
i don’t think there’s anything particularly unique about my setup…? Private github org, github app installed into the org and enabled for just this repo, using terragrunt. Atlantis is using ephemeral disk but it hasn’t restarted recently
p

PePe Amengual

04/11/2023, 11:10 PM
if you try in a personal repo for example?
y

Yunchi Luo

04/11/2023, 11:11 PM
It was located in my personal repo earlier. It also didn’t collapse comments but I assumed it was because I kept restarting it
Repo’s been deleted now 😕
Restarts shouldn’t effect it looking at those conditionals @Tyler Allen posted right?
p

PePe Amengual

04/11/2023, 11:13 PM
you need at least two comments for atlantis to collapse one
y

Yunchi Luo

04/11/2023, 11:13 PM
yeah, i’ve got exactly two comments. Both expanded
Also, I assume this log line means Atlantis thinks it successfully collapsed a comment?
{"name":"atlantis.github.hide_prev_plan_comments.execution_success","value":1,
p

PePe Amengual

04/11/2023, 11:14 PM
you have debug enabled?
y

Yunchi Luo

04/11/2023, 11:15 PM
{"level":"debug",
^ i have that in the logs, left the defaults
yeah, i have
ATLANTIS_LOG_LEVEL=debug
oh that’s super weird. I think that log line means atlantis (thinks it) successfully called github to hide a comment… but no comment was hidden https://github.com/runatlantis/atlantis/blob/fd1ce4328dcc160e9375afb74722be530809a8e8/server/events/vcs/instrumented_client.go#L131
p

PePe Amengual

04/11/2023, 11:43 PM
did you tried more than 2 times?
running atlantis plan?
y

Yunchi Luo

04/11/2023, 11:54 PM
Just ran it again. Now I have 3 not hidden comments from Atlantis in the PR…
p

PePe Amengual

04/12/2023, 12:33 AM
It works fine for me in ECS
but I wonder if maybe is a permissions issue still
can you try give admin? and see
e

Ed

04/12/2023, 8:45 AM
wasn’t there an issue with hiding comments and github app name
y

Yunchi Luo

04/12/2023, 3:41 PM
oooo, that looks like it could be the issue
my github app has a space in it and so i’m gonna have to get an admin to rename it…
p

PePe Amengual

04/12/2023, 4:06 PM
Ed is right, that will do it