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

fix: Update Conftest 'Failed to get default conftest version' Log entry to Info #3632

Merged
merged 2 commits into from
Jul 28, 2023

Conversation

X-Guardian
Copy link
Contributor

what

Update the ConfTest log message if the default conftest version is not found from warning to info, as this message complete with a Go stack trace is logged even if conftest is not configured.

why

Remove an irrelevant Go stack trace log entry which is logged on every Atlantis service start.

tests

Log entry before the change:

{"level":"warn","ts":"2023-07-28T14:13:14.405+0100","caller":"policy/conftest_client.go:151","msg":"failed to get default conftest version. Will attempt request scoped lazy loads DEFAULT_CONFTEST_VERSION not set"
,"json":{},"stacktrace":"github.com/runatlantis/atlantis/server/core/runtime/policy.NewConfTestExecutorWorkflow\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/server/core/runtime/policy/conftest_client.go:151\n
github.com/runatlantis/atlantis/server.NewServer\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/server/server.go:607\ngithub.com/runatlantis/atlantis/cmd.
(*DefaultServerCreator).NewServer\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/cmd/server.go:647\ngithub.com/runatlantis/atlantis/cmd.
(*ServerCmd).run\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/cmd/server.go:774\ngithub.com/runatlantis/atlantis/cmd.
(*ServerCmd).Init.func2\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/cmd/server.go:662\ngithub.com/runatlantis/atlantis/cmd.
(*ServerCmd).withErrPrint.func1\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/cmd/server.go:1134\ngithub.com/spf13/cobra.
(*Command).execute\n\t/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:940\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:1068\ngithub.com/spf13/cobra.
(*Command).Execute\n\t/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:992\ngithub.com/runatlantis/atlantis/cmd.
Execute\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/cmd/root.go:30\nmain.main\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/main.go:66\nruntime.main\n\t/usr/lib/go-1.20/src/runtime/proc.go:250"}

Log entry after the change:

{"level":"info","ts":"2023-07-28T14:23:05.058+0100","caller":"policy/conftest_client.go:151","msg":"failed to get default conftest version. Will attempt request scoped lazy loads DEFAULT_CONFTEST_VERSION not set","json":{}}

references

@X-Guardian X-Guardian requested a review from a team as a code owner July 28, 2023 13:27
@github-actions github-actions bot added the go Pull requests that update Go code label Jul 28, 2023
Copy link
Contributor

@jamengual jamengual left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@X-Guardian FINALLY someone took the time to get rid of this message, thanks for the contribution.

@jamengual jamengual enabled auto-merge (squash) July 28, 2023 19:04
@jamengual jamengual merged commit 9aae60f into runatlantis:main Jul 28, 2023
12 checks passed
ijames-gc pushed a commit to gocardless/atlantis that referenced this pull request Feb 13, 2024
ijames-gc pushed a commit to gocardless/atlantis that referenced this pull request Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants