bot
bot copied to clipboard
Create an admin task when votes are 2 weeks old
Description
We want a way to notify admins when helper votes are 2 weeks old, so that they can step in and get it over the line.
This should be done via a call to GitHub issues API to create an issue. The github org name, repo name, and the auth token should be constants to allow the values to be different in dev & prod.
Suggested implementation
Have a discord.py task that runs daily to check if there are any votes that meet the stale threshold, if so create the issue and add an emoji to that vote.
The emoji will allow us to make sure we don't create duplicate issues for the same vote.
Messages with a 🎫 reaction should also be ignored, as that means they have already passed and are awaiting actioning.
I can take this one up if approved!
I think the idea @ChrisLovering proposed is simple and enough.
IIRC the api doesn't allow filtering on the creation date, but we could fetch the active ones and treat them in memory.
The rest should be quite simple.
Idk if we already interact with the Github API or not, and whether this should be in Python Bot or in Bot-core, meaning idk if the Github interaction is something we want ( if we don't already have it) as a core feature
However, what I'm wondering about is the visibility.of this issue as I don't think we want to have a public issue that says X has been nominated, right?
You can use https://github.com/python-discord/bot/blob/main/bot/exts/recruitment/talentpool/_api.py#L34 to get a lsit of active nominations (if you set active=True) then you can look to see which are stale and then archive the votes.
We don't have generic helpers for interacting with the GitHub API as far as I know. We've got a few cogs that interact with GitHub though.
Yes that's the endpoint I was referring to.
And that's also what I meant by there isn't a way to get active nominations based on a certain date and thus, we treat them in memory.
Do you have an example in mind of these cogs? Otherwise I can look them up myself.
For the emoji, is the one you mentioned up for discussion? ( just curious to see if there's one that might fit better)