[JIRA] (JENKINS-58471) Git SCM polling does not work with "honor refspec"

4 views
Skip to first unread message

antoine.tran.11w@gmail.com (JIRA)

unread,
Jul 12, 2019, 9:28:01 AM7/12/19
to jenkinsc...@googlegroups.com
Antoine Tran created an issue
 
Jenkins / Improvement JENKINS-58471
Git SCM polling does not work with "honor refspec"
Issue Type: Improvement Improvement
Assignee: Mark Waite
Components: git-plugin
Created: 2019-07-12 13:27
Environment: Jenkins 2.60.3
Git client 2.7.1
Priority: Minor Minor
Reporter: Antoine Tran

Actual behavior

When setting refspec like this: +refs/heads/${GIT_REF}:refs/remotes/origin/${GIT_REF}

And after building a branch, the SCM polling does not find a match with git ls-remote and the built branch:

 

[poll] Last Built Revision: Revision ce9cc0a298fc94cafa4cc87e0bb1544b359ee752 (feature/20190711-FVE-test_job_scm)
 > git --version # timeout=10

...

Ignoring refs/heads/feature/20190711-FVE-test_job_scm as it doesn't match any of the configured refspecs

No changes

 

 

Expected behavior:

The SCM poll should keep the source refspec of the last build, in this case "refs/heads/feature/20190711-FVE-test_job_scm", and do a comparison with that, with git ls-remote:

 

[poll] Last Built Revision: Revision ce9cc0a298fc94cafa4cc87e0bb1544b359ee752 (feature/20190711-FVE-test_job_scm)
 > git --version # timeout=10

...

[poll] Latest remote head revision on refs/heads/feature/20190711-FVE-test_job_scm is: 4a598524b56af4493027828d7e2a5f1b3179ec82
Done. Took 0.4 sec
Changes found

 

 

Workaround:

I set the GIT_REFSPEC to:

+refs/heads/${GIT_REF}:refs/heads/${GIT_REF}

But that is not optimal for us, because we want this to work with branches and tag, and this does not work for tags, thus the old value:

+refs/heads/${GIT_REF}:refs/remotes/origin/${GIT_REF}

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 12, 2019, 10:05:01 AM7/12/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
Change By: Mark Waite
Assignee: Mark Waite
Reply all
Reply to author
Forward
0 new messages