-
Notifications
You must be signed in to change notification settings - Fork 0
Github API interface with csss-site-backend #48
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
Conversation
…t(), create github module
…d get_user_by_id, Added exception raising to add_user_to_org().
…d error code handling on add_user_to_org(), implemented delete_user_from_org()
…thonic throughout file
…er_from_team(). Removed erroneous alternative api endpoint in add_user_to_team(). Created remove_user_from_team().
Note that when generating organization invites, iirc we're restricted to 50/hr, so in some scenarios we may want to implement rate limiting on the secondary rate limit (which is described on the rate limit page above). We should be fine though as we're generating max 12 or so invites per term. We might also want to implement functions to list current members, which will be super easy and can probably be pushed to a new issue. |
Co-authored-by: Gabe <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the comments & how similar this is to the discord module. Damn, you're going so fast, this is lovely!
How are you testing these functions?
We should have some docs on how to do testing for these modules? Not sure, maybe that's for later.
…l in requests. Raises a ValueError when both uid and email are passed by design.
I'm testing this on a test organization |
Closes #20. (Vibes)
The REST API provided by Github has constraints detailed here. Realistically the only constraint we care about is
x-ratelimit-remaining
which I've already added a check for. We should probably further discuss how to gracefully handle this as currently I raise an exception when we hit <50 remaining API calls. As noted in #20, all of these functions are handled asynchronously, so I chose to leave a healthy margin to avoid being rate limited.I added the functionality requested, adding/removing from organizations, adding/removing from teams. This is implemented in a new
github
module.For testing I've created a new CSSS-Test-Organization, we can talk about transferring ownership of that in person/over call.
Authorization here in the
github
module is token based and administrated through the fine grained personal access token system in Github. As such we can just store it as an environment variableGITHUB_TOKEN
.