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

Remove access from teams that are not specified in the config #276

Open
Chris-V opened this issue Sep 6, 2022 · 2 comments · Fixed by #282
Open

Remove access from teams that are not specified in the config #276

Chris-V opened this issue Sep 6, 2022 · 2 comments · Fixed by #282
Labels
bug Something isn't working

Comments

@Chris-V
Copy link
Contributor

Chris-V commented Sep 6, 2022

Problem Description

What is actually happening

When I remove a team from the teams collection, said team is not removed from the repository's permissions.

What is the expected behavior

Only the teams listed under the teams should have access to the repository. If the teams key is missing from the configuration, I would expect the permissions to be handled from the repository's settings page.

I did not experiment with collaborators but I would expect a similar behavior.

Error output, if available

n/a

Context

Are you using the hosted instance of probot/settings or running your own?

Running my own

If running your own instance, are you using it with github.com or GitHub Enterprise?

GHEC

Version of probot/settings

safe-settings:2.0.0

Version of GitHub Enterprise

cloud

@Chris-V Chris-V added the bug Something isn't working label Sep 6, 2022
@decyjphr
Copy link
Collaborator

decyjphr commented Sep 6, 2022

@Chris-V I'll make an emergency release for this. Uncommenting this would work. It shouldn't affect anything other than breaking some tests. Subsequently, I'll release a longer-term solution.

decyjphr added a commit that referenced this issue Sep 6, 2022
decyjphr added a commit that referenced this issue Sep 6, 2022
@decyjphr decyjphr reopened this Sep 6, 2022
@Chris-V
Copy link
Contributor Author

Chris-V commented Sep 21, 2022

Sorry I didn't have a lot of time recently to test the fix. Thanks for the quick reply tho. I updated my test environment and team permissions are correctly applied 🎉

I'm facing a somewhat different issue with collaborators: the old collaborator is given the permission of the new collaborator. I had a quick look at the code and I didn't immediately see the cause. Dropping the repro steps here. I can open up a new issue if you prefer.

  1. Manually give write permissions to user_x on repo_a
  2. Update .github/repos/repo_a.yml with
    collaborators:
      - username: user_y
        permission: read
  3. Notice the settings applied to repo_a: user_x now has read access to the repo. user_y is missing. The logs show a DELETE on user_x, but then a PUT for that same user with user_y's expected permission

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants