Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-25956

Git repository shallow checkout option not working in Bamboo 9.2.3 and later

      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

      1. Use Bamboo 9.2.3 or later
      2. Create a repository
      3. Open the repository Advanced Options
      4. Notice "Enable repository caching on agents" will be already checked, keep it.
      5. Enable the "Use shallow clones" checkbox
      6. Save the repository settings
      7. Add the repository to a Plan and run a customised build with verbose logging
      8. 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."

            [BAM-25956] Git repository shallow checkout option not working in Bamboo 9.2.3 and later

            Eduardo Alvarenga made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 974663 ]
            Bruno Benvenuti made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 972258 ]
            Bruno Benvenuti made changes -
            Fix Version/s Original: 10.2.0 [ 110294 ]
            Eduardo Alvarenga made changes -
            Remote Link New: This issue links to "+core+ Dogfooding › Test Git Branch Detection › feature-BAM-25956-point-Repository-caching-on-Agents-to-documentation (tardigrade-bamboo)" [ 971466 ]
            Eduardo Alvarenga made changes -
            Remote Link New: This issue links to "ZZ Zuza › PR data › feature-BAM-25956-point-Repository-caching-on-Agents-to-documentation (tardigrade-bamboo)" [ 971464 ]
            Alexey Chystoprudov made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]
            Mateusz Szmal made changes -
            Fix Version/s New: 9.6.10 [ 110356 ]
            Fix Version/s New: 9.2.22 [ 110355 ]
            Eduardo Alvarenga made changes -
            Fix Version/s New: 10.1.1 [ 110338 ]
            Fix Version/s New: 10.2.0 [ 110294 ]
            Eduardo Alvarenga made changes -
            Status Original: In Review [ 10051 ] New: Waiting for Release [ 12075 ]
            Eduardo Alvarenga made changes -
            Status Original: In Progress [ 3 ] New: In Review [ 10051 ]

              73868399605e Eduardo Alvarenga
              73868399605e Eduardo Alvarenga
              Affected customers:
              0 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: