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

Provide a SCMCheckoutStrategy to checkout only once for all matrix entries

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Critical Critical
    • matrix-project-plugin
    • None
    • Platform: All, OS: All

      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.

          [JENKINS-4960] Provide a SCMCheckoutStrategy to checkout only once for all matrix entries

          asolsson created issue -

          asolsson added a comment -

          Created an attachment (id=1043)
          Diff file

          asolsson added a comment - Created an attachment (id=1043) Diff file

          As we discussed in the IRC, some minimal error check to make sure configuration builds are running on the same node as the parent build would be great, to make sure the users won't be surprised when they use the distributed builds.

          In the future, the error check can be replaced by the copy from the parent workspace to child workspace, which is another often requested feature.

          Kohsuke Kawaguchi added a comment - As we discussed in the IRC, some minimal error check to make sure configuration builds are running on the same node as the parent build would be great, to make sure the users won't be surprised when they use the distributed builds. In the future, the error check can be replaced by the copy from the parent workspace to child workspace, which is another often requested feature.

          I just realized that those two behaviors aren't exactly the same thing — the latter user might expect Hudson to create a copy of the workspace if two configurations happen to run on the same host, while the original requestor wouldn't like that.

          Hmm.

          Kohsuke Kawaguchi added a comment - I just realized that those two behaviors aren't exactly the same thing — the latter user might expect Hudson to create a copy of the workspace if two configurations happen to run on the same host, while the original requestor wouldn't like that. Hmm.

          asolsson added a comment -

          Diff file with discussed changes.
          The current node is compared to the parentBuild node, and if different an exception is thrown causing the build to fail.

          asolsson added a comment - Diff file with discussed changes. The current node is compared to the parentBuild node, and if different an exception is thrown causing the build to fail.
          asolsson made changes -
          Attachment New: useSameScmCheckout.diff [ 18962 ]
          mdonohue made changes -
          Link New: This issue is duplicated by JENKINS-5078 [ JENKINS-5078 ]

          asolsson added a comment - - edited

          Updated patch (patch.diff):
          useSameScmCheckout will only work on one node.

          Added an option to skip checkout on the master, if a user only would like to do the checkouts per-configuration, see duplicated issues.

          asolsson added a comment - - edited Updated patch (patch.diff): useSameScmCheckout will only work on one node. Added an option to skip checkout on the master, if a user only would like to do the checkouts per-configuration, see duplicated issues.
          asolsson made changes -
          Attachment New: patch.diff [ 19007 ]

          Thanks. Started looking at the patch now.

          Kohsuke Kawaguchi added a comment - Thanks. Started looking at the patch now.

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

              Created:
              Updated: