Build Git Clone with Branches and Tags
complete
C
Cooing Rook
When using the Clone toggle for a build stage, the resultant clone is highly optimized and is missing branches and tags. This causes libraries and tooling for doing automatic versioning based on those such as https://pypi.org/project/poetry-dynamic-versioning/ and https://pypi.org/project/setuptools-scm/ fail. We'd like to suggest there be an additional parameter for depth, or a toggle for "full clone" for this stage level clone option get added for pipelines that need this additional information. Ulan Bekishov from Harness suggested we make this a feature request if you want additional context
Log In
N
Nofar Bluestein
Hey, 'depth' is already supported.
On top of this, we've added many enhancements to git clone that are currently behind the feature flag CI_GIT_CLONE_ENHANCED. This includes the ability to fetch tags as well, which might be helpful for you.
please see release notes:
Also please see documentation for more information : https://developer.harness.io/docs/continuous-integration/use-ci/codebase-configuration/git-clone-step
Thank you,
Nofar Bluestein
CI product team
N
Nofar Bluestein
complete
Canny AI
Merged in a post:
Codebase advanced configuration add Tags option
D
Dandelion Dinosaur
In the codebase advanced configuration, the way you have an option for the Depth, it would be useful to have a Tags option (something like a toggle/switch), so that when the clone codebase executes the git fetch command it would add --tags into it.
Canny AI
Merged in a post:
Support sparse checkout, depth, recursive features in CI code base configuration
N
Novel Cod
The workaround of using a separate git clone step will not allow PR status updates and access to codebase variables. RFE to consider supporting the clone options in codebase associated with CI build pipeline so that all the builtin features of codebase can be used - options of depth, sparse checkout and recursive
D
Dandelion Dinosaur
We are using tags to fetch Jira issues related to them and attach build and deployment details to those issues.
Pranav Rastogi
pending feedback
Pranav Rastogi
Setting a depth=0 will do the full clone. Please this document https://developer.harness.io/docs/continuous-integration/use-ci/codebase-configuration/create-and-configure-a-codebase#depth. Does this solve your use-case?
S
Skilled Boa
Hi Pranav Rastogi ; having tested this, it doesn't seem to work as expected. Please note the output below; our expectation would be that git tag's output is not empty. It's not clear from the output of the Clone Codebase step that the
--depth
flag is being used by git fetch
.F
Frequent Jay
@Nofar Bluestein FYI regarding my merged post. We also don't see git clone behaving as expected. Also, my ask additionally was about changing the commit depth per-stage. Please reopen.