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

facing issue with gradle git zoltu plugin #25

Closed
ramshers opened this issue Aug 30, 2022 · 8 comments
Closed

facing issue with gradle git zoltu plugin #25

ramshers opened this issue Aug 30, 2022 · 8 comments

Comments

@ramshers
Copy link

I am using below zoltu plugin for managing the patch version automatically.

As this plugin requires code to be taged using v.major.minor convention, I have tagged the code with v0.1 and the tag is reachable form the HEAD.

But still I am getting below error -

    What went wrong: A problem occurred evaluating root project 'report-service'.

      Your repository must have at least one tag in it for git-versioning to work. Recommended solution: git tag v0.0

and git tag show there is a tag and i have check the revision history and this tag is reachable from the branch I am working on -

$ git tag
v0.1

Do anyone have any clue what the issue is. This a blocker for me.
Thanks in advance for any help..

@MicahZoltu
Copy link
Member

What is the output if you run git describe? That is (effectively) the command this plugin is using to derive the version.

@VonC
Copy link

VonC commented Aug 30, 2022

@MicahZoltu This seems to be related to the nature of the tag (annotated vs. lightweight)

@MicahZoltu
Copy link
Member

Ah, that does ring a bell for me. It was a long time ago, but I vaguely remember something about that when working on this plugin. I want to say that making it working for all tag types was sufficiently hard that I punted on it. I could be misremembering though.

@ramshers
Copy link
Author

Yes. Like @VonC mentioned - it is expecting an annotated tag. It will be helpful if the project documentation mentions this specifically.

@MicahZoltu
Copy link
Member

It appears this could be fixed by changing

return git.describe().setLong(true).call() ?: throw Exception("Your repository must have at least one tag in it for git-versioning to work. Recommended solution: git tag v0.0")

to

return git.describe().setLong(true).setTags(true).call() ?: throw Exception("Your repository must have at least one tag in it for git-versioning to work.  Recommended solution: git tag v0.0")

Unfortunately, I haven't worked with Kotlin/Java for a while now and I no longer have a dev environment setup. I also suspect that CI doesn't work anymore as I suspect that the appveyor account that was used is now defunct. 😖

If someone wants to go through the leg work of implementing/testing this change and submitting a PR that moves the build system over to GitHub actions I wouldn't be against adding this, but at the moment I don't think adding it here is realistic.

I'll try to get the documentation updated at least. Also, if someone wants to actively maintain this project I would happily mark this repository as deprecated and add a link to your maintained version in the Readme!

@MicahZoltu
Copy link
Member

Docs updated at the least: #26

This will also give us a chance to see if CI is still functional, as it should trigger a build.

@MicahZoltu
Copy link
Member

TL;DR: Build system appears to work, but deploy system doesn't and fixing it is not a small task. Will have to settle with just the docs update for now, sorry!

It does appear that AppVeyor is still mostly working with a minor modification. Unfortunately, I can't actually publish because the underlying publish plugin has a security vulnerability and apparently felt that completely disabling the publishing plugin was the way to go. I use a wrapper around that, but the wrapper publishes with itself so I cannot actually publish a fix for the wrapper because it needs to be updated before it can be used. Zoltu/Gradle.Plugin.SimpleGradlePluginPublish#1

@MicahZoltu
Copy link
Member

I took a brief stab at adding setTags(true) in #27 but it appears that it the version of jgit I'm using doesn't have setTags as an option, which explains why I didn't use it when I built this originally. I tried updating to latest version of jgit, but that requires also updating the version of Java being targeted.

All of these problems are solvable (publishing plugin, java version, jgit version) but requires someone willing to put in more effort than me. I strongly encourage/support someone forking this repository and doing a better job with maintenance than me! I think adding light tag support would be great.

In the meantime, I am going to close this issue now that I have updated the docs. Sorry!

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

No branches or pull requests

3 participants