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

the first time scm polling of a job after server restart always return "changes found"

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • repo-plugin
    • None
    • jenkins: 2.61
      repo plugin: 1.10.7
      job type: pipeline

        [JENKINS-44358] the first time scm polling of a job after server restart always return "changes found"

        Makson Lee added a comment -

        i tried to debug it, as shown in screenshot-1, myBaseline is a instance of SCMRevisionState.None, but it would not equal to SCMRevisionState.NONE, why? only one instance of  SCMRevisionState.None should be there, right?

        Makson Lee added a comment - i tried to debug it, as shown in screenshot-1, myBaseline is a instance of SCMRevisionState.None, but it would not equal to SCMRevisionState.NONE, why? only one instance of  SCMRevisionState.None should be there, right?

        Makson Lee added a comment -

        as a workaround, i tried the following,

        --- a/src/main/java/hudson/plugins/repo/RepoScm.java
        +++ b/src/main/java/hudson/plugins/repo/RepoScm.java
        @@ -631,7 +631,7 @@ public class RepoScm extends SCM implements Serializable {
        final String expandedManifestBranch = env.expand(manifestBranch);
        final Run<?, ?> lastRun = job.getLastBuild();
        
        - if (myBaseline == SCMRevisionState.NONE) {
        + if (myBaseline.getClass() == SCMRevisionState.NONE.getClass()) {
        // Probably the first build, or possibly an aborted build.
        myBaseline = getLastState(lastRun, expandedManifestBranch);
        if (myBaseline == SCMRevisionState.NONE) {
        

         

        Makson Lee added a comment - as a workaround, i tried the following, --- a/src/main/java/hudson/plugins/repo/RepoScm.java +++ b/src/main/java/hudson/plugins/repo/RepoScm.java @@ -631,7 +631,7 @@ public class RepoScm extends SCM implements Serializable { final String expandedManifestBranch = env.expand(manifestBranch); final Run<?, ?> lastRun = job.getLastBuild(); - if (myBaseline == SCMRevisionState.NONE) { + if (myBaseline.getClass() == SCMRevisionState.NONE.getClass()) { // Probably the first build, or possibly an aborted build. myBaseline = getLastState(lastRun, expandedManifestBranch); if (myBaseline == SCMRevisionState.NONE) {  

        Lucas Nunes added a comment -

        I was having the same problem, and using cdlee's workaround worked for me.

        Lucas Nunes added a comment - I was having the same problem, and using cdlee 's workaround worked for me.

          Unassigned Unassigned
          cdlee Makson Lee
          Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

            Created:
            Updated: