Clever/microplane

Name: microplane

Owner: Clever

Description: A CLI tool to make git changes across many repos, especially useful with Microservices.

Created: 2017-10-19 20:07:27.0

Updated: 2018-05-21 20:21:42.0

Pushed: 2018-05-21 19:22:50.0

Homepage: https://medium.com/always-a-student/mo-repos-mo-problems-how-we-make-changes-across-many-git-repositories-293ad7d418f0

Size: 122

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

microplane

A CLI tool to make git changes across many repos, especially useful with Microservices. You can learn more about microplane in this introductory blogpost.

microplane

“the lemon is Github”

Setup
Download

You can download a pre-built version of Microplane from the Github releases.

Build Locally

Microplane is a Golang project. It uses dep for vendoring.

First, clone the repo into your GOPATH. Next, run make install_deps (this calls dep). To build, run make build. You should now have a working build of Microplane in ./bin/mp.

Usage

Note: The GITHUB_API_TOKEN environment variable must be set. This should be a Github Token with repo scope.

Microplane has an opinionated workflow for how you should manage git changes across many repos. To make a change, use the following series of commands.

  1. Init - target the repos you want to change using a Github “Advanced Search” Query
  2. Clone - clone the repos you just targeted
  3. Plan - run a script against each of the repos and preview the diff
  4. Push - commit, push, and open a Pull Request
  5. Merge - merge the PRs

For an in-depth example, check out the introductory blogpost.

Implementation

Microplane parallelizes various git commands and API calls.

At each step in the Microplane workflow, a repo only moves forward if the previous step for that repo was successful.

We persist the progress of a Microplane run in the following local file structure.


it.json
po1/
clone/
  clone.json
  <git-repo>
plan/
  plan.json
  <git-repo-with-commit>
push/
  push.json
merge/
  merge.json
po2/
...

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.