I wanted to report that there seems to be an issue with the Git plugin and 
polling. For some reason my Jenkins instance stopped picking up new Git 
changes when polling. Here is the information of my Jenkins instance:

Jenkins version: 2.47
​OS Git version: 2.7.4
Git plugin version: 3.0.5
Git client plugin version: 2.2.1​
​SCM API plugin version: 2.0.7​

Here's the job details for SCM:
​Repo URL: g...@github.com:SimpTek-Technologies/Foo.git​
​Repository Name: origin
Refspec: +refs/heads/develop:refs/remotes/origin/develop​
​Branches to build: refs/remotes/origin/develop​
​Additional Behaviours:
 - Checkout to specific local branch: <left value blank as it will be 
develop> ​
​ - Clean before checkout
 - *Force polling using workspace (HAD TO DO THIS TO GET AROUND BUG)*​

​I had to use force polling using workspace to get the poller to work. The 
git ls-remote does work correctly when running through a Bash shell 
session. It looks like the plugin isn't comparing the last build SHA1 value 
with the latest in Git.​

​Here's the command details from the Bash shell session:

jenkins@jenkins:/var/lib/jenkins/workspace/Develop/Clients/Foo$ git 
ls-remote -h g...@github.com:SimpTek-Technologies/Foo.git # timeout=10
b6f141a367aa42e0d8262aa35fbe20fba314eb94 refs/heads/develop
ffb74a8f55cef31aac3d3f7f3ac4b82a49138a4b refs/heads/master
3ee8a4ac718aa441d289ede5e005f93a3be742a7 refs/heads/staging​

​Here's the polling log of the last build where it shows that the plugin 
isn't correctly comparing the new SHA1 value 
(b6f141a367aa42e0d8262aa35fbe20fba314eb94) with the old:

​Started on 23-Feb-2017 12:06:47 PM
Using strategy: Default
[poll] Last Built Revision: Revision 
dab5696b067c87cb9a0e9196a7fb522a88a14f7b (refs/remotes/origin/develop)
using GIT_SSH to set credentials SimpTek GitHub credentials
 > git ls-remote -h g...@github.com:SimpTek-Technologies/Foo.git # timeout=10
Found 3 remote heads on g...@github.com:SimpTek-Technologies/Foo.git
Ignoring refs/heads/master as it doesn't match any of the configured 
refspecs
Ignoring refs/heads/staging as it doesn't match any of the configured 
refspecs
Done. Took 0.66 sec
No changes​

​Here's when I ran the git log command on the branch in the workspace for 
that repo on Jenkins:​

​commit dab5696b067c87cb9a0e9196a7fb522a88a14f7b
Author: Colin McQueen
Date:   Tue Feb 21 10:15:44 2017 -0400

    Testing webhook.​

​Here's the polling log with the force polling on the workspace:​

​Started on 23-Feb-2017 12:11:38 PM
Polling SCM changes on *master*
Using strategy: Default
[poll] Last Built Revision: Revision 
dab5696b067c87cb9a0e9196a7fb522a88a14f7b (refs/remotes/origin/develop)
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repositories
 > git config remote.origin.url g...@github.com:SimpTek-Technologies/Foo.git 
# timeout=10
Cleaning workspace
 > git rev-parse --verify HEAD # timeout=10
Resetting working tree
 > git reset --hard # timeout=10
 > git clean -fdx # timeout=10
Fetching upstream changes from g...@github.com:SimpTek-Technologies/Foo.git
 > git --version # timeout=10
using GIT_SSH to set credentials SimpTek GitHub credentials
 > git fetch --tags --progress g...@github.com:SimpTek-Technologies/Foo.git 
+refs/heads/develop:refs/remotes/origin/develop
Polling for changes in
 > git rev-parse refs/remotes/origin/develop^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/refs/remotes/origin/develop^{commit} # 
timeout=10
 > git log --full-history --no-abbrev --format=raw -M -m 
dab5696b067c87cb9a0e9196a7fb522a88a14f7b..b6f141a367aa42e0d8262aa35fbe20fba314eb94
 
# timeout=10
Done. Took 0.68 sec
Changes found​

​As shown above for some reason it says "Polling SCM changes on master" 
even though no changes happened on master and only the develop branch. I'm 
assuming this is hardcoded in the code to say master.

​Anyways I would prefer to not use force polling on the workspace and go 
back to the old way​. Hope the information provided will help identify and 
fix the issue.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/874854c0-07fc-4771-a47a-98c5484ad1c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to