-
-
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
Fix internal sever error when visiting a PR that bound to the deleted team #24127
Conversation
I think it's better to just show "ghost team" or "deleted team" instead of such complex logic. For example, if you create a team "MyTeam" , then request review from it, then delete it, then create a new "MyTeam", the new team is not the old team. |
Agree. I'm not going to match the two teams if they have the same name, just want to preserve the original information in the comment as much as possible. |
Just displaying ”Ghost Team“ in the comment looks more concise, and there will be no misunderstanding. |
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.
I'll accept this change for now.
As a long-term solution we need to do something similar to the ghost user and add a ghost team.
Codecov Report
@@ Coverage Diff @@
## main #24127 +/- ##
==========================================
- Coverage 47.14% 47.13% -0.02%
==========================================
Files 1149 1161 +12
Lines 151446 153767 +2321
==========================================
+ Hits 71397 72471 +1074
- Misses 71611 72773 +1162
- Partials 8438 8523 +85
... and 156 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
* giteaofficial/main: (26 commits) Make HTML template functions support context (go-gitea#24056) Fix issue attachment handling (go-gitea#24202) Update JS dependencies (go-gitea#24218) Remove most path-based golangci exclusions (go-gitea#24214) [skip ci] Updated translations via Crowdin Fix internal sever error when visiting a PR that bound to the deleted team (go-gitea#24127) Add owner team permission check test (go-gitea#24096) Fix incorrect CORS default values (go-gitea#24206) Add repository counter badge to repository tab (go-gitea#24205) Fix template error in pull request with deleted head repo (go-gitea#24192) Make wiki title supports dashes and improve wiki name related features (go-gitea#24143) Fix Resolve Conversation not working in Conversation view (go-gitea#24191) Vertical widths of containers removed (go-gitea#24184) Don't list root repository on compare page if pulls not allowed (go-gitea#24183) Add unset default project column (go-gitea#23531) Allow adding new files to an empty repo (go-gitea#24164) Add runner check in repo action page (go-gitea#24124) Use same action status svg icons on actions list as on action page (go-gitea#24178) [skip ci] Updated translations via Crowdin fix calReleaseNumCommitsBehind (go-gitea#24148) ... # Conflicts: # templates/repo/wiki/view.tmpl
Close: #23738
The actual cause of
500 Internal Server Error
in the issue is not what is descirbed in the issue.The actual cause is that after deleting team, if there is a PR which has requested reivew from the deleted team, the comment could not match with the deleted team by
assgin_team_id
. So the value of.AssigneeTeam
(see below code block) isnil
which cause500 error
.gitea/templates/repo/issue/view_content/comments.tmpl
Lines 691 to 695 in 1c8bc40
To fix this bug, there are the following problems to be resolved:
Stroe the name of the team inJust display "Ghost Team" in the comment if the assgined team is deleted.content
column when insertingcomment
into DB in case that we cannot get the name of team after it is deleted. But for comments that already exist, just display "Unknown Team"review_team_id = ${team_id}
in tablereview
) when deleting team.review
,we can delete these rows when executing migrations.they do not affect the function, so won't delete them.