-
Notifications
You must be signed in to change notification settings - Fork 150
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
Avoided panic on empty body of PR and Issue #351
Conversation
Codecov Report
@@ Coverage Diff @@
## master #351 +/- ##
==========================================
- Coverage 21.68% 21.66% -0.02%
==========================================
Files 10 10
Lines 2638 2640 +2
==========================================
Hits 572 572
- Misses 2029 2031 +2
Partials 37 37
Continue to review full report at Codecov.
|
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.
Thanks for the fix 👍
Indeed, result
should never be nil
if err != nil
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! Thanks for the fix!
@DHaussermann I'm happy to review this one myself, given that I also found the bug. |
@hanzei or @larkox If you have a bit of time, could one of you peer-test this PR using the peer testing process documented here https://mattermost.atlassian.net/wiki/spaces/INT/pages/619937892/Peer+Testing+Process |
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.
Scope
Empty body of PRs and issues should not crash plugin
Testing notes
- Links to PRs and issues with empty bodies don't crash the plugin any longer
- Tooltip for these are correctly shown
- Removing of HTML comments still work
Follow-up concerns
None
Thanks for testing @hanzei. Follow-up on this So I can make sure there is appropriate release testing in place. How is it possible to create a PR where |
/update-branch |
@DHaussermann E.g. mattermost/mattermost-plugin-demo#112 is a PR without a description, which would cause a panic. I haven't found an issue to reproduce the issue for far. |
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.
Tested and passed
Thanks @hanzei for peer testing. I have added release coverage for the end to end testing.
Huge thanks @abdulsmapara for fixing this! Much appreciated.
Summary
nil
before accessing it to avoid panic.result
obtained by callingGet()
on PR/Issue is nevernil
as other functions do not check this condition (Reference: https://github.com/mattermost/mattermost-plugin-github/blob/master/server/plugin/api.go#L489).Ticket Link
Extension to the PR #326 that fixes #312