-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Refactor compare router param parse and fix bugs #36105
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: techknowlogick <[email protected]> Signed-off-by: Lunny Xiao <[email protected]>
|
please have a look at #36116 |
This has been included and it's ready to review now. |
|
Is it safe to backport a refactoring PR with so many logic changes? |
This will be partially backport. Only bugfixes will be backport. |
…lunny/refactor_compare
routers/api/v1/repo/pull.go
Outdated
| case err != nil: | ||
| ctx.APIErrorInternal(err) | ||
| return nil, nil | ||
| case user_model.IsErrUserNotExist(err) || repo_model.IsErrRepoNotExist(err): | ||
| ctx.APIErrorNotFound() |
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.
Is it right?
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.
If no fork repository found in this user, It seems no other status code is better than 404.
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.
Why it is right? Will users really see 404? The errors have been caught by case err != nil:?
And why not just use errors.Is(err, util.ErrNotExist)?
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.
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.
Are you sure you have fixed?
Fix #36116
Fix #35912
Fix #20906