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

When MultiSCM is used to poll git, it will always rebuild if the workspace is cleaned post build.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We use MultiSCM to check out multiple git repos before building. The polling for changes works fine when the workspace from last build is still present, but if we add a post build action to clean the workspace, MultiSCM will always start a new build even though nothing has changed.

      However, a workaround is to only delete all files in the workspace but leave the workspace directory intact. Then MultiSCM will do the right thing and check for real changes.

      It's pretty easy to reproduce. Make a job that uses MultiSCM to checkout a git repo, then use the Workspace Cleanup plugin to clean it up afterwards and set it to poll for SCM changes every minute. It will start a build every minute even though nothing has changed. But if you use the Git plugin directly, without using MultiSCM as a proxy, it will not build every minute.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Johnny Willemsen
            Path:
            src/main/java/org/jenkinsci/plugins/multiplescms/MultiSCMRevisionState.java
            http://jenkins-ci.org/commit/multiple-scms-plugin/48aeb95c4c2fe9d937db9bdf74193b648cb06e31
            Log:
            At the moment we have a SCM that doesn't require a workspace to poll for changes the ws will be null

            [FIXED JENKINS-25253]

            Compare: https://github.com/jenkinsci/multiple-scms-plugin/compare/9f53e8fd72d7...48aeb95c4c2f

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Johnny Willemsen Path: src/main/java/org/jenkinsci/plugins/multiplescms/MultiSCMRevisionState.java http://jenkins-ci.org/commit/multiple-scms-plugin/48aeb95c4c2fe9d937db9bdf74193b648cb06e31 Log: At the moment we have a SCM that doesn't require a workspace to poll for changes the ws will be null [FIXED JENKINS-25253] Compare: https://github.com/jenkinsci/multiple-scms-plugin/compare/9f53e8fd72d7...48aeb95c4c2f
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Johnny Willemsen
            Path:
            src/main/java/org/jenkinsci/plugins/multiplescms/MultiSCM.java
            http://jenkins-ci.org/commit/multiple-scms-plugin/0cd660a0f9c2a26d6817cd7ba17646205f2b11a8
            Log:
            Implement supportsPolling and requiresWorkspaceForPolling

            Gets multiple git polling working with no workspace checked out

            [FIXED JENKINS-25253]

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Johnny Willemsen Path: src/main/java/org/jenkinsci/plugins/multiplescms/MultiSCM.java http://jenkins-ci.org/commit/multiple-scms-plugin/0cd660a0f9c2a26d6817cd7ba17646205f2b11a8 Log: Implement supportsPolling and requiresWorkspaceForPolling Gets multiple git polling working with no workspace checked out [FIXED JENKINS-25253]
            Hide
            jwillemsen Johnny Willemsen added a comment -

            Tested now my proposed addition, had to make a small change in another place, see https://github.com/jenkinsci/multiple-scms-plugin/pull/18

            Show
            jwillemsen Johnny Willemsen added a comment - Tested now my proposed addition, had to make a small change in another place, see https://github.com/jenkinsci/multiple-scms-plugin/pull/18
            Hide
            jwillemsen Johnny Willemsen added a comment -

            Could this be because this plugin doesn't implement requiresWorkspaceForPolling (see http://javadoc.jenkins-ci.org/hudson/scm/SCM.html#requiresWorkspaceForPolling%28%29).

            Show
            jwillemsen Johnny Willemsen added a comment - Could this be because this plugin doesn't implement requiresWorkspaceForPolling (see http://javadoc.jenkins-ci.org/hudson/scm/SCM.html#requiresWorkspaceForPolling%28%29 ).
            Hide
            sirot Jean-Christophe Sirot added a comment -

            Any update on this issue? I'm facing the same issue with docker containers as Jenkins slaves which are deleted when the job is finished (along with the workspace)

            Show
            sirot Jean-Christophe Sirot added a comment - Any update on this issue? I'm facing the same issue with docker containers as Jenkins slaves which are deleted when the job is finished (along with the workspace)
            Hide
            or_shachar Or Shachar added a comment -

            Thanks for the workaround... I bet there's a simple mistake in one on the conditions in the code that causes it.
            I'll try to dig in...

            Thanks!

            Show
            or_shachar Or Shachar added a comment - Thanks for the workaround... I bet there's a simple mistake in one on the conditions in the code that causes it. I'll try to dig in... Thanks!

              People

              Assignee:
              kbell Kevin Bell
              Reporter:
              mcmagnus Magnus Berg
              Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: