Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53725

git-plugin cannot operate on a git-worktree

    Details

    • Similar Issues:
    • Released As:
      git plugin 4.0.0 and git client plugin 3.0.0

      Description

      Core issue: JGit doesn't support git-worktree yet.
      Trigger: git-plugin tries to retrieve the commit message via JGit in order to print it to the log, fails the build on error
      Possible short-term solution: make printing the commit message optional
      Possible short-term solution: make errors while printing the commit message not fail the build
      Possible long-term solution: fix JGit to support git-worktree
      Possible long-term solution: stop using JGit

      Stack trace:

       > git checkout -f 22ae7e760b087f56426e764b5762ec58506dba04
      org.eclipse.jgit.errors.MissingObjectException: Missing unknown 22ae7e760b087f56426e764b5762ec58506dba04
      	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158)
      	at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227)
      	at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859)
      	at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772)
      	at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25)
      	at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13)
      	at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:72)
      	at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1271)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1244)
      	at hudson.scm.SCM.checkout(SCM.java:504)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
      	at hudson.model.Run.execute(Run.java:1806)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      

      This previously worked. Likely up to git-plugin 3.3.0.
      If I add a catch clause for org.eclipse.jgit.errors.MissingObjectException, rebuild and install the plugin, I can run my build.

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Resolved in git plugin 4.0.0 by the broader exception handling

          Show
          markewaite Mark Waite added a comment - Resolved in git plugin 4.0.0 by the broader exception handling
          Hide
          tomylobo T L added a comment -

          So it took 11 months to release (okay, it's a minor bug and a major release that needs to undergo extensive testing first)
          But then it took another 5 months to update the status?

          Show
          tomylobo T L added a comment - So it took 11 months to release (okay, it's a minor bug and a major release that needs to undergo extensive testing first) But then it took another 5 months to update the status?
          Hide
          markewaite Mark Waite added a comment - - edited

          Yes, you're correct. It took too long for the release of git plugin 4.0.0, git client plugin 3.0.0, and for the update of this issue. I lost track of this issue report in all the other work that was being done for git client plugin 3.0.0 and git plugin 4.0.0.

          I made many mistakes in the long period that was the development of git plugin 3.0.0 and git client plugin 4.0.0. One of the mistakes was assuming that we had a solution for a particularly challenging problem (JENKINS-19022). I spent months exploring that problem, testing alternatives, and testing the changes. I thought it was solved. Then a release was inadvertently delivered to the public which showed within 2 weeks of its release that I was wrong. That change was reverted and then a beta period was started for what would become git plugin 4.0.0.

          Thankfully, git plugin 4.0.0 has shown to be reliable, as have 4.1 and 4.2. The upcoming 4.3 release will have larger changes than were included in 4.1 or 4.2.

          We'd love to have your help reviewing git plugin pull requests, reviewing git client plugin pull requests, mentoring others as they assist with plugin development, and testing release candidates.

          The git client plugin upgrade from 2.x to 3.0.0 was further complicated by a breaking API change in the transition from JGit 4.x to JGit 5.x. The Jenkins git client plugin intentionally bundles JGit so that other plugins can depend on it. The Jenkins compatibility expectations are different than the JGit compatibility expectations, so callers to git client plugin had to be upgraded and released before git client plugin could be upgraded and released. All sorts of interesting things in the release period. And, yes, it took a long time to update this issue report.

          Show
          markewaite Mark Waite added a comment - - edited Yes, you're correct. It took too long for the release of git plugin 4.0.0, git client plugin 3.0.0, and for the update of this issue. I lost track of this issue report in all the other work that was being done for git client plugin 3.0.0 and git plugin 4.0.0. I made many mistakes in the long period that was the development of git plugin 3.0.0 and git client plugin 4.0.0. One of the mistakes was assuming that we had a solution for a particularly challenging problem ( JENKINS-19022 ). I spent months exploring that problem, testing alternatives, and testing the changes. I thought it was solved. Then a release was inadvertently delivered to the public which showed within 2 weeks of its release that I was wrong. That change was reverted and then a beta period was started for what would become git plugin 4.0.0. Thankfully, git plugin 4.0.0 has shown to be reliable, as have 4.1 and 4.2. The upcoming 4.3 release will have larger changes than were included in 4.1 or 4.2. We'd love to have your help reviewing git plugin pull requests , reviewing git client plugin pull requests , mentoring others as they assist with plugin development, and testing release candidates. The git client plugin upgrade from 2.x to 3.0.0 was further complicated by a breaking API change in the transition from JGit 4.x to JGit 5.x. The Jenkins git client plugin intentionally bundles JGit so that other plugins can depend on it. The Jenkins compatibility expectations are different than the JGit compatibility expectations, so callers to git client plugin had to be upgraded and released before git client plugin could be upgraded and released. All sorts of interesting things in the release period. And, yes, it took a long time to update this issue report.

            People

            • Assignee:
              Unassigned
              Reporter:
              tomylobo T L
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: