-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
chore: log permissions external command #5027
base: main
Are you sure you want to change the base?
chore: log permissions external command #5027
Conversation
03b61b1
to
3219b58
Compare
Signed-off-by: Chadin Anuwattanaporn <[email protected]>
Signed-off-by: Chadin Anuwattanaporn <[email protected]>
3219b58
to
45d47e0
Compare
Thanks for this @chadinwork. Can you use |
Signed-off-by: Chadin Anuwattanaporn <[email protected]>
Signed-off-by: Chadin Anuwattanaporn <[email protected]>
Sure @X-Guardian, I was following https://github.com/runatlantis/atlantis/blob/main/CONTRIBUTING.md which asked for Updated! |
Good spot. I'll get that updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add some sample log output from these changes to the PR description, so that we can see what they look like.
Co-authored-by: Simon Heather <[email protected]> Signed-off-by: C <[email protected]>
@X-Guardian I've applied suggested changes, and added examples. Let me know if anything else is needed! FYI: I'm out of town from tomorrow onwards for one week, so in case I miss your replies before I go, I'll come back and attend to them after I return. |
return checker.checkOutputResults(out) | ||
outputResults := checker.checkOutputResults(out) | ||
if !outputResults { | ||
ctx.Log.Info("command '%s' returns '%s'", cmd, out) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced that these should be Info
messages. I think Debug
would be better, so they only display when an Atlantis command is run with the -verbose
flag . Same below.
Your examples in the description aren't useful, as they are made up. Please can you provide real world usage messages.
what
command '/etc/scripts/authorization.sh apply repo/here ' returns 'the custom script echo goes here'
such ascommand '/etc/scripts/authorization.sh apply repo/here ' returns 'user \"chadin\" must be a member of \"alice, bob\" to apply changes.'
)Command '/etc/scripts/authorization.sh apply repo/here ' error 'exit status 1: running \"sh -c /etc/scripts/authorization.sh apply repo/here \": \nuser \"chadin\" must be a member of \"xx, yy\" to apply changes.\n'
)User 'chadin' in team '[]' does not have permissions to execute the 'apply' command
)why
tests
make test
andmake test-all
in Docker. All tests passedGive me a while to run manual tests to confirm the logs are actually emitted (need just a bit more time to set up test Terraform repo)Tested and verified working!references