GithubHelp home page GithubHelp logo

Comments (14)

VijayanB avatar VijayanB commented on August 16, 2024 3

Since most of go tools expects 'v' as prefix, i am favoring towards having all release tags to have 'v' as prefix. Instead of editing the existing tag, i am thinking about release new tag v1.0.0 and in future will have 'v' for all release tags. @dblock @henvic @stockholmux any objection?

from opensearch-go.

henvic avatar henvic commented on August 16, 2024 1

Sure, @stockholmux!

From Go Modules Reference: Version:

A version identifies an immutable snapshot of a module, which may be either a release or a pre-release. Each version starts with the letter v, followed by a semantic version. See Semantic Versioning 2.0.0 for details on how versions are formatted, interpreted, and compared.

If I want to use this released version, I'd need to use Pseudo-versions. Reading the docs, I see:

Pseudo-versions never need to be typed by hand. Many commands accept a commit hash or a branch name and will translate it into a pseudo-version (or tagged version if available) automatically. For example:

go get -d example.com/mod@master
go list -m -json example.com/mod@abcd1234

This means I'd have to execute the following command to update my go.mod with version 1.0.0:

$ go get -d github.com/opensearch-project/[email protected]
go get: added github.com/opensearch-project/opensearch-go v0.0.0-20210831032935-8b5df4936baa

If we look what ends up in the go.mod file, it doesn't look good:

$ cat go.mod
module github.com/hatch-studio/customer-service/internal/dao/x

go 1.17

require github.com/opensearch-project/opensearch-go v0.0.0-20210831032935-8b5df4936baa // indirect

instead of containing the expected

require github.com/opensearch-project/opensearch-go v1.0.0

Now, if I want to know what version I'm using, I'd have to browse this repository and find 8b5df4936baa, which will show that it's tagged as 1.0.0.

I also wonder if it affects dependabot alerts in any way, but I don't think so.

from opensearch-go.

stockholmux avatar stockholmux commented on August 16, 2024 1

OK - makes sense. So, there is no real friction at the time of adding the module but when trying to determine the module version later it's obscured.

It's a bit annoying that semantic versioning explicitly doesn't want the v but the official reference says to add it to semantic versioning. 🤦‍♂️

I think the bigger issue is any project wide tooling that is either in place or planned that will use things like a semver regexp. Let me dig.

from opensearch-go.

henvic avatar henvic commented on August 16, 2024 1

Oh, also I see that if you go to Go's package search (https://pkg.go.dev/github.com/opensearch-project/opensearch-go) it shows no tagged/stable version.

Screen Shot 2021-10-08 at 16 16 33

from opensearch-go.

VijayanB avatar VijayanB commented on August 16, 2024 1

Created new tag https://github.com/opensearch-project/opensearch-go/releases/tag/v1.0.0

from opensearch-go.

henvic avatar henvic commented on August 16, 2024 1

Thanks!

$ go get -d github.com/opensearch-project/opensearch-go@latest
go get: upgraded github.com/opensearch-project/opensearch-go v0.0.0-20211002184036-fb1709a85d8d => v1.0.0

from opensearch-go.

stockholmux avatar stockholmux commented on August 16, 2024

I'm a little mixed on this. All parts of OpenSearch uses semantic versioning that is X.Y.Z. Using vX.Y.Z introduces an inconsistency which makes my eye twitch. Seems like the linked context also has people with similar twitches.

I've only casually used golang, so can you help me understand the ramifications of using X.Y.Z with go mod? Feel free to chime in @VijayanB.

from opensearch-go.

henvic avatar henvic commented on August 16, 2024

If you really want to keep using tags without the v prefix here, maybe you could get away using a vanity import (https://github.com/GoogleCloudPlatform/govanityurls), and have it tagged as v1.0.0 outside of the repository, but I've a feeling this complicates things (and maybe doesn't solve it completely somehow?).

from opensearch-go.

henvic avatar henvic commented on August 16, 2024

I'd say there's some friction too for a set of users, though: whoever edits go.mod manually + run go mod tidy (what I usually do). I don't know what is the number of people that do this, though.

from opensearch-go.

henvic avatar henvic commented on August 16, 2024

and latest version: Version: v0.0.0-...-fb1709a :|

from opensearch-go.

dblock avatar dblock commented on August 16, 2024

Related, opensearch-project/.github#35

from opensearch-go.

dblock avatar dblock commented on August 16, 2024

I think it's perfectly OK if opensearch-go tags with v if that's the convention of go rather than adopt convention of OpenSearch since this component doesn't release together with the complete distribution. It's the same in Ruby AFAIK.

from opensearch-go.

henvic avatar henvic commented on August 16, 2024

Sounds good to me.

from opensearch-go.

kynrai avatar kynrai commented on August 16, 2024

This would be the best solution for golang users

from opensearch-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.