move towards using gopkg.in

Nate Finch nate.finch at canonical.com
Tue Jul 8 12:38:46 UTC 2014


+1 for stable APIs and versioned import statements.  If we're worried about
the fact that gopkg.in is run by some random guy* then we're more than
capable of running our own redirector on Canonical's infrastructure.
 Gopkg.in is open source, so we can easily get ours up and running with
just a little of our own work.

This is the Right Way™ to make sure our code is reliable so that people who
work with our code aren't constantly having their code broken because we
change our APIs constantly.  The fact that we don't version the packages
right now means that we don't really care if we break the APIs, so we break
them all the time.




On Tue, Jul 8, 2014 at 3:02 AM, roger peppe <roger.peppe at canonical.com>
wrote:

> On 8 July 2014 03:23, Gustavo Niemeyer <gustavo at niemeyer.net> wrote:
> > On Mon, Jul 7, 2014 at 10:49 PM, Gustavo Niemeyer <gustavo at niemeyer.net>
> wrote:
> >> On Mon, Jul 7, 2014 at 8:49 PM, David Cheney <
> david.cheney at canonical.com> wrote:
> >>> I don't want to introduce another thing to break CI, we already pull
> >>> from github which is bad enough, but going via gopkg.in introduces an
> >>> additional point of failure which can further reduce the already
> >>> bullet ridden credibility of our CI.
> >>
> >> Again, gopkg.in sits in a reliable deployment, with a provable track
> record.
> >>
> >>> I also don't want to start introducing versioned import paths into
> >>> Juju without serious discussion of how to prevent two different
> >>> versions of a package transitively.
> >>
> >>  go list -f '{{range .Deps}}{{printf "%s\n" .}}{{end}}' | grep gopkg.in
> >>     | sort -u | sed 's/\.v[0-9]\+$/\.vN/' | uniq -c | sed '/ 1 /d'
> >
> > A bit faster and more correct (picks subpackages too):
> >
> > go list -f '{{range .Deps}}{{printf "%s\n" .}}{{end}}'
> >     | sed -n  's,\(gopkg.in/.*\.v\)[0-9]\+.*$,\1N,p' | uniq -u -D
>
> go list -f '{{join "\n" .Deps}}'
>
> is slightly more compact. These days, I usually use
> my showdeps (code.google.com/p/rog-go/cmd/showdeps)
> command for this kind of thing - it's easier to type,
> and makes it easy to find testing dependencies too.
>
> FWIW, govers (see launchpad.net/govers) should
> work fine for updating versioned import paths.
>
> For instance, running:
>
>     govers gopkg.in/juju/charm.v3
>
> inside github.com/juju/juju will update all import
> paths to use juju/charm.v3. More importantly,
> it also checks that no package *outside* juju/juju
> is using the original version.
>
> Gustavo's little shell script is more comprehensive
> in that respect, but doesn't help when a package
> first moves to gopkg.in.
>
>   cheers,
>     rog, who must really move all his stuff to github some time.
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140708/fa56140a/attachment.html>


More information about the Juju-dev mailing list