Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.9k
Allow code review comments crossing commit with right line number#35077
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Draft
lunny wants to merge22 commits intogo-gitea:mainChoose a base branch fromlunny:lunny/code_review_line_number
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Draft
Changes from1 commit
Commits
Show all changes
22 commits Select commitHold shift + click to select a range
345ae04
Allow code review comments display cross commits even if the head bra…
lunnyf8cea67
improvements
lunnyeddd21b
Refactor calc mergebase
lunny5ba2216
improvements
lunnyaaa5364
Add migrations for wrong negative line number in the review code comment
lunny2256fa7
Fix bug
lunny65a01c2
Fix bug
lunny968b2c5
Fix bug
lunnye895298
Fix bug
lunnyc68718d
Fix test
lunny01476db
Fix test
lunnyc58cc46
Fix bug
lunnycc62a93
Remove unused router and test
lunnyc4f7e31
Fix bug
lunny64dec56
Fix bug
lunnye279f0e
Rename
lunnyaaed5c9
remove the code extract to other pull requests
lunny45931b3
revert unnecessary change
lunny1ecac1a
Don't use migrations but use a doctor to fix old negative line number…
lunny99b5634
Fix
lunnybe18643
Add test and comment
lunny68e5b28
add test
lunnyFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Add migrations for wrong negative line number in the review code comment
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commitaaa53641aed8c01556462067e44dda05a416c298
There are no files selected for viewing
4 changes: 4 additions & 0 deletionsmodels/migrations/migrations.go
This file contains hidden or 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
14 changes: 14 additions & 0 deletionsmodels/migrations/v1_25/v321.go
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2025 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
package v1_25 | ||
import ( | ||
"xorm.io/xorm" | ||
) | ||
// MigrateCommitIDOfPullRequestCodeReviewComment this will be almost right before comment on the special commit of the pull request | ||
func MigrateCommitIDOfPullRequestCodeReviewComment(x *xorm.Engine) error { | ||
_, err := x.Exec("UPDATE comment SET commit_sha = (select merge_base from pull_request WHERE issue_id = comment.issue_id) WHERE line < 0") | ||
return err | ||
} |
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.