Skip to content

Conversation

DerpyWasHere
Copy link
Member

@DerpyWasHere DerpyWasHere commented Aug 3, 2024

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 variable GITHUB_TOKEN.

@DerpyWasHere DerpyWasHere linked an issue Aug 3, 2024 that may be closed by this pull request
@DerpyWasHere
Copy link
Member Author

DerpyWasHere commented Aug 4, 2024

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.

Copy link
Collaborator

@EarthenSky EarthenSky left a 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.
@DerpyWasHere
Copy link
Member Author

DerpyWasHere commented Aug 5, 2024

I'm testing this on a test organization CSSS-Test-Organization that I made. Albeit far from professional I've just been using a test python script.

https://github.com/CSSS-Test-Organization

@DerpyWasHere DerpyWasHere merged commit 030f995 into main Aug 5, 2024
@DerpyWasHere DerpyWasHere deleted the dev-issue-20 branch August 5, 2024 09:43
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.

control access of users to github

2 participants