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

Under change log where it calls revwalk to lookup tag can through revtag cannot cast to revcommit #446

Open
hazendaz opened this issue Sep 19, 2024 · 0 comments

Comments

@hazendaz
Copy link
Contributor

See https://github.com/koraktor/mavanagaiata/blob/master/src/main/java/com/github/koraktor/mavanagaiata/git/jgit/JGitRepository.java#L241

I believe this is an extreme edge case at this point. We had a repo throwing up on this code. We should protect this specific exception which states its in unnamed module of loader from plexus classrealm. The bug isn't here exactly. It happened in jgit. While there are no such reports there, I was able to track it down on this specific 10 year old repo I'm working with having a commit in 2020 that was causing this. I removed the tag and it went back to working order. There was nothing at all special about the tag.

While I cannot get the stack trace to show here, the full error was this -> A type incompatibility occurred while executing com.github.koraktor:mavanagaiata:1.0.1:changelog: class org.eclipse.jgit.revwalk.RevTag cannot be cast to class org.ecipse.jgit.revwalk.RevCommit (org.eclipse.jgit.revwalk.RevTag and org.ecipse.jgit.revwalk are in unnamed module of loader org.codehause.plexus.classworlds.realm.ClassRealm

I think a simple try catch around that and to move on would be appropriate. I tried various things to get around this with nothing helping that is currently available. I even overwrote all the dependencies manually so it was on jgit 7 even and the issue persisted. I also tried many different jvms and even took everything out of their pom so it was bare bones until I could see it was really something here and not really here but jgit and our handling here. I unfortunately didn't capture the -X option error that showed up when working through this so Exception should be used to capture or whatever is thrown from jgit. I can take an attempt to get that in place and look at bit more as to what actually is returned. There actually is already a short list of items ignored so I think its just one more then unless it doesn't say exactly where Exception might need used.

Thankfully I got around it and it happened to be second tag in the long list so it didn't take long to resolve but the overall problem I had been working on since about 2:30 today and just got it now. So that was quite a few hours wasted that I feel if others run into this without git skills I have would probably spend days with this. In fact the team that reported it to my dev ops team spent 3 days working with others on the team to no avail before they escalated it to me to look at.

As to what exactly the problem with the tag is, no idea at this point. And nothing in commit history since last release would do anything about this so I think we attack getting that fixed along with my other ticket for trimming the release notes trailing whitespace and then cut a release. I'll try to get to this in the next week or so.

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

1 participant