Skip to content
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 panic in teams API when requesting members #19360

Merged
merged 3 commits into from
Apr 11, 2022

Conversation

delvh
Copy link
Member

@delvh delvh commented Apr 9, 2022

As title.

Should fix #19359

Do we backport API errors?
Unnecessary in this case, error does not exist yet on v1.16 branch.
If I had to guess, one of the many move xxx from models/ to models/xxx/ refactorings were the cause of this bug.

@delvh delvh added type/bug modifies/api This PR adds API routes or modifies them labels Apr 9, 2022
@delvh delvh added this to the 1.17.0 milestone Apr 9, 2022
@delvh
Copy link
Member Author

delvh commented Apr 9, 2022

CI is dead, that's the reason why the build fails.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 9, 2022
Copy link
Contributor

@Gusted Gusted left a comment

Choose a reason for hiding this comment

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

If this code also exist in the release/1.16 branch it should be backported.

@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 Apr 9, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 9, 2022
Copy link
Member

@lunny lunny left a comment

Choose a reason for hiding this comment

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

No, you can't do both. I think you can just change only line 390.

routers/api/v1/org/team.go Outdated Show resolved Hide resolved
@delvh
Copy link
Member Author

delvh commented Apr 9, 2022

I mean, what's the benefit?
Both should work, with the only difference that with append another error like this cannot happen...
But I can apply it of course.

@lunny
Copy link
Member

lunny commented Apr 9, 2022

I mean, what's the benefit? Both should work, with the only difference that with append another error like this cannot happen... But I can apply it of course.

Both should work, but you should only chose one. You can't chose both, otherwise the slice will have 2 times elements and the first part are empty elements.

@wxiaoguang wxiaoguang merged commit d139c23 into go-gitea:main Apr 11, 2022
@delvh delvh deleted the b/team-api-error branch April 11, 2022 13:20
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 12, 2022
* giteaoffical/main:
  Document 409 error returned by repos/migrate api (go-gitea#19376)
  Fix middleware function's placements for some `/user/...` (go-gitea#19377)
  Fix panic in teams API when requesting members (go-gitea#19360)
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 24, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when requesting team members API
5 participants