-
Bug
-
Resolution: Fixed
-
Medium
-
9.2.3, 10.0.0, 10.1.0, 9.2.20, 9.6.8, 10.0.3
-
None
-
Severity 3 - Minor
-
-
Warranty
Issue Summary
Git shallow checkouts not working from Bamboo 9.2.3 when both "Use shallow clones" and "Enable repository caching on agents" are enabled in the repository settings.
This is reproducible on Data Center:
Steps to Reproduce
- Use Bamboo 9.2.3 or later
- Create a repository
- Open the repository Advanced Options
- Notice "Enable repository caching on agents" will be already checked, keep it.
- Enable the "Use shallow clones" checkbox
- Save the repository settings
- Add the repository to a Plan and run a customised build with verbose logging
- Check the build logs
Expected Results
The build logs should report a checkout command such as:
/usr/bin/git fetch -f -p ssh://ffd98edf-cab0-47a4-bc2d-79b23e5134bb@127.0.0.1:39071/big/bigfiles.git +refs/heads/master:refs/heads/master --update-head-ok --progress --verbose --depth 1
Notice the --depth 1 as an option to the git fetch command.
Actual Results
The checkout test is executed without --depth 1:
/usr/bin/git fetch -f -p ssh://52957c39-a38c-4409-b399-d8140ed08029@127.0.0.1:45503/big/bigfiles.git +refs/heads/master:refs/heads/master --update-head-ok --progress --verbose
Workaround
Repository caching on Agents and Shallow clones are mutually exclusive, meaning that only one property will be enabled at a time. This is by design and was implemented in BAM-22132. To enable shallow clones, disable "Enable repository caching on agents."
Though not a bug, the issue will be fixed by adding rules that will make selecting "Enable repository caching on agents" x "Use shallow clones" exclusive.