Skip to content

batches: GitHub fork support

Warren Gifford requested to merge aharvey/fork-github into main

Created by: LawnGnome

This PR adds fork support to the GitHub source and client. Don't be too afraid of the size of this PR: it's actually +181 -25 of Go code; the rest is unit tests and fixtures. (Mostly the latter.)

The annoying part of this PR is that the GraphQL API doesn't have the ability to fork at present, so we have to thunk the call through V4Client (which is what GithubSource uses) into V3Client. Fortunately, we have prior art on handling repos in the v3 client in a way that makes them usable from v4, so we're actually in OK shape here. The v3 client also had to (re-?)gain the ability to make a POST.

I've patched up a few comments as I was regenerating the necessary fixtures for the new response fields — some things that we couldn't -update before now can be, and I tried to better document the quickest way to set up our testing repos to get the desired results.

Otherwise, this is a pretty standard fork implementation.

Part four of #17879 (closed).

Merge request reports

Loading