[JIRA] (JENKINS-59306) Allow fetching of more tags

0 views
Skip to first unread message

bryce.schober@gmail.com (JIRA)

unread,
Sep 10, 2019, 7:26:02 PM9/10/19
to jenkinsc...@googlegroups.com
Bryce Schober created an issue
 
Jenkins / Improvement JENKINS-59306
Allow fetching of more tags
Issue Type: Improvement Improvement
Assignee: Mark Waite
Components: git-plugin
Created: 2019-09-10 23:25
Priority: Minor Minor
Reporter: Bryce Schober

I am running into problems with my automatic versioning script that uses git tags for different products in the same repository. I've enabled all the current git multi-branch tag-fetching behaviors, but can find no way to fetch additional tags beyond the one most close parent tag to my branch. My use-case wants to be able to see all of the tags.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

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

unread,
Sep 13, 2019, 2:34:04 PM9/13/19
to jenkinsc...@googlegroups.com
Mark Waite commented on Improvement JENKINS-59306
 
Re: Allow fetching of more tags

I'm not understanding precisely what you are trying to do.

If you want a multibranch pipeline build automatically created for every tag in the repostiory, then this stackoverflow article probably provides what you need.

If you want each workspace to include all the tags that are defined in the remote repository, then you likely need to enable the "Fetch tags" behaviour in the "Advanced clone options".

If neither of those is what you want, it is probably best to ask the mailing list for help.

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

unread,
Sep 13, 2019, 2:34:04 PM9/13/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
 
Change By: Mark Waite
Assignee: Mark Waite

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

unread,
Sep 13, 2019, 2:38:01 PM9/13/19
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Improvement JENKINS-59306
I'm not understanding precisely what you are trying to do.

If you want a multibranch pipeline build automatically created for every tag in the repostiory, then this [stackoverflow article|https://stackoverflow.com/questions/47146616/is-there-a-way-to-automatically-build-tags-using-the-multibranch-pipeline-jenkin] probably provides what you need.

If you want each workspace to include all the tags that are defined in the remote repository, then you likely need to enable the "Fetch tags" behaviour in the "
[ Advanced clone options |https://github.com/jenkinsci/git-plugin/blob/master/README.md#advanced-clone-behaviours] ".


If neither of those is what you want, it is probably best to ask the mailing list for help.

bryce.schober@gmail.com (JIRA)

unread,
Sep 13, 2019, 2:56:41 PM9/13/19
to jenkinsc...@googlegroups.com

Mark Waite, I have the "Fetch tags" behavior enabled, but it doesn't actually match my use-case, which is looking for deeper history than just the most recent tag parent of the current branch.  It does fetch all of the tag refs, but it doesn't fetch any additional pieces of the commit graph. My use case would require that it also fetch enough additional commit-graph history to be able to determine the ancestry from the current branch back to every tag.

This is because my use case is a multi-product repository, with tags using a "namespace" prefix along the lines of "product_foo-vN.N.N". This combines with the fact that our build pipeline builds the latest version of every product in the same job. We ultimately use a git describe HEAD --tags --match 'product_foo-v*' to determine the tag parentage of the current branch for that part of our full version string. So our clone would have to go all the way back to the oldest supported product's most recent version, which in the worst case could be almost the entire repository history - not really something that we should be doing in a regular build cycle.

All this has led me to realize that our dynamic multi-product versioning based git tags isn't really a practical solution, and given our current repository structure and usage, we should just back off to manually-maintained per-product version numbers, as is normally done in most any packaging system.

All that said, it is still true that while there exists a behavior to fetch all tags, it doesn't really leave the user with "usable" tags without the commit graph necessary to trace the branch back to them.

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

unread,
Sep 13, 2019, 3:03:02 PM9/13/19
to jenkinsc...@googlegroups.com

It sounds like you want every workspace to have the complete history, rather than using the multibranch pipeline default of a narrow history limited to a specific branch for the workspace dedicated to that branch.

The breadth of the history which is included in a workspace is controlled by the git refspec. The multibranch pipeline default is to fetch only the history for the exact branch being built in that workspace. You can change that behavior in scripted Pipeline by adding a custom refspec in the checkout step which includes all branches. You can change that behavior in declarative Pipeline by using skipDefaultCheckout and then performing the checkout with the same technique you would use for scripted Pipeline.

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

unread,
Sep 13, 2019, 3:04:02 PM9/13/19
to jenkinsc...@googlegroups.com
Change By: Mark Waite
Status: Open Fixed but Unreleased
Resolution: Not A Defect

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

unread,
Sep 13, 2019, 3:13:21 PM9/13/19
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Improvement JENKINS-59306
It sounds like you want every workspace to have the complete history, rather than using the multibranch pipeline default of a narrow history limited to a specific branch for the workspace dedicated to that branch.

The breadth of the history which is included in a workspace is controlled by the git {{refspec}}.  The multibranch pipeline default is to fetch only the history for the exact branch being built in that workspace.  You can change that behavior in scripted Pipeline by adding a custom {{refspec}} in the {{checkout}} step which includes all branches.  You can change that behavior in declarative Pipeline by using {{skipDefaultCheckout}} and then performing the checkout with the same technique you would use for scripted Pipeline.

The "copy the entire history" behavior is the standard behavior for Freestyle jobs and was the initial behavior for multibranch jobs.  One of the lead developers realized that significant time and space savings were possible in a multibranch context by acknowledging that most multibranch Pipeline jobs are building a single branch without consulting anything from other branches.

When multibranch implemented that optimization, some of the tests for the git plugin and git client plugin had to be adapted.  They assumed the Freestyle project default of including the entire repository history in every workspace.  Welcome to the elite club of multibranch Pipelines that want the full history in every workspace.

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

unread,
Apr 4, 2020, 8:39:03 PM4/4/20
to jenkinsc...@googlegroups.com
Change By: Mark Waite
Status: Fixed but Unreleased Closed
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages