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

Provide a SCMCheckoutStrategy to checkout only once for all matrix entries

    XMLWordPrintable

Details

    • New Feature
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • matrix-project-plugin
    • None
    • Platform: All, OS: All

    Description

      When a project got a configuration matrix, the source code is checked out multiple times:

      • Once for reference incase of poll scm on schedule.
      • Once per matrix item, increasing proportionaly to the complexity.

      It would be great to have a strategy, which runs checkout only once in the master build.

      A patch proposal from @asolsson (initial implementation before creation of SCMCheckoutStrategy )

      I've implemented an enhancement to the matrix project to avoid a SCM checkout
      for each target in the matrix. This can be useful if checkout takes a long time
      and if the build step can build concurrent builds from the same SCM area.
      It's implemented as a option when setting up the Matrix project, if not
      used/checked the Matrix project will work as usual.

      Attachments

        Issue Links

          Activity

            oleg_nenashev Oleg Nenashev added a comment -

            BTW, the real issue has not been fixed (duplicated by https://issues.jenkins-ci.org/browse/JENKINS-13042)
            The issue's title and contents are quite different and confusing. I've refactored descriptions in order to represent the current state.

            BTW, the strategy should be available in previous LTS releases (1.509.x is mandatory), so it should be implemented as a plugin.

            oleg_nenashev Oleg Nenashev added a comment - BTW, the real issue has not been fixed (duplicated by https://issues.jenkins-ci.org/browse/JENKINS-13042 ) The issue's title and contents are quite different and confusing. I've refactored descriptions in order to represent the current state. BTW, the strategy should be available in previous LTS releases (1.509.x is mandatory), so it should be implemented as a plugin.
            roman80 Roman80 added a comment -

            What is the current status of this change, because we need this change too?

            roman80 Roman80 added a comment - What is the current status of this change, because we need this change too?
            oleg_nenashev Oleg Nenashev added a comment -

            roman80 Jenkins core side is done. https://wiki.jenkins-ci.org/display/JENKINS/Extension+points#Extensionpoints-jenkins.scm.SCMCheckoutStrategy
            Now somebody should implement a short plugin or maybe just patch matrix project plugin since it's decoupled now.

            oleg_nenashev Oleg Nenashev added a comment - roman80 Jenkins core side is done. https://wiki.jenkins-ci.org/display/JENKINS/Extension+points#Extensionpoints-jenkins.scm.SCMCheckoutStrategy Now somebody should implement a short plugin or maybe just patch matrix project plugin since it's decoupled now.
            roman80 Roman80 added a comment - - edited

            I'm new to jenkins development, so what can I do to get this done?
            What's is so difficult to fix this?
            Aren't there some interfaces to implement?

            roman80 Roman80 added a comment - - edited I'm new to jenkins development, so what can I do to get this done? What's is so difficult to fix this? Aren't there some interfaces to implement?
            elbandi80 Elso Andras added a comment -

            This is a tiny class, add to an own plugin. You can select this checkout strategy, this will skip the axis scm checkouts:

            public class NoAxisCheckoutSCMCheckoutStrategyImpl extends SCMCheckoutStrategy {
                @DataBoundConstructor
                public NoAxisCheckoutSCMCheckoutStrategyImpl() {}
                @Extension
                public static class DescriptorImpl extends SCMCheckoutStrategyDescriptor {
                    @Override
                    public String getDisplayName() {
                        return "No axis checkout";
                    }
                    @Override
                    public boolean isApplicable(AbstractProject project) {
                        return (project instanceof MatrixProject);
                    }
                }
                @Override
                public void checkout(AbstractBuild.AbstractBuildExecution execution) throws IOException, InterruptedException {
                    if (execution instanceof MatrixBuild.MatrixBuildExecution) {
                        super.checkout(execution);
                    }
                }
            }
            
            
            elbandi80 Elso Andras added a comment - This is a tiny class, add to an own plugin. You can select this checkout strategy, this will skip the axis scm checkouts: public class NoAxisCheckoutSCMCheckoutStrategyImpl extends SCMCheckoutStrategy { @DataBoundConstructor public NoAxisCheckoutSCMCheckoutStrategyImpl() {} @Extension public static class DescriptorImpl extends SCMCheckoutStrategyDescriptor { @Override public String getDisplayName() { return "No axis checkout" ; } @Override public boolean isApplicable(AbstractProject project) { return (project instanceof MatrixProject); } } @Override public void checkout(AbstractBuild.AbstractBuildExecution execution) throws IOException, InterruptedException { if (execution instanceof MatrixBuild.MatrixBuildExecution) { super .checkout(execution); } } }

            People

              Unassigned Unassigned
              asolsson asolsson
              Votes:
              33 Vote for this issue
              Watchers:
              31 Start watching this issue

              Dates

                Created:
                Updated: