Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation to reflect default branch changes and GoPkg.in usage #13

Merged
merged 1 commit into from
Aug 2, 2017
Merged

Conversation

ghislainbourgeois
Copy link

This PR changes the documentation to reflect changes to the branching strategy and GoPkg.in usage to enable versionning of the package. With some testing this morning, I was able to determine that we will have to use major version numbers whenever we change the public API, due to the behaviour of GoPkg.in.

GoPkg.in lets you only target a single number version (v1, v2, v3...) and that will target the latest version number in that specific major release. If you have v1.0.0 and v1.1.0, getting v1 from GoPkg.in will yield v1.1.0.

Once this PR is merged, we should immediately create a v1 branch from master, and update the project to use that as its default branch. This will let us merge PR #9 on master and then tag or branch that to v2.

After some time, I would suggest putting master back as the default branch, but doing that will break clients that have not migrated to the GoPkg.in import path, so we will probably have to wait a while.

README.md Outdated
@@ -39,7 +61,7 @@ giving us both centralized and local logs. (Redundancy is nice).

import (
"flag"
"github.com/Graylog2/go-gelf/gelf"
gelf "gopkg.in/Graylog2/go-gelf/gelf.v1/gelf"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not need the gelf at the beginning as the last part of the path is gelf.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @0cjs mentioned, it should be gopkg.in/Graylog2/go-gelf.v1/gelf

@0cjs
Copy link

0cjs commented Jul 28, 2017

The paths used here seem rather different from the [gopkg.in example(https://labix.org/gopkg.in):

go get gopkg.in/yaml.v1

Especially, we have the part with the version number in the middle, and gelf repeated in gelf.v1/gelf. What's up with all that? I thought the path would be something more like gopkg.in/Graylog2/go-gelf.v1/gelf. (I don't see any reason to allow different versions of packages within the same repo, since everything in a single repo can be fixed together with a single commit.)

@0cjs
Copy link

0cjs commented Jul 28, 2017

I've done a bit more poking around and found a list of the allegedly most popular "package management" tools for Go. (This doesn't cover anywhere near all of them, though.)

The top five of these, godep, govendor, Glide, gvt and git-submodule, are all systems for "vendoring" dependencies using go get vendor directories. That is to say, rather than using code fetched by go get, they offer their own means to fetch a particular version of a dependent package and place that copy under the vendor directory of the current package. (Each has a file describing the specific versions of packages that are desired.)

The survey doesn't mention the tool gopkg.in. But it seems whether gopkg.in or a vendor subdirectory (or something else) is used is completely the choice of the client of this library, right? So if we simply set up the sensible semantic-versioning branch names, we automatically offer support for both gopkg.in and these other tools. Is this correct?

(Oh, and as an interesting side note to my research, it seems that packages that get imported by someone else should never have a vendor directory. This applies to us and I guess should be kept in mind if we ever introduce a dependency on another package.)

@ghislainbourgeois
Copy link
Author

I have updated the import path. @0cjs, you are right, supporting gopkg.in only involves using semantic-versioning branch or tag names. The other tools would already work as is.

Copy link

@MiLk MiLk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mariussturm mariussturm merged commit beee24d into Graylog2:master Aug 2, 2017
@mariussturm
Copy link

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants