-
Notifications
You must be signed in to change notification settings - Fork 15
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: quiet flag to stop credential process errors #160
fix: quiet flag to stop credential process errors #160
Conversation
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.
Sorry for keeping you waiting so long. Holiday season is finally over, time for some review 🔍 😀
First of all: Thanks for your PR, your contribution and your input! I really appreciate that!
Regarding the non-interactive
alias - I would simply drop it, as it adds no benefit imo; --quiet
or -q
are totally fine.
What do you think?
I will take that point with me and create an issue out of it to have a look and work on it. Thanks for the detailed input! Edgy edge cases sometimes bite back. |
Interesting point! I will also create an issue for that, to look into and play around with it. |
I agree. Keeping it simple is better. |
The quiet flag and alias are sufficient for the need and the redundant non-interactive flag can be left out Co-authored-by: Tim Heurich <[email protected]>
4e984c4
to
190575e
Compare
Resolves #159
main.initializeLogger()
now installs a no-op logger as the global logger if a "quiet" flag has been passed to the CLI argument parser-q
,--quiet
, and--non-interactive
flags as options on theassume
subcommand. These could be moved to a higher scope later if useful, but they currently only appear to be relevant to this subcommand-q
flag on profile creationioutil.ReadFile
toos.ReadFile
to resolve deprecation notesDiscussion: the root problem here is the frequent use of
zap.Fatal()
through the application code. This causes the test execution process to immediately terminate without collecting failure logging when any application error occurs. Since the zap logger is not initialized for test runs, it is difficult to see where the problem is happening without debugging. Debugging is hard since it worked 100% of the time on my machine, only failing in the GitLab Actions. I wasn't able to determine if the failure was due to themain
andassume
tests having an interaction because of concurrency, or due to interactions between subsequent runs in the Actions environment with restored caches. I suspect the former, but it got late. I was thinking that the same behavior, but with better failure notification in the tests might be achieved by usingzap.Panic()
rather thanzap.Fatal()
, but I haven't thought through the implications. Providing a wrapper interface/factory for zap that could be overridden with a mock in the tests would also solve the same problems. The temp file location might also have a testing override to ensure that test cases are isolated from each other.Not fixed:
shlex.quote
function and I didn't want to add a dependency for a different issue than the one I was working on.