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

Allow git-plugin to fail step rather than throw exception

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • git-plugin
    • None

      When working with submodules it is possible that their history were rewritten git fetch will fail with a message like "error: Server does not allow request for unadvertised object". (With regular git usage, you can fetch again and git will succeed. )

      What happens with git-plugin is it makes this into an exception causing my declarative pipeline to fail. What I would like to do is to put checkout step into a retry(2) block and try to recover from this kind of issues.

      This is where I see exceptions are stemming from.

      https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitSCM.java#L998

      What I would like to suggest is to have an option in git-plugin to turn exceptions into failures, so I can re-execute my checkout step once more.

      Does that make sense?

            Unassigned Unassigned
            auselen Ali Utku
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: