Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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:main
base:main
Choose a base branch
Loading
fromlunny:lunny/code_review_line_number
Draft
Show file tree
Hide file tree
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…
lunnyJul 13, 2025
f8cea67
improvements
lunnyJul 14, 2025
eddd21b
Refactor calc mergebase
lunnyJul 14, 2025
5ba2216
improvements
lunnyJul 14, 2025
aaa5364
Add migrations for wrong negative line number in the review code comment
lunnyJul 14, 2025
2256fa7
Fix bug
lunnyJul 14, 2025
65a01c2
Fix bug
lunnyJul 15, 2025
968b2c5
Fix bug
lunnyJul 15, 2025
e895298
Fix bug
lunnyJul 15, 2025
c68718d
Fix test
lunnyJul 15, 2025
01476db
Fix test
lunnyJul 15, 2025
c58cc46
Fix bug
lunnyJul 15, 2025
cc62a93
Remove unused router and test
lunnyJul 16, 2025
c4f7e31
Fix bug
lunnyJul 16, 2025
64dec56
Fix bug
lunnyJul 16, 2025
e279f0e
Rename
lunnyJul 16, 2025
aaed5c9
remove the code extract to other pull requests
lunnyJul 16, 2025
45931b3
revert unnecessary change
lunnyJul 19, 2025
1ecac1a
Don't use migrations but use a doctor to fix old negative line number…
lunnyJul 19, 2025
99b5634
Fix
lunnyJul 19, 2025
be18643
Add test and comment
lunnyJul 20, 2025
68e5b28
add test
lunnyJul 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Add migrations for wrong negative line number in the review code comment
  • Loading branch information
@lunny
lunny committedJul 19, 2025
commitaaa53641aed8c01556462067e44dda05a416c298
4 changes: 4 additions & 0 deletionsmodels/migrations/migrations.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,7 @@ import (
"code.gitea.io/gitea/models/migrations/v1_22"
"code.gitea.io/gitea/models/migrations/v1_23"
"code.gitea.io/gitea/models/migrations/v1_24"
"code.gitea.io/gitea/models/migrations/v1_25"
"code.gitea.io/gitea/models/migrations/v1_6"
"code.gitea.io/gitea/models/migrations/v1_7"
"code.gitea.io/gitea/models/migrations/v1_8"
Expand DownExpand Up@@ -382,6 +383,9 @@ func prepareMigrationTasks() []*migration {
newMigration(318, "Add anonymous_access_mode for repo_unit", v1_24.AddRepoUnitAnonymousAccessMode),
newMigration(319, "Add ExclusiveOrder to Label table", v1_24.AddExclusiveOrderColumnToLabelTable),
newMigration(320, "Migrate two_factor_policy to login_source table", v1_24.MigrateSkipTwoFactor),

// Gitea 1.24.0 ends at database version 321
newMigration(321, "Migrate commit id of pull requests code review comment", v1_25.MigrateCommitIDOfPullRequestCodeReviewComment),
}
return preparedMigrations
}
Expand Down
14 changes: 14 additions & 0 deletionsmodels/migrations/v1_25/v321.go
View file
Open in desktop
Original file line numberDiff line numberDiff 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
}

[8]ページ先頭

©2009-2025 Movatter.jp