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

feat: Create organisation client to access teams endpoints #135

Merged
merged 13 commits into from
Jul 6, 2023

Conversation

ebk45
Copy link
Contributor

@ebk45 ebk45 commented Jun 28, 2023

What this PR does:

This PR adds an organisation client that exposes the following Teams API endpoints:

  • Get a team (by team slug)
  • List Teams in an organisation
  • Update a team in an organisation
  • Create a team in an organisation
  • Delete a team in an organisation

What happens next:

This functionality will be extended to expose the memberships endpoints so that team members within a team can be updated/created/deleted.

Tests:

Unit tests have been created for all the above mentioned endpoints.
Fixtures were created using the expected request and response bodies as detailed in the Github Teams API documentation here: https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28

@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Merging #135 (7297ecb) into master (e6df7c9) will increase coverage by 0.46%.
The diff coverage is 91.66%.

@@             Coverage Diff              @@
##             master     #135      +/-   ##
============================================
+ Coverage     73.77%   74.23%   +0.46%     
- Complexity      256      263       +7     
============================================
  Files            40       41       +1     
  Lines           896      920      +24     
  Branches         41       41              
============================================
+ Hits            661      683      +22     
- Misses          210      212       +2     
  Partials         25       25              
Impacted Files Coverage Δ
...va/com/spotify/github/v3/clients/GitHubClient.java 76.13% <66.66%> (-0.12%) ⬇️
.../spotify/github/v3/clients/OrganisationClient.java 95.23% <95.23%> (ø)

@ebk45 ebk45 self-assigned this Jul 4, 2023
@ebk45 ebk45 marked this pull request as ready for review July 4, 2023 12:00
Abhi347
Abhi347 previously approved these changes Jul 5, 2023
Optional<String> description();

/**
* List GitHub IDs for organization members who will
Copy link
Member

Choose a reason for hiding this comment

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

IDs is a bit confusing to me. Are these usernames?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The GitHub ID is the unique integer associated with a user. Which is unfortunately poorly documented :/
I used the documentation for the GitHub API to describe the params here:
https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#create-a-team

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense, then let's leave it as-is 👍

Copy link
Member

@dziemba dziemba left a comment

Choose a reason for hiding this comment

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

Nice!

@ebk45 ebk45 merged commit 96e7eaa into master Jul 6, 2023
@ebk45 ebk45 deleted the feat/teams-api branch July 6, 2023 11:42
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.

3 participants