Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Add go.mod file, test on go1.11 in travis #206

Closed
wants to merge 1 commit into from
Closed

Add go.mod file, test on go1.11 in travis #206

wants to merge 1 commit into from

Conversation

m90
Copy link

@m90 m90 commented Aug 28, 2018

Adds a go.mod file to ease usage of the package as a Go module. In addition start testing on Go1.11 in CI.

Ideally the latest revision on master would also be tagged as v1.0.0 now.

module github.com/getsentry/raven-go

require (
github.com/certifi/gocertifi v0.0.0-20180118203423-deb3ae2ef261
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m not too familiar yet with the new modules stuff, but is it possible to define this as a dependency without pinning it to any version? Ideally “certifi” is always latest and I’d hate for us to now lock in an old version with old certificates.

Copy link
Author

@m90 m90 Aug 28, 2018

Choose a reason for hiding this comment

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

Good question. At the moment this would indeed lock the version and from what I understand there is no way of specifying "latest", even when specifying a semver version (as the idea to look for the minimum compatible version).

In an ideal world the upstream repo would start tagging things, but then I'm still not sure what version would be downloaded.

I think it might be possible to simply omit the dependency, but then everyone has to pay attention not to commit the change that the go tool will apply everytime you do something with it.

Long story short, I will try to ask in the Gophers Slack to find out if there is a common approach to solving this yet and will let you know about what I find out.

P.S.: alternatively, the minimal version of making this a Go module would probably just be tagging master with v1.0.0 and not adding a go.mod file.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think even if certifi did start tagging, it’s always going to be a rolling window since you’d always want the latest version for security purposes. If you’re not aware, certifi project is just basically packaging up the latest bundle of trusted root certificates that make it easy to use on systems where you can’t trust the system certificates. So by nature, you kinda just always want the latest.

I think we’re at a point though where I am happy to pin the version for module compatibility. If that’s all that seems to be done, I will do that today.

Don’t go module tags need to explicitly be prefixed with a v? So I can’t tag simply 1.0.0, it has to be v1.0.0 correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also noticed that gocertifi does tag versions, they are calver schema, so 2018.01.18 is their latest tag. But I assume because this also is not prefixed with a v, so this does not work for Go module naming.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, the tag has to start with a v, so it needs to be v1.0.0.

Asking in the Gophers Slack made it very clear that you cannot specify "latest" as it's about reproducible builds and

For a package that gets updated four times a year it's not a big deal

to update the dependency manually.

I have to admit that seeing that both dependencies of raven-go are more or less stable (package errors will probably not introduce breaking changes anytime soon) I would currently tend towards omitting go.mod for the sake of having an up-to-date gocertifi and just tag master (i.e. close this PR), but I'll leave that decision up to you.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, makes sense to me.

Let's go with just a tag for now, and leave out the go.{mod,sum} files since I agree that they don't make sense and the compatibility is low.

In light of this discussion, I've poked gocertifi to get updated and pushed them as well to adopt the v prefix for their tags.

certifi/gocertifi#10

@m90 m90 closed this Aug 28, 2018
@m90 m90 deleted the modfile branch August 28, 2018 16:56
@m90
Copy link
Author

m90 commented Sep 14, 2018

Could we still start tagging master so that this plays nicely with module aware Go?

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants