-
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
fix: Prevent panics when logging HTTP response status in github and gitlab client #4082
Conversation
I think you missed two:
I found these by running the following:
I mentioned in #4081 that it might be worth creating a helper function to handle this in a generic way, but I personally am OK with accepting this PR as is since it explicitly and in a straightforward way guards against panics. We should follow up with a more holistic fix (for example, since this approach means that we don't get logs when |
Thanks for catching these! I just added fixes for both to this PR. I agree, that there may be better ways to solve this. I saw a simple fix, so I thought it was worth proposing. I'd argue that it is worth merging this to fix things, and we can always follow-up with a refactor if that is desired, but I'll let you guys decide. |
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.
lgtm
Fix potential nil pointers. See runatlantis#4081 for context.
Add missing fix for github_client
Add missing fix for gitlab_client
/cherry-pick release-0.27 |
…itlab client (runatlantis#4082) Fix potential nil pointers. See runatlantis#4081 for context.
…itlab client (runatlantis#4082) Fix potential nil pointers. See runatlantis#4081 for context.
what
Fixes #4081
why
Wraps any logging that was added from #3876 with an
if resp != nil
check, to avoid any panicstests
N/A
references