-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Prevent NPE on commenting on lines with invalidated comments (with migration) #12549
Merged
lafriks
merged 4 commits into
go-gitea:master
from
zeripath:fix-12239-review-page-500-with-migration
Aug 21, 2020
Merged
Prevent NPE on commenting on lines with invalidated comments (with migration) #12549
lafriks
merged 4 commits into
go-gitea:master
from
zeripath:fix-12239-review-page-500-with-migration
Aug 21, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Only check for a review if we are replying to a previous review. Prevent the NPE in go-gitea#12239 by assuming that a comment without a Review is non-pending. Fix go-gitea#12239 Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
zeripath
added
type/bug
issue/critical
This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP
labels
Aug 20, 2020
Codecov Report
@@ Coverage Diff @@
## master #12549 +/- ##
==========================================
- Coverage 43.48% 43.44% -0.05%
==========================================
Files 642 643 +1
Lines 71040 71129 +89
==========================================
+ Hits 30893 30900 +7
- Misses 35136 35222 +86
+ Partials 5011 5007 -4
Continue to review full report at Codecov.
|
GiteaBot
added
the
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
label
Aug 20, 2020
mrsdizzie
approved these changes
Aug 20, 2020
GiteaBot
added
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
and removed
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
labels
Aug 20, 2020
Use #12548 as basis for backport. |
lafriks
pushed a commit
that referenced
this pull request
Aug 21, 2020
…#12550) * Prevent NPE on commenting on lines with invalidated comments Only check for a review if we are replying to a previous review. Prevent the NPE in #12239 by assuming that a comment without a Review is non-pending. Fix #12239 Signed-off-by: Andrew Thornton <[email protected]> * Add hack around to show the broken comments Signed-off-by: Andrew Thornton <[email protected]>
lafriks
approved these changes
Aug 21, 2020
GiteaBot
added
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
and removed
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
labels
Aug 21, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
backport/done
All backports for this PR have been created
issue/critical
This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
type/bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#12239 reports an NPE when viewing the diff page of a PR when comments are made on a line that has previously had comments invalidated on it.
@mrsdizzie discovered the mechanism and reason this occurs.
This PR fixes the above NPE by preventing a review being assigned to 0 by only checking for a review if we are replying to a previous review and migrates all broken reviews to create a review and code comment for them.
Fix #12239
Closes #12548
Signed-off-by: Andrew Thornton [email protected]