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.
Organization
There are 3 packages in this repo:
mirroris a go library for mirroring the pull request metadata into git-notes.batchis a batch processor to mirror Github data into a local repository.appis 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 pushThe Github Mirror App
This app allows users to continually update their git repositories with github metadata (pull requests and build statuses). It runs in a managed VM in a non-default module, and should expose a web interface at github-mirror-dot-$INSTANCE.appspot.com.
It uses the app engine datastore to store its configuration.
To deploy:
gcloud app deploy ./app.yaml