This message was deleted.
# atlantis-contributors
s
This message was deleted.
l
The latter does have a flag, and it's configured like this:
Copy code
SilenceVCSStatusNoPlans: {
		description:  "Silences VCS commit status when autoplan finds no projects to plan.",
		defaultValue: false,
	},
Which is basically verbatim the comment currently above `SilenceVCSStatusNoProjects`:
Copy code
// SilenceVCSStatusNoProjects is whether autoplan should set commit status if no projects
	// are found.
There are several places in the code where they are used together:
Copy code
if !(p.silenceVCSStatusNoPlans || p.silenceVCSStatusNoProjects)
It seems like maybe it's controlling whether we silence update statuses during the plan command or for any command
I wonder if we want to maybe deprecate NoPlans and only have NoProjects?
Actually looking closer, the only place that
silenceVCSStatusNoPlans
is used in code is that above "or" if statement. So if we remove
silenceVCSStatusNoPlans
and tell users to use
silenceVCSStatusNoProjects
it'll have the same effect. Only downside might be if users do want to not set commit statuses on Plans but do not for other commands
I don't care too much either way, I just want to make sure all the user_config settings we have have corresponding flags
d
That’s a great question. I can’t remember if I added that flag unintentionally or if it got refactored as part of my feature contribution. I’d say remove it, and if people want it we’ll figure out how to properly set it
Because it’s not accessible right now
l
To be clear there are two settings in user config
SilenceVCSStatusNoPlans
and
SilenceVCSStatusNoProjects
Only the former has a flag associated with it
however both of the settings are used in the command runner code
I think the options are: 1. Remove
SilenceVCSStatusNoProjects
as a config in user_config, replace all the logic throughout the code as it if were hard-coded to "false" 2. Add a flag for
SilenceVCSStatusNoProjects
and leave
SilenceVCSStatusNoPlans
3. Add a flag for
SilenceVCSStatusNoProjects
and deprecate
SilenceVCSStatusNoPlans
4. Remove
SilenceVCSStatusNoProjects
as a config in user_config, and deprecate
SilenceVCSStatusNoPlans
d
Let review this tomorrow and I’ll decide
l
@Dylan Page any thoughts here?
^^ ping
d
oh shoot, how'd I miss this
I think we do 2
I re-read the PR and was trying to address comment about stale status checks at the time
SilenceVCSStatusNoPlans
was originally only a part of autoplan
and there was a case made where we always want Atlantis to return a status check even if there are no projects, but some people do not
l
Cool sounds good, I'll see if I can add that flag
👍 1
That said, I'm still not wild about this solution. I understand the desire to differentiate between something that silences for all plans and something that silences for any command, but this option has not been possible in the 3y since the code was introduced, so seems unlikely anyone would find it useful
Additionally I had to edit the documentation for
SilenceVCSStatusNoPlans
since, as written, it was literally what
SilenceVCSStatusNoProjects
should be if I understand correctly
I get that maybe at the time of #1469 it was thought that maybe users would want this functionality, but I don't see any issues or discussion around it, so it feels like we're "adding" an unnecessary configuration option at this point
So my personal view is we go with 1)
That said, if you still feel like we should go with 2) @Dylan Page, I believe my PR above implements it and, modulo any wording issues, can be merged as is. My real concern here is less to do w this particular feature and more with being able to implement a holistic fix for https://github.com/runatlantis/atlantis/issues/4063 (i.e., making sure all flags are configured properly)
d
Its been possible from the user config, just not passable as a flag
👍 1
I generally believe there are too many flags, and we should default to the config as much as possible, but this is more so for consistency sake even the nature of the issue
l
that's a good enough reason for me
👍 1
I may argue for the deprecation of either it or SilenceVCSStatusNoPlans in the future, but for now I'm just trying to align the yaml with the flags 🙂
d
yup, I'm not attached to either and it can be a brain bender trying to do the mental gymnastics of "why is this like this. As long as we're consistent now, and can make a decision later once we better understand what they are doing
👍 1
l
Plus at this point, we don't have a mechanism to deprecate yaml settings, only flags, so there'd be no way to even identify to users that they shouldn't be using this setting
💯 1
(I'd like to tackle that problem too after #4063, since users who put values into yaml should get the same deprecation warnings as those who use flags)