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

Git poll always finds changes when there is none when used with Gerrit trigger strategy

      I have gerrit configured to react on changes in all branches (**) but the buids are using the property $GERRIT_BRANCH set to ref/heads/my_branch
      WHen polls are running i see that the last built revision matches the ones that are available in mainline - there is no other revisions that are coming from the git ls-remote command that poll uses. Yet git poll reports it found changes and it triggeres the rebuild.
      in changes list for the project all latest builds are having the same one commit over and over again.

          [JENKINS-24648] Git poll always finds changes when there is none when used with Gerrit trigger strategy

          eguess74 added a comment -

          so, to clarify the last settings i have iisues with: my builds are using a parameter GERRIT_REFSPEC set to refs/heads/my_branch
          Git repository refspec = $GERRIT_REFSPEC
          Branches to build = $GERIT_BRANCH
          Strategy = Gerrit Trigger
          Gerrit event: repo plain repos name, branch plain "my_branch"
          We are using ivy build trigger with more than a 1000 of projects set this way
          Everytimte the poll is triggered it finds 1 commit and rebuilds it

          eguess74 added a comment - so, to clarify the last settings i have iisues with: my builds are using a parameter GERRIT_REFSPEC set to refs/heads/my_branch Git repository refspec = $GERRIT_REFSPEC Branches to build = $GERIT_BRANCH Strategy = Gerrit Trigger Gerrit event: repo plain repos name, branch plain "my_branch" We are using ivy build trigger with more than a 1000 of projects set this way Everytimte the poll is triggered it finds 1 commit and rebuilds it

          eguess74 added a comment -

          what i would like to achieve is to make Jenkins to build only in case if there are changes submitted for review for branch my_branch and in case if there is a direct push into this branch. Nothing else should trigger the buid

          eguess74 added a comment - what i would like to achieve is to make Jenkins to build only in case if there are changes submitted for review for branch my_branch and in case if there is a direct push into this branch. Nothing else should trigger the buid

          eguess74 added a comment - - edited

          had to go back to the ANT branch pattern my_branch* as the plain branch name was not triggering properly if there is a topic added.

          eguess74 added a comment - - edited had to go back to the ANT branch pattern my_branch * as the plain branch name was not triggering properly if there is a topic added.

          eguess74 added a comment - - edited

          i'm curious if the conflict can be caused by the fact that i have gerrit event as the trigger configured together with the poll scm...

          eguess74 added a comment - - edited i'm curious if the conflict can be caused by the fact that i have gerrit event as the trigger configured together with the poll scm...

          eguess74 added a comment -

          Currently i narrowed it down to the fact that i had gerrit event trigger configured together with the Poll scm trigger and those seem to be conflicting settings. It was causing Jenkins to poll much more often then it had to. Currently it is all quieted down and my life seems to be good again

          eguess74 added a comment - Currently i narrowed it down to the fact that i had gerrit event trigger configured together with the Poll scm trigger and those seem to be conflicting settings. It was causing Jenkins to poll much more often then it had to. Currently it is all quieted down and my life seems to be good again

          eguess74 added a comment -

          well, not so shiny I'm definitely having fun with this conversation with myself...
          so when the poll was switched off the server calmed down and stopped repolling and rebuilding. BUt in the same time i los the ability to trigger build in case of direct push to the 'my_branch' using gerrit post-receive hook and git plugin push notification, because there is no jobs that using polling.

          eguess74 added a comment - well, not so shiny I'm definitely having fun with this conversation with myself... so when the poll was switched off the server calmed down and stopped repolling and rebuilding. BUt in the same time i los the ability to trigger build in case of direct push to the 'my_branch' using gerrit post-receive hook and git plugin push notification, because there is no jobs that using polling.

          eguess74 added a comment -

          my last development here is to use POLL SCM but not set anything - keep it empty. That makes the hook for git plugin work and seems to not cause havoc... so far...

          eguess74 added a comment - my last development here is to use POLL SCM but not set anything - keep it empty. That makes the hook for git plugin work and seems to not cause havoc... so far...

          Mark Waite added a comment - - edited

          I think you've used the correct technique for your case.

          Defining a poll with no polling interval definition is a common technique to declare that a job will only be launched by a polling hook. I believe that is what Kohsuke described in his "polling must die" blog posting.

          That doesn't justify the non-stop rebuilds, but I don't know how to duplicate those non-stop rebuilds.

          Mark Waite added a comment - - edited I think you've used the correct technique for your case. Defining a poll with no polling interval definition is a common technique to declare that a job will only be launched by a polling hook. I believe that is what Kohsuke described in his " polling must die " blog posting. That doesn't justify the non-stop rebuilds, but I don't know how to duplicate those non-stop rebuilds.

          eguess74 added a comment -

          the problem is not exactly in constant rebulds, but in the fact that when poll was set to daily and configured with the gerrit trigger the polls were happening a bit more often and they were always finding one commit as a recent change. Just because we are using the ivy build trigger and there are several projects that most of other projects are depending from it eventually was becoming full server rebuild.

          eguess74 added a comment - the problem is not exactly in constant rebulds, but in the fact that when poll was set to daily and configured with the gerrit trigger the polls were happening a bit more often and they were always finding one commit as a recent change. Just because we are using the ivy build trigger and there are several projects that most of other projects are depending from it eventually was becoming full server rebuild.

          eguess74 added a comment -

          So the only issue i have now is that on the direct push to ther repository git plugin keeps showing me only one commit in changelist even if there were more then one commits pushed.
          I'm not sure why it is not just taking last built revision and builds the rev-list from there to the currently checked out revision.

          eguess74 added a comment - So the only issue i have now is that on the direct push to ther repository git plugin keeps showing me only one commit in changelist even if there were more then one commits pushed. I'm not sure why it is not just taking last built revision and builds the rev-list from there to the currently checked out revision.

            Unassigned Unassigned
            eguess74 eguess74
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: