You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user that has a project posted in #projects I want to...
be able to link my GitHub repository to the project thread
So that...
I can receive pull request updates and stay informed about contributions.
Context
We have people posting projects within the discord server and for the ones that have active community development, to create enagagement and for continually receiving updates, we want notifications of PRs sent to their project channel.
Possible solution could be:
The user setup may be a slash command e.g. /link-gh-project with the options: Repository Owner and Repository Name.
In the backend, we can store the information [repositoryOwner, repositoryName, projectChannelId].
A similar /unlink-gh-project to remove the association.
Create a Routine that runs either every 15 minutes or every 1 hour to poll the GitHub API https://api.github.com/repo/<repositoryOwner>/<repositoryName> and send the PR information to the project channel on Discord.
The solution should ideally check the PR "created_at" field and if it is greater than the "last poll time", send information to discord.
The repository metadata obtained from /link-gh-project should be stored in the database.
The states to report on will most likely be [opened, merged, closed].
Considerations
When implementing the solution, consider GitHub and Discord rate limits. GitHub has a limit of 5,000 requests per hour.
To authenticate with GitHub a Personal Access Token (PAT) is required so ensure to handle that safely
Linking a project should only be performed by either staff members (community ambassadors, moderators and administrators) or the Project thread creator (OP)
Validating that we can access the PRs in situations such as the repo is not public.
Handling token errors if the PAT expires.
Out of Scope
Using the GitHub web hook functionality because of the complexity this introduces on the VPS.
Using Discord web hooks as that is not supported for forums.
Acceptance Criteria
GIVEN a user has linked their projects GitHub repository
THEN a message of new PRs and their statuses is sent to the project channel as an embed
To make life easier, here's some sample code I have written to get the contributor of this started:
As a user that has a project posted in
#projects
I want to...be able to link my GitHub repository to the project thread
So that...
I can receive pull request updates and stay informed about contributions.
Context
We have people posting projects within the discord server and for the ones that have active community development, to create enagagement and for continually receiving updates, we want notifications of PRs sent to their project channel.
Possible solution could be:
The user setup may be a slash command e.g.
/link-gh-project
with the options:Repository Owner
andRepository Name
.In the backend, we can store the information
[repositoryOwner, repositoryName, projectChannelId]
.A similar
/unlink-gh-project
to remove the association.Create a Routine that runs either every 15 minutes or every 1 hour to poll the GitHub API
https://api.github.com/repo/<repositoryOwner>/<repositoryName>
and send the PR information to the project channel on Discord.The solution should ideally check the PR "created_at" field and if it is greater than the "last poll time", send information to discord.
The repository metadata obtained from
/link-gh-project
should be stored in the database.The states to report on will most likely be
[opened, merged, closed]
.Considerations
Out of Scope
Using the GitHub web hook functionality because of the complexity this introduces on the VPS.
Using Discord web hooks as that is not supported for forums.
Acceptance Criteria
GIVEN a user has linked their projects GitHub repository
THEN a message of new PRs and their statuses is sent to the project channel as an embed
To make life easier, here's some sample code I have written to get the contributor of this started:
The text was updated successfully, but these errors were encountered: