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

Branch indexing on subversion repo does not work properly

    Details

    • Similar Issues:

      Description

      The multibranch indexer does not traverse sub-folders in subversion branches, if their revision is older than the parent directory.

      Include Branches: tags/*/projects/productname
      

      Given this folder structure in the trunk:

      projects/                -> r1
        productname/           -> r2
          Jenkinsfile          -> r3
      

      Branching projects into tags/1.0/projects yields

      tags/                     -> r4
        1.0/                    -> r4
          projects/             -> r1
             productname/       -> r2
               Jenkinsfile      -> r3
      

      Note that r4 is only applied to the new folders, and the branched folders retain their original revision (because they haven't changed).

      The expected behaviour here (and surely, the purpose of the multi-branch system), is for it to automatically detect the new branch and generate jobs from its Jenkinsfiles.

      The branch indexer should be able to work out that the 1.0/ folder didn't exist before, and index everything inside it at least once regardless of its revision.

        Attachments

          Issue Links

            Activity

            Hide
            rs Reinhard S added a comment - - edited

            That's true, you do not want to get commits into your result while the job is running. But this can be solved by resolving "HEAD" to the first real revision, in your example r4, and then giving the revision to the recursive fetch calls, i.e. requesting all sub-folders with revision r4.

            The first fetch call gets -1 as parameter, which means resolve "HEAD" and all recursive calls get specific revision numbers. That should solve both problems, only fetch code that was commit at job start and second, branches will checkout subfolders with the same revision as the branch.

            Show
            rs Reinhard S added a comment - - edited That's true, you do not want to get commits into your result while the job is running. But this can be solved by resolving "HEAD" to the first real revision, in your example r4, and then giving the revision to the recursive fetch calls, i.e. requesting all sub-folders with revision r4. The first fetch call gets -1 as parameter, which means resolve "HEAD" and all recursive calls get specific revision numbers. That should solve both problems, only fetch code that was commit at job start and second, branches will checkout subfolders with the same revision as the branch.
            Hide
            jfemia James Femia added a comment -

            That sounds reasonable to me ( as a non-expert )

            Show
            jfemia James Femia added a comment - That sounds reasonable to me ( as a non-expert )
            Hide
            bakkume Eric Bakkum added a comment -

            FYI, there is an open poll request that resolves this: https://github.com/jenkinsci/subversion-plugin/pull/205

            Show
            bakkume Eric Bakkum added a comment - FYI, there is an open poll request that resolves this: https://github.com/jenkinsci/subversion-plugin/pull/205
            Show
            oleg_nenashev Oleg Nenashev added a comment - https://github.com/jenkinsci/subversion-plugin/pull/205
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andy Neebel
            Path:
            src/main/java/jenkins/scm/impl/subversion/SubversionSCMSource.java
            http://jenkins-ci.org/commit/subversion-plugin/82e77a01979798ede7ca5f22dceaca03c6d2a737
            Log:
            JENKINS-41626 Fix path detection when subfolder older than root folder (#205)

            Checks for folders in HEAD, then checks if the candidate folder is available using it's revision, if not report it as the HEAD revision.

            • Clean up parameter that no longer matters
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andy Neebel Path: src/main/java/jenkins/scm/impl/subversion/SubversionSCMSource.java http://jenkins-ci.org/commit/subversion-plugin/82e77a01979798ede7ca5f22dceaca03c6d2a737 Log: JENKINS-41626 Fix path detection when subfolder older than root folder (#205) Fix for JENKINS-41626 Checks for folders in HEAD, then checks if the candidate folder is available using it's revision, if not report it as the HEAD revision. Clean up parameter that no longer matters

              People

              • Assignee:
                Unassigned
                Reporter:
                jfemia James Femia
              • Votes:
                9 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: