Jitpack.io: Using both non v and v version of git tags

Created on 2 Feb 2016  路  10Comments  路  Source: jitpack/jitpack.io

According to semver 1.0.0 git repos must use v prefix for tags.

It is removed in version 2 but almost all projects and even semver's itself use v prefix as shown in the URL.

Projects use v prefix in git tagging but not in maven repos. For instance this is 1.3.2.RELEASE version of spring-boot project:

But you should request non-v version the project:

In current jetpack.io version we must use the v version of the project.

Central Repo Version:

compile 'org.springframework.boot:spring-boot:1.3.2.RELEASE'

JitPack Version:

compile 'com.github.spring-projects.spring-boot:spring-boot:v1.3.2.RELEASE'

If jitpack can support both v and non-v versions of the projects it can be good.

For instance both lines should be welcome:

compile 'com.github.spring-projects.spring-boot:spring-boot:v1.3.2.RELEASE'
compile 'com.github.spring-projects.spring-boot:spring-boot:1.3.2.RELEASE'
enhancement

All 10 comments

Thank you for the suggestion! In a lot of ways it makes sense but there can be downsides as well:

  • First of all it's possible to add two tags - one with v and one without on different commits.
  • If JitPack supports both then its also more confusion for the user - which one should I use?
  • Or when users report bugs you have to try to reproduce it on two versions.

So would recommend using tags without the v because it's non-ambiguous.

On the other hand, a lot of projects already use the v. Perhaps JitPack should always use a version without the v. When there's only one way to do things then it is simpler and less confusing for everyone.

This is the possible pseudo JS code for suggestion, code is the best way to explain something to developers :)

function fetchVersion(versionName) {

   if (existInGithub(versionName)) {
      return buildAndDeploy(vesionName, versionName);
   } else if (existInGithub('v' + versionName) {
      return buildAndDeploy('v' + vesionName, versionName);
   }

   return null;
}

Sure, but the current logic is simpler

function fetchVersion(versionName) {
    if (existInGithub(versionName))
        return buildAndDeploy(versionName);
    return null;
}

so its easier to explain.

I think you should re-consider this, to be consistent with other libraries deployed in central. Most versions in central don't have a v prefix, the only time this is present is on a git tag.

@raniejade Agreed, most existing libs don't use the v in versions but is that good enough reason to support it considering issues mentioned earlier?
One argument could be that users will intuitively try to specify a version without the v and that will fail.

  • First of all it's possible to add two tags - one with v and one without on different commits.

You could enforce it at build time, if a tag looks the same with a previously built one fail the build.

  • If JitPack supports both then its also more confusion for the user - which one should I use?

I don't see any confusion here. People who uses central a lot will intuitively use a version without v (a lot of them uses semantic versioning).

  • Or when users report bugs you have to try to reproduce it on two versions.

How often does that happen? It's the publishers responsibility to ensure that there are no duplicate tags.

What if JitPack used the name of a GitHub release for the version instead of using the tag? The API provides both. So the tag can be v1.0 to match the git convention, and you do a GitHub release for that tag and name the release 1.0 to match the Maven convention, and JitPack uses the release name.

Ok, versions without 'v' prefix should now be working too

@jitpack-io, a minor drawback with this approach is that when you go to the JitPack page for a project, the first thing you see is the versions listed under the Releases tab, and they correspond to the tags. So for anyone using a dependency from JitPack and omitting the v prefix, if the project follows the git tagging convention, it appears to be inconsistent. (I can imagine people wondering, "Wait, that works? Why does that work?")

Have you given any more thought to my proposal?

What if JitPack used the name of a GitHub release for the version instead of using the tag? The API provides both. So the tag can be v1.0 to match the git convention, and you do a GitHub release for that tag and name the release 1.0 to match the Maven convention, and JitPack uses the release name.

Presumably it should only apply to new releases. Perhaps it should require setting a flag in the jitpack.yml config file?

Hi @gdejohn ,
Agree that it should only apply to new releases. We still need to figure out how to deal with GitHub API rate limits. We'll quickly exceed if we query releases API or if we check jitpack.yml

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vananiev picture vananiev  路  5Comments

omrihq picture omrihq  路  6Comments

Hala-Nearmotion picture Hala-Nearmotion  路  4Comments

leahjlou picture leahjlou  路  4Comments

hypest picture hypest  路  5Comments