Skip to content

Script for promoting people to Python triage team. #345

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

Merged
merged 2 commits into from
Aug 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions utils/promote_to_triager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# One time script for promoting to the triage team.
# The next iteration better be a bot!
# pip install gidgethub aiohttp cachetools

import os
import asyncio
import aiohttp

from gidgethub.aiohttp import GitHubAPI

import cachetools

cache = cachetools.LRUCache(maxsize=500)

async def get_team(gh, team_name):
"""
Get a team by name (slug)
"""
return await gh.getitem(f"/orgs/python/teams/{team_name}")

async def add_to_team(gh, username, team_id):
await gh.put(f"/teams/{team_id}/memberships/{username}")


async def main():
"""
- Get Python triage team
- Add people to Python Triage team
:return:
"""
async with aiohttp.ClientSession() as session:
# must have repo, and admin:org permissions
gh = GitHubAPI(session, "python", oauth_token=os.getenv("GH_AUTH"), cache=cache)
triage_team = await get_team(gh, "python-triage")
response = await add_to_team(gh, "maxking", triage_team["id"])
Copy link

Choose a reason for hiding this comment

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

Not sure what "maxking" represents but assuming it is some sort of group name.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! maxking is Abhilash Raj's GitHub username. Since he is being considered for core dev privilege, I figured it would be great to add him to Python triage first. I've also got Barry's approval to add Abhilash.

Copy link

Choose a reason for hiding this comment

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

That's totally cool. Thanks for clarifying.


asyncio.run(main())
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy