Skip to content

Automatically set up "upstream" remote for forks#719

Merged
mislav merged 1 commit intomasterfrom
upstream-remote
Mar 31, 2020
Merged

Automatically set up "upstream" remote for forks#719
mislav merged 1 commit intomasterfrom
upstream-remote

Conversation

@mislav
Copy link
Contributor

@mislav mislav commented Mar 31, 2020

When gh repo clone-ing a forked repo, the resulting local repo will automatically have an "upstream" git remote added that points to the parent repo of the fork being cloned.

Additionally, this PR introduces usage of the https://github.com/shurcooL/githubv4 library for GraphQL requests. Benefits over our hand-rolled GraphQL approach include:

  • Having the GraphQL query string auto-generated from the result struct
  • Type-safety for input variables: the githubv4 library declares a Go type for each scalar type defined in GitHub API v4

Fixes #620

Copy link
Contributor

@vilmibm vilmibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

i'm excited to see the graphql api client in action, thanks for introducing it. should we file a tech debt ticket for explicitly porting over to it?

@mislav
Copy link
Contributor Author

mislav commented Mar 31, 2020

should we file a tech debt ticket for explicitly porting over to it?

Maybe, but not sure how long would that ticket stay open! Maybe instead we could just try to write all new GraphQL stuff using the library and incrementally port over old stuff when we need to touch the logic.

@mislav mislav merged commit 0e9b48d into master Mar 31, 2020
@mislav mislav deleted the upstream-remote branch March 31, 2020 15:10
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.

Automatically add upstream remote when cloning a fork via repo clone

2 participants