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

Git plugin support for non standard branches during auto discover

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None
    • Windows 32, 64 - All versions
      Git plugin 3.5.0
      Jenkins minimum version 1.625.3

      Git auto discover branches should be able to respect included refspecs so that it can discover branches not located in refs/heads/* an example would be refs/pull-requests/*/merge. When this is implemented, the multistage pipeline will be well on its way to be able to automatically detect and build pull requests or other manually "described" branches in refpsecs

          [JENKINS-45990] Git plugin support for non standard branches during auto discover

          MARK ANDREWS added a comment -

          Related improvement request ticket JENKINS-45989

          MARK ANDREWS added a comment - Related improvement request ticket  JENKINS-45989

          Mark Waite added a comment -

          The GitHub branch source, Bitbucket branch source, and in the gitea plugin seem to already provide support for pull requests. The Jenkins project itself relies on them as part of ci.jenkins.io. Can you explain further what you're seeking that is not already available?

          Mark Waite added a comment - The GitHub branch source, Bitbucket branch source, and in the gitea plugin seem to already provide support for pull requests. The Jenkins project itself relies on them as part of ci.jenkins.io. Can you explain further what you're seeking that is not already available?

          MARK ANDREWS added a comment -

          Im using multibranch pipeline with auto discover branches. It only discovers branches in /refs/heads/* as far as i can tell it doesn't have options for git hub et.al. plugins. And pull requests are in /refs/pull-requests which are ignored. Before recent releases of git and git-client pligins i was able to use refspecs to "map" /refs/* to /refs/heads/* "namespace" which no longer works because of an optimisation of now using remote-ls to list branches and the git plugin sets "wantsbranches" which git-client uses to git ls-remote -h which ignores anything outside of /refs/heads i.e non standard branches. And because its remote theres nothing i can do locally to have those branches listed. From my initial investigations it looks like that both the git and git-client plugins would need changes tto provide the functionality that i want while still keepinng the optimisations recently intoduced.

          MARK ANDREWS added a comment - Im using multibranch pipeline with auto discover branches. It only discovers branches in /refs/heads/* as far as i can tell it doesn't have options for git hub et.al. plugins. And pull requests are in /refs/pull-requests which are ignored. Before recent releases of git and git-client pligins i was able to use refspecs to "map" /refs/* to /refs/heads/* "namespace" which no longer works because of an optimisation of now using remote-ls to list branches and the git plugin sets "wantsbranches" which git-client uses to git ls-remote -h which ignores anything outside of /refs/heads i.e non standard branches. And because its remote theres nothing i can do locally to have those branches listed. From my initial investigations it looks like that both the git and git-client plugins would need changes tto provide the functionality that i want while still keepinng the optimisations recently intoduced.

          I am working with VSTS and Jenkins.

          Since Multibranch Pipeline Jobs cannot detect branches outside refs/heads, I have to create an extra Pipeline Job which fetches refs/pull/* for verifying VSTS' pull-requests.

          Florian Bäuerle added a comment - I am working with VSTS and Jenkins. Since Multibranch Pipeline Jobs cannot detect branches outside refs/heads, I have to create an extra Pipeline Job which fetches refs/pull/* for verifying VSTS' pull-requests.

          Florian Bäuerle added a comment - - edited

          This issue is fixed with 3.9.0, there is a new option called "Discover other refs".

           

          Thanks!

           

          Oh sorry, just noticed that "RESOLVED" would be more appropriate...

          Florian Bäuerle added a comment - - edited This issue is fixed with 3.9.0, there is a new option called "Discover other refs".   Thanks!   Oh sorry, just noticed that "RESOLVED" would be more appropriate...

          I closed the Issue overzealously.

          The Multibranch pipeline actually detects the branch, but building them does not succeed.

          I get this message:
          ERROR: Could not determine exact tip revision of pull/2212/merge; falling back to nondeterministic checkout

          In the end, the correct commit is checked out but as soon as the actual pipeline script is executed on a node, the job fails with java.nio.file.NoSuchFileException. The Dockerfile cannot be found, which makes sense, because there is absolutetly nothing created on the slave (not even a workdir is being created).

          Florian Bäuerle added a comment - I closed the Issue overzealously. The Multibranch pipeline actually detects the branch, but building them does not succeed. I get this message: ERROR: Could not determine exact tip revision of pull/2212/merge; falling back to nondeterministic checkout In the end, the correct commit is checked out but as soon as the actual pipeline script is executed on a node, the job fails with java.nio.file.NoSuchFileException. The Dockerfile cannot be found, which makes sense, because there is absolutetly nothing created on the slave (not even a workdir is being created).

            Unassigned Unassigned
            jolykins MARK ANDREWS
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: