Skip to content

Notes on migrating to a Go mono repo

Paul Jolly edited this page Jul 2, 2018 · 31 revisions

Ultimately this wiki will become a blog post, but maintaining here for now until things settle.

Goals

  1. Ultimately to migrate all myitcv.io/... packages to a mono-repo, housed at https://github.com/myitcv/x
  2. This mono-repo should support vgo and, critically, be backwards compatible with "old" go get
  3. https://godoc.org/ should work as expected
  4. Have multiple modules within the mono-repo, myitcv.io/react being one of them. This will mean that we have submodules within the outer myitcv.io module (although it's not strictly required to have a root module, I will use it as a catch-all for any packages below myitcv.io/ that are not submodules)
  5. Drop any existing _vendor directories that were previously used to "cache" (dev) dependencies, e.g. myitcv.io/react/_vendor
  6. categorise issues/PRs in much the same way as the Go project does, e.g. myitcv.io/react issues would be prefixed by react, react/cmd/reactGen etc

Pros

  • Less overhead in terms of maintaining multiple repos, issue lists, CI setups etc
  • ...

Cons

  • It's a change from where we are today; loss of continuity, history etc (although the history of the old repos will remain intact in the original repo)
  • ...

Notes

  • The custom import paths for all myitcv.io/... packages will continue to be driven by https://myitcv.io, which is an extremely basic (and hacky) Google App Engine Go App (source code https://github.com/myitcv/myitcv.io). Once everything is migrated to the mono-repo we can remove the explicit package listing and tidy things up considerably
  • The go-import git meta tag for all myitcv.io/... packages needs to be the root of all packages, myitcv.io in this case:
$ curl https://myitcv.io/gogenerate?go-get=1

<!DOCTYPE html>
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="go-import" content="myitcv.io git https://github.com/myitcv/x">
        <meta name="go-source" content="myitcv.io https://github.com/myitcv/x/wiki https://github.com/myitcv/x/tree/master{/dir} https://github.com/myitcv/x/blob/master{/dir}/{file}#L{line}">
        <meta http-equiv="refresh" content="0; url=https://godoc.org/myitcv.io/gogenerate">
</head>
<body>
Redirecting to docs at <a href="https://godoc.org/myitcv.io/gogenerate">godoc.org/myitcv.io/gogenerate</a>...
</body>
</html>
$ curl https://myitcv.io/blah2?go-get=1

<!DOCTYPE html>
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="go-import" content="myitcv.io git https://github.com/myitcv/x">
        <meta name="go-import" content="myitcv.io/blah2 mod https://raw.githubusercontent.com/myitcv/pubx/master">
        <meta name="go-source" content="myitcv.io https://github.com/myitcv/x/wiki https://github.com/myitcv/x/tree/master{/dir} https://github.com/myitcv/x/blob/master{/dir}/{file}#L{line}">
        <meta http-equiv="refresh" content="0; url=https://godoc.org/myitcv.io/blah2">
</head>
<body>
Redirecting to docs at <a href="https://godoc.org/myitcv.io/blah2">godoc.org/myitcv.io/blah2</a>...
</body>
</html>

CI

Issues/vgo enhancements/proposals

All issues listed above have been raised in the Go repo

In addition, I link here to a number of interesting issues/proposals:

Open questions

TODO

Clone this wiki locally