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

Branch protection user/team dropdowns do not list everyone #20083

Closed
Fogapod opened this issue Jun 22, 2022 · 8 comments · Fixed by #20275
Closed

Branch protection user/team dropdowns do not list everyone #20083

Fogapod opened this issue Jun 22, 2022 · 8 comments · Fixed by #20275
Labels
Milestone

Comments

@Fogapod
Copy link
Contributor

Fogapod commented Jun 22, 2022

Description

I tried setting up whitelists for branch protection but dropdowns only list 4 out of 9 org members. Text search only searches among these 4.
image

image

Similar thing happened to teams - one of the teams wasnt showing. It worked after team recreation.

I noticed that each of these 4 members is on top of user list of some team. Membership from top to bottom for 1st screenshot:

  • none, is website admin
  • CI
  • devs-back (bottom); lead-devs (top)
  • devs-back (top)

Gitea Version

1.17.0+rc1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Locally compiled binary

Database

PostgreSQL

@lunny
Copy link
Member

lunny commented Jun 22, 2022

Could you confirm all of the 9 members have read permissions to that repository?

@Fogapod
Copy link
Contributor Author

Fogapod commented Jun 22, 2022

Could you confirm all of the 9 members have read permissions to that repository?

Yes.

So here is a devs-back team:
image
It has access to all currently exising repositories (as seen in ui). Look at 3 top members. Red avatar is listed in dropdown while 2 other people are not. All these 3 people only have a single role. 4th member is also a member of other team.

Team permissions:
image

@Fogapod Fogapod changed the title Branch protection user/team lists do not list everyone Branch protection user/team dropdowns do not list everyone Jun 22, 2022
@6543 6543 added this to the 1.17.0 milestone Jun 23, 2022
@Fogapod
Copy link
Contributor Author

Fogapod commented Jul 1, 2022

image
This might be related: trying to add team to repository collaborators, search does not work at all, request logs say it always 404s. Even if i type in team name exactly search shows 404 even though pressing button successfully adds that team

@Gusted
Copy link
Contributor

Gusted commented Jul 5, 2022

I've looked into the issue and the code for this is correct and straightforward. But it's likely that you didn't add the teams to the repository(otherwise other issues would arise if this is already the case). Also for the 404's it's not reproducible for me.

@Fogapod
Copy link
Contributor Author

Fogapod commented Jul 5, 2022

it has access to that repository. it is the only team that grants write access. we wouldn't be able to push code if it wasn't the case. people have write and read access because they are in team but they are not listed:
image

today i've got 4 different users shown in that list. still not everyone:
image

@Gusted
Copy link
Contributor

Gusted commented Jul 5, 2022

Is the list scrollable?

@Fogapod
Copy link
Contributor Author

Fogapod commented Jul 6, 2022

image
not only it is scrollable today, it lists everyone who has repo access properly, not just 4 people.
the only change i made was granting that team all permissions.

unchecking any of these results in 3 people shown, not scrollable. i can reliably reproduce this by switching any permission.
image
image

i have a similar issue with package registry: #19986
it looks like granting all Write permissions does something special. having any of them as Read breaks things

Gusted pushed a commit to Gusted/gitea that referenced this issue Jul 6, 2022
- Currently when a Team has read access to a organization's non-private
repository, their access won't be stored in the database. This caused
issue for code that rely on read access being stored. So from now-on if
we see that the repository is owned by a organization don't increase the
minMode to write permission.
- Resolves go-gitea#20083
@Gusted
Copy link
Contributor

Gusted commented Jul 6, 2022

So it seems like the code was correct, however the code to store the access information into the database wasn't. Fixed by #20275

Gusted pushed a commit to Gusted/gitea that referenced this issue Jul 6, 2022
- Backport go-gitea#20275
  - Currently when a Team has read access to a organization's non-private repository, their access(in the `access` table) won't be stored in the database. This cause issues for code that rely on read access being stored, like retrieving all users who have read permission to that repository(even though this is confusing as this doesn't include all registered users). So from now-on if we see that the repository is owned by a organization don't increase the `minMode` to write permission.
  - Resolves go-gitea#20083
6543 pushed a commit that referenced this issue Jul 9, 2022
Backport #20275

Currently when a Team has read access to a organization's non-private repository, their access(in the `access` table) won't be stored in the database. This cause issues for code that rely on read access being stored, like retrieving all users who have read permission to that repository(even though this is confusing as this doesn't include all registered users). So from now-on if we see that the repository is owned by a organization don't increase the `minMode` to write permission.

Resolves #20083
6543 pushed a commit that referenced this issue Jul 11, 2022
- Currently when a Team has read access to a organization's non-private
repository, their access won't be stored in the database. This caused
issue for code that rely on read access being stored. So from now-on if
we see that the repository is owned by a organization don't increase the
minMode to write permission.
- Resolves #20083
vsysoev pushed a commit to IntegraSDL/gitea that referenced this issue Aug 10, 2022
- Currently when a Team has read access to a organization's non-private
repository, their access won't be stored in the database. This caused
issue for code that rely on read access being stored. So from now-on if
we see that the repository is owned by a organization don't increase the
minMode to write permission.
- Resolves go-gitea#20083
@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants