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

No way to disable lightweight checkout for Multibranch projects

    Details

    • Similar Issues:

      Description

      The regular pipeline project type allows the users the option to enable or disable "lightweight checkout" of the Jenkinsfile. When enabled, the project will attempt to use the `SCMFileSystem` classes to get get the Jenkinsfile without checking out the entire working tree. If the SCM does not support this feature it falls back to the default.

      The multi-branch plugin lacks the option to disable trying to use the SCMFileSystem. Lacking that support can cause issues. It is not always practical to support the entire feature set of an SCM in an SCMFileSystem, so some projects need the ability to turn off lightweight checkout.

      As an example recently the subversion plugin added support for lightweight checkout. However the lightweight checkout support did not include the ability to handle externals (which are like git's submodules). Since most users do store their Jenkinsfile in externals, even this incomplete support provides the benefit of not needing two on-disk checkouts of each project, which can be really valuable.

      However a small number of users actually do store their Jenkinsfile in SVN externals. Those users were broken with the multi-branch pipeline project because it lacks the option to disable the use of lightweight checkout. A workaround of a special system property was added to address that, but the proper fix is to add the checkbox to disable this to the multi-branch pipeline plugin.

       

        Attachments

          Activity

          Hide
          stephenconnolly Stephen Connolly added a comment -

          Correct fix would be for the subversion plugin to implement traits support and then a trait could be added to suppress the lightweight checkout, e.g. https://github.com/jenkinsci/subversion-plugin/blob/master/src/main/java/jenkins/scm/impl/subversion/SubversionSCMFileSystem.java#L84 could be something like:

          		@Override
          		public boolean supports(SCMSource source) {
          			return source instanceof SubversionSCMSource 
                                       && ((SubversionSCMSource)source).getTraits().get(SuppressLightweightCheckout.class) == null;
          		}
          
          Show
          stephenconnolly Stephen Connolly added a comment - Correct fix would be for the subversion plugin to implement traits support and then a trait could be added to suppress the lightweight checkout, e.g. https://github.com/jenkinsci/subversion-plugin/blob/master/src/main/java/jenkins/scm/impl/subversion/SubversionSCMFileSystem.java#L84 could be something like: @Override public boolean supports(SCMSource source) { return source instanceof SubversionSCMSource && ((SubversionSCMSource)source).getTraits().get(SuppressLightweightCheckout.class) == null ; }

            People

            • Assignee:
              Unassigned
              Reporter:
              jsmith45 Joe Smith
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: