-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Server error on user-specific PR diff and a pruned commit #21392
Comments
Ok, yeah, I have a pretty good guess of what's going wrong: services/gitdiff/gitdiff.go:1239: changedFiles, err := gitRepo.GetFilesChangedBetween(review.CommitSHA, latestCommit) probably throws this error simply because Git is asked to display the changes between the two commits, and can't find the first one. |
How about to pre-emptively check if gitea/services/gitdiff/gitdiff.go Lines 1227 to 1230 in b59b0ca
Then we'd not need to check for a specific error later. |
The problem is: That's impossible*. |
Right, I understand there is an effort to limit calls to git. I'm not sure what kind of git errors does Gitea recognize, so that it would need to differentiate between them. Possibly all errors from the user-specific diff could be catched, so that opening a user-independent diff works, and all files are considered as changed? |
When a PR reviewer reviewed a file on a commit that was later gc'ed, they would always get a `500` response from then on when loading the PR. This PR simply ignores that error and instead marks all files as unchanged. This approach was chosen as the only feasible option without diving into **a lot** of error handling. Fixes #21392 Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
When a PR reviewer reviewed a file on a commit that was later gc'ed, they would always get a `500` response from then on when loading the PR. This PR simply ignores that error and instead marks all files as unchanged. This approach was chosen as the only feasible option without diving into **a lot** of error handling. Fixes go-gitea#21392 Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
When a PR reviewer reviewed a file on a commit that was later gc'ed, they would always get a `500` response from then on when loading the PR. This PR simply ignores that error and instead marks all files as unchanged. This approach was chosen as the only feasible option without diving into **a lot** of error handling. Fixes #21392 Backport of #21487 Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
Description
This is an edge case happening with the following conditions:
Observed behavior:
Steps to replicate:
author
gitea/conf/app.ini
:author
repo
with initializedmain
branch, userreviewer
, add him torepo
collaboratorsrepo
feature
, edit a file, commit, pushauthor
feature
branch, assignreviewer
as reviewerreviewer
author
reviewer
722a5b…
is the pruned commit,47703d…
is the amended commitExpected behavior:
Workaround:
Gitea Version
1.17.2
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
https://gist.github.com/zakjan/3e3c3574ac9df73d2e2bf0e717cd685d
Screenshots
Git Version
2.36.2
Operating System
macOS
How are you running Gitea?
Docker
Database
SQLite
The text was updated successfully, but these errors were encountered: