This message was deleted.
# atlantis-community
s
This message was deleted.
d
Can you clarify the issue you are seeing? How is it not being respected and in what conditions?
a
We have 2 atlantis servers running for the same repo but different config files defined in repo.yaml, atlantis and atlantis-prod, with the following relevant configurations. atlantis-prod uses
atlantis-production.yaml
Copy code
- --silence-vcs-status-no-plans
- --silence-no-projects
- --executable-name=atlantis-prod
- --vcs-status-name=atlantis
atlantis-nonprod uses
atlantis-nonprod.yaml
Copy code
- --silence-vcs-status-no-plans
- --silence-no-projects
In the following scenario: 1. We open a PR for a project defined in the
atlantis-production.yaml
file 2. Autoplan runs and atlantis-prod comments with plan as expected 3. If we run
atlantis plan
to test that the other server won’t interact a. Actual Behavior i. we get the emoji reaction from atlantis-nonprod ii. We get no comments from atlantis-nonprod iii. We get a successful status check atlantis/plan 0/0 projects (there is already another plan that is successful from atlantis-prod) b. Expected Behavior i. we get the emoji reaction from atlantis-nonprod ii. We get no comments from atlantis-nonprod iii. We get no status check update from atlantis-nonprod 4. If we run
atlantis apply
to test that the other server won’t interact a. Actual Behavior i. we get the emoji reaction from atlantis-nonprod ii. we get no comments from atlantis-nonprod iii. We get a successful status check atlantis/apply which results in all checks passing on the PR and it becoming mergeable with unapplied changes b. Expected Behavior i. we get the emoji reaction from atlantis-nonprod ii. We get no comments from atlantis-nonprod iii. We get no status check update from atlantis-nonprod We understood from the docs that
silence-vcs-status-no-plans
will prevent the other instance from updating vcs status. So when we found the
silence-vcs-status-no-projects
flag value is being checked in some of those code paths we went looking for it hoping it would resolve the issue we are seeing.
I apologize for the wall of text. I was trying to capture the whole picture.
d
You need
silence-vcs-status-no-projects
. That is the behavior you are expecting when no projects are detected.
The other flag will silence when no plans are needed. “No changes detected” etc
Since there are no projects (0/0) it posts the vcs status
a
Yes I realize we need it but Atlantis won’t accept it as a valid flag. It is not in documentation. In the PR referenced above, the flag is there but not surfaced in docs and there is likely a user config validator somewhere that does not have it.
d
huh interesting
I can't comment on a feature a few years ago, but let me dig into the code more. Can you fill out a formal issue with this information, please?
p
the code seems to be there
mmmm
b
^ What's strange is none of the other debug statements ran after
<http://ctx.Log.Info|ctx.Log.Info>("determined there was no project to run plan in")
, implying
silenceVCSStatusNoProjects
actually was set somehow in the code path above
But the Apply from the non-prod instance w/ no projects still ran and reported a success (0/0) VCS status as described
d
I wonder if a bug was introduced with https://github.com/runatlantis/atlantis/pull/2969
👀 1
I will have to delve deeper and that will take some time
b
The flag for
SilenceVCSStatusNoProjects
should work fine passed in the same way as these two were in the config, correct?
Copy code
--silence-vcs-status-no-plans
--silence-no-projects
I'll write up an issue documenting the behavior we're seeing, but digging into the code itself I was confused why we aren't able to set it as expected
d
It might be a slight oversight, and no one caught it or it might be something deeper
p
it happens only on the apply?
b
Both plan and apply update the status (with 0/0 projects success). Note that
silence-vcs-status-no-projects
cannot be set, which as Dylan said is meant to prevent exactly this from what I can see
a
Also, comment in the code here says
autoplan
is the behavior different for autoplan vs running
atlantis plan
?
Also we noticed the following. the comment here details the steps to add a flag as:
Copy code
// To add a new flag you must:
// 1. Add a const with the flag name (in alphabetic order).
// 2. Add a new field to server.UserConfig and set the mapstructure tag equal to the flag name.
// 3. Add your flag's description etc. to the stringFlags, intFlags, or boolFlags slices.
Looking at code it seems that the SilenceVCSStatusNoProjects is in UserConfig but not in cmd/server.go and not in the boolFlags slice.
p
that seems to be correct
I can’t find where it was deleted
I think it was never added as a flag, if you set the
silence-no-projects
it should automatically set SilenceVCSStatusNoProjects to true to then update the status correctly
a
I think it was never added as a flag, if you set the
silence-no-projects
it should automatically set SilenceVCSStatusNoProjects to true to then update the status correctly
I was looking for exactly that bit of code yesterday and couldn’t find it. Can you point me to it please?
And currently that’s not the behavior we are seeing.
p
it is definitely broken, no questions, I was trying to find where it or removed or changed
👍 1
with debug enabled you guys see
setting VCS status to success with no projects found
in the messages?
a
with debug enabled, we see
determined there was no project to run plan in
as the only log from this flow.
it used to be
Copy code
if !(p.silenceVCSStatusNoPlans || p.silenceVCSStatusNoProjects) {
👀 1
b
I tried to capture all the context in this issue here: https://github.com/runatlantis/atlantis/issues/3853 Thanks for brainstorming with us in this thread 🙂 @Dylan Page @PePe Amengual
👍🏽 1