Git Product home page Git Product logo

git-pull-request-mirror's Introduction

Mirror Github Pull Requests into the git-appraise formats

This repo contains a tool to mirror pull requests metadata into the corresponding git repository using a feature of git called git-notes.

The format written is the one defined by the git-appraise code review system, so pull requests that are mirrored using this tool can be reviewed using git-appraise.

Disclaimer

This is not an officially supported Google product.

Organization

There are 3 packages in this repo:

  • mirror is a go library for mirroring the pull request metadata into git-notes.
  • batch is a batch processor to mirror Github data into a local repository.
  • app is a webapp/bot that sets up Github webhooks and mirrors data incrementally whenever an interesting event happens on the Github repo.

The Batch Tool

The batch tool performs a single pass of reading all of the pull request metadata for a repo, and mirroring it into your local clone of that repo.

The tool can support running unauthenticated, but will be extremely rate-limited, so it is better if you create a personal access token, with the repo scope, for it to use.

Setup:

go get github.com/google/git-pull-request-mirror/batch
go build -o ~/bin/pr-mirror "${GOPATH}/src/github.com/google/git-pull-request-mirror/batch/batch.go"

Example Usage (after you've cloned the repo to mirror):

git fetch origin '+refs/pull/*:refs/pull/*'
git appraise pull
~/bin/pr-mirror --target ${GITHUB_USER}/${GITHUB_REPO} --local ./ -auth-token ${YOUR_AUTH_TOKEN}
git appraise pull
git appraise push

The Github Mirror App

This app allows users to continually update their git repositories with github metadata (pull requests and build statuses). It runs in an AppEngine app, and should expose a web interface at .appspot.com.

It uses the app engine datastore to store its configuration.

To deploy:

gcloud app deploy ./app/admin/*.yaml
gcloud app deploy ./app/hooks/*.yaml
gcloud app deploy ./app/*.yaml

git-pull-request-mirror's People

Contributors

justinsb avatar ojarjur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-pull-request-mirror's Issues

Base commits are computed incorrectly for reviews

The conversion code is incorrectly using the current commit of the target ref as the base commit when converting a pull request to a review.

Instead, it should use the merge base of the current commit and the review commit.

failed to build

batch/batch.go:45:2: cannot find package "github-mirror/auth" in any of:
        /home/vtolstov/.go/src/github-mirror/auth (from $GOROOT)
        /home/vtolstov/go/src/github-mirror/auth (from $GOPATH)
batch/batch.go:46:2: cannot find package "github-mirror/mirror" in any of:
        /home/vtolstov/.go/src/github-mirror/mirror (from $GOROOT)
        /home/vtolstov/go/src/github-mirror/mirror (from $GOPATH)
mirror/readall.go:119: cannot use client.Repositories (type *github.RepositoriesService) as type repositoriesService in argument to fetchStatuses:
        *github.RepositoriesService does not implement repositoriesService (wrong type for ListStatuses method)
                have ListStatuses(string, string, string, *github.ListOptions) ([]*github.RepoStatus, *github.Response, error)
                want ListStatuses(string, string, string, *github.ListOptions) ([]github.RepoStatus, *github.Response, error)
mirror/readall.go:186: cannot use client.PullRequests (type *github.PullRequestsService) as type pullRequestsService in argument to fetchPullRequests:
        *github.PullRequestsService does not implement pullRequestsService (wrong type for List method)
                have List(string, string, *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
                want List(string, string, *github.PullRequestListOptions) ([]github.PullRequest, *github.Response, error)
mirror/readall.go:192: cannot use client.PullRequests (type *github.PullRequestsService) as type pullRequestsService in argument to fetchComments:
        *github.PullRequestsService does not implement pullRequestsService (wrong type for List method)
                have List(string, string, *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
                want List(string, string, *github.PullRequestListOptions) ([]github.PullRequest, *github.Response, error)
mirror/readall.go:192: cannot use client.Issues (type *github.IssuesService) as type issuesService in argument to fetchComments:
        *github.IssuesService does not implement issuesService (wrong type for ListComments method)
                have ListComments(string, string, int, *github.IssueListCommentsOptions) ([]*github.IssueComment, *github.Response, error)
                want ListComments(string, string, int, *github.IssueListCommentsOptions) ([]github.IssueComment, *github.Response, error)

Also does it possible to convert to go get-able repo?

Two way syncing of pull request data?

Hi!

At the moment it looks like git-pull-request-mirror just takes a copy of the existing pull requests. Is there any plan to support two-way syncing of the data?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.