diff options
author | 2025-07-10 13:38:48 +0100 | |
---|---|---|
committer | 2025-07-10 13:45:55 +0100 | |
commit | b169dc300f738c59e717d444445dfe0c8e6da98a (patch) | |
tree | 001737a929998b6798143ad65278e366ae1476c3 /arthur/apis/github/teams.py | |
parent | Better handling of locking/unlocking users (diff) |
Remove GitHub-Grafana team sync cog
Diffstat (limited to 'arthur/apis/github/teams.py')
-rw-r--r-- | arthur/apis/github/teams.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/arthur/apis/github/teams.py b/arthur/apis/github/teams.py index 4cf18d4..a8775a3 100644 --- a/arthur/apis/github/teams.py +++ b/arthur/apis/github/teams.py @@ -1,32 +1,7 @@ -import aiohttp - from arthur.config import CONFIG -from arthur.log import logger HEADERS = { "Accept": "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28", "Authorization": f"Bearer {CONFIG.github_token.get_secret_value()}", } -BASE_URL = "https://api.github.com" -MEMBERS_PER_PAGE = 100 - - -class GithubTeamNotFoundError(aiohttp.ClientResponseError): - """Raised when a github team could not be found.""" - - -async def list_team_members(team_slug: str, session: aiohttp.ClientSession) -> list[dict[str, str]]: - """List all Github teams.""" - endpoint = f"{BASE_URL}/orgs/{CONFIG.github_org}/teams/{team_slug}/members" - params = {"per_page": MEMBERS_PER_PAGE} - async with session.get(endpoint, headers=HEADERS, params=params) as response: - response.raise_for_status() - teams_resp = await response.json() - if len(teams_resp) == MEMBERS_PER_PAGE: - logger.warning( - "Max number (%d) of members returned when fetching members of %s. Some members may have been missed.", - MEMBERS_PER_PAGE, - team_slug, - ) - return teams_resp |