[PR #424] [CLOSED] Implement official client for GitHub v3 endpoints #496

Closed
opened 2026-02-15 15:56:07 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/RPCS3/discord-bot/pull/424
Author: @grantwinney
Created: 10/11/2019
Status: Closed

Base: masterHead: use_official_github_v3_client


📝 Commits (1)

  • f9eb616 use official client for github v3 endpoints

📊 Changes

5 files changed (+102 additions, -77 deletions)

View changed files

📝 Clients/GithubClient/Client.cs (+23 -71)
📝 Clients/GithubClient/GithubClient.csproj (+1 -0)
📝 Clients/GithubClient/POCOs/PrInfo.cs (+73 -1)
📝 CompatBot/Commands/Pr.cs (+3 -3)
📝 CompatBot/Utils/ResultFormatters/UpdateInfoFormatter.cs (+2 -2)

📄 Description

The open issue for #420 is to migrate to the GraphQL API, but the official .NET client is in beta. With that in mind, I figured I'd have a go at implementing their official client for the REST API.

If you don't want to go ahead with this, I'll understand! It'd be interesting to try out the GraphQL client too, even with their warnings. Not sure what parts are missing from it.

There's a few issues to address with this solution:

  • I'm not sure what call with their client is equivalent to the call being made in GetStatusesAsync(). I came across docs for Statuses but I'm not sure if the answer is in there.
  • There's a github.Miscellaneous.GetRateLimits() API call that's available, instead of parsing results out of the headers, which is cleaner but involves making an extra call (not sure if it actually counts toward the rate limits...)
  • I wasn't sure whether to replace your POCO's or not, so I added implicit converters to the classes, to save GitHub's types as the ones already built-in to the app.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/RPCS3/discord-bot/pull/424 **Author:** [@grantwinney](https://github.com/grantwinney) **Created:** 10/11/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `use_official_github_v3_client` --- ### 📝 Commits (1) - [`f9eb616`](https://github.com/RPCS3/discord-bot/commit/f9eb616b26b506216b586b02b2be88acda3f50ba) use official client for github v3 endpoints ### 📊 Changes **5 files changed** (+102 additions, -77 deletions) <details> <summary>View changed files</summary> 📝 `Clients/GithubClient/Client.cs` (+23 -71) 📝 `Clients/GithubClient/GithubClient.csproj` (+1 -0) 📝 `Clients/GithubClient/POCOs/PrInfo.cs` (+73 -1) 📝 `CompatBot/Commands/Pr.cs` (+3 -3) 📝 `CompatBot/Utils/ResultFormatters/UpdateInfoFormatter.cs` (+2 -2) </details> ### 📄 Description The open issue for #420 is to migrate to the GraphQL API, but the official .NET client is in beta. With that in mind, I figured I'd have a go at implementing their official client for the REST API. If you don't want to go ahead with this, I'll understand! It'd be interesting to try out the GraphQL client too, even with their warnings. Not sure what parts are missing from it. There's a few issues to address with this solution: - I'm not sure what call with their client is equivalent to the call being made in `GetStatusesAsync()`. I came across docs for [Statuses](https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref) but I'm not sure if the answer is in there. - There's a `github.Miscellaneous.GetRateLimits()` API call that's available, instead of parsing results out of the headers, which is cleaner but involves making an extra call (not sure if it actually _counts_ toward the rate limits...) - I wasn't sure whether to replace your POCO's or not, so I added implicit converters to the classes, to save GitHub's types as the ones already built-in to the app. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 15:56:07 -05:00
yindo closed this issue 2026-02-15 15:56:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RPCS3/discord-bot#496