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 authenticated user if not part of membership #25

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

amenocal
Copy link
Collaborator

@amenocal amenocal commented Nov 6, 2024

This pull request introduces adding functions to get the authenticated user and remove a team member, and updating the team creation logic to ensure the authenticated user is correctly managed.

The authenticated user that creates the team gets automatically added to the team. However, that is most likely not the desired outcome. This functionality removes the authenticated user from the team if they are not part of the source team members.

New functionalities:

  • internal/api/api.go: Added GetAuthenticatedUser function to retrieve the authenticated user and RemoveTeamMember function to remove a team member by slug.

Enhancements to team synchronization:

  • internal/team/team.go: Updated CreateTeam method to retrieve the authenticated user, check if they are part of the team members, and remove them if they are not.
  • pkg/sync/sync.go: Improved SyncTeamsByRepo function to update the spinner text with the team name during the team creation process.

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again, by re-requesting a review.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 suggestion.

Comments skipped due to low confidence (1)

internal/api/api.go:397

  • The comment should start with a capital letter: 'Get authenticated user'.
// Get authenticated user

Tip: Leave feedback on Copilot's review comments with the 👎 and 👍 buttons to help improve review quality. Learn more

internal/team/team.go Show resolved Hide resolved
Copy link
Collaborator

@antgrutta antgrutta left a comment

Choose a reason for hiding this comment

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

I tried to get copilot to do a review but it seems not to be working...I mean it all looks good to me :)

@amenocal amenocal merged commit 2ee6162 into main Nov 7, 2024
1 check passed
@amenocal amenocal deleted the amenocal/update-membership branch November 7, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants