Skip to content

Conversation

@lunny
Copy link
Member

@lunny lunny commented Dec 8, 2025

Fix #36116
Fix #35912
Fix #20906

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Dec 8, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 8, 2025
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Dec 8, 2025
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
@a1012112796
Copy link
Member

please have a look at #36116

@lunny lunny marked this pull request as ready for review December 10, 2025 23:25
@lunny lunny changed the title Refactor compare router param parse Refactor compare router param parse and fix bugs Dec 11, 2025
@lunny
Copy link
Member Author

lunny commented Dec 11, 2025

please have a look at #36116

This has been included and it's ready to review now.

@lunny lunny added the type/bug label Dec 11, 2025
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 11, 2025
@wxiaoguang wxiaoguang marked this pull request as draft December 12, 2025 02:54
@wxiaoguang
Copy link
Contributor

Is it safe to backport a refactoring PR with so many logic changes?

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels Dec 12, 2025
@GiteaBot GiteaBot removed the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 12, 2025
@lunny
Copy link
Member Author

lunny commented Dec 12, 2025

Is it safe to backport a refactoring PR with so many logic changes?

This will be partially backport. Only bugfixes will be backport.

@lunny lunny marked this pull request as ready for review December 12, 2025 17:36
@lunny lunny added this to the 1.26.0 milestone Dec 12, 2025
@lunny lunny added backport/done All backports for this PR have been created backport/v1.25 labels Dec 12, 2025
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 13, 2025
Comment on lines +1089 to +1093
case err != nil:
ctx.APIErrorInternal(err)
return nil, nil
case user_model.IsErrUserNotExist(err) || repo_model.IsErrRepoNotExist(err):
ctx.APIErrorNotFound()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it right?

Copy link
Member Author

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.

Copy link
Contributor

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/done All backports for this PR have been created backport/v1.25 lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/translation type/bug type/refactoring Existing code has been cleaned up. There should be no new functionality.

Projects

None yet

8 participants