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

SilenceVCSStatusNoProjects does not have an associated flag #4068

Closed
lukemassa opened this issue Dec 17, 2023 · 3 comments · Fixed by #4179
Closed

SilenceVCSStatusNoProjects does not have an associated flag #4068

lukemassa opened this issue Dec 17, 2023 · 3 comments · Fixed by #4179
Labels
bug Something isn't working

Comments

@lukemassa
Copy link
Contributor

lukemassa commented Dec 17, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

SilenceVCSStatusNoProjects in server/user_config.go is one of three entries in the UserConfig struct that does not have a corresponding flag in cmd/server.go. RequireUnDiverged is in the process of being removed (#4047), and Webhooks is more complicated because it's not a simple type and should be dealt with separately (discussion in #4063)

SilenceVCSStatusNoProjects was added in #1469 along with SilenceNoProjects. That PR did add a flag for SilenceNoProjects, but not for SilenceVCSStatusNoProjects.

My recommendation is one of the following:

  1. Add a flag in cmd/server.go, as well as documentation and entry in cmd/server_test.go
  2. Remove SilenceVCSStatusNoProjects from user_config.go, hard-code the value to false everywhere.

I don't know enough about #1469 to know which of these is the best to do. To be clear, right now it is possible for end users to toggle this value, but only if they use --config and specify it in the yaml. Presumably there's no reason to make this setting only configurable with the one mechanism however.

Reproduction Steps

No reference to the map structure in cmd/, only in server/

atlantis % grep -r 'silence-vcs-status-no-projects' cmd server runatlantis.io
server/user_config.go:	SilenceVCSStatusNoProjects bool            `mapstructure:"silence-vcs-status-no-projects"`

Compare to properly configured silence-no-projects:

atlantis % grep -r 'silence-no-projects' cmd server runatlantis.io | grep -v '.vuepress' 
cmd/server.go:	SilenceNoProjectsFlag            = "silence-no-projects"
server/user_config.go:	SilenceNoProjects bool `mapstructure:"silence-no-projects"`
runatlantis.io/docs/server-configuration.md:### `--silence-no-projects`
runatlantis.io/docs/server-configuration.md:  atlantis server --silence-no-projects
runatlantis.io/docs/server-configuration.md:  `--silence-no-projects` will tell Atlantis to ignore PRs if none of the modified files are part of a project defined in the `atlantis.yaml` file.
runatlantis.io/docs/server-side-repo-config.md:* If `no projects` comments are annoying, set [--silence-no-projects](server-configuration.html#silence-no-projects).

Logs

N/A

Environment details

N/A

Additional Context

Related to cleanup for #4063

@lukemassa lukemassa added the bug Something isn't working label Dec 17, 2023
@jamengual
Copy link
Contributor

the flag was totally missed for sure

@nitrocode
Copy link
Member

nitrocode commented Dec 18, 2023

There's a way to automate this away using a single structure via spf13/viper

See

If we implement that, we'll never add an env var without a flag or vice versa.

@lukemassa
Copy link
Contributor Author

@nitrocode I recently opened #4063 to address the fact that we have a few places we have to manually keep in sync. Whether that means detecting via CI, eliminating one of the lists, refactoring to use a technique like above, etc I'm open to, happy to discuss there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants