Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Pull request pipeline doesnt respect clone depth

I have the following pipeline set up for pull requests: 

depth: 1
max-time: 15

memory: 6144
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
size: 2x
depth: 1 # this doesnt work for some reason...
- pipe: sonarsource/sonarcloud-scan:1.2.0

- step: *build-test-sonarcloud

The clone depth works fine for the custom/branch pipelines but not for the pull-request pipeline.

Ive tried setting clone enabled to false and that seems to apply fine so not sure why clone depth isnt being picked up.

1 answer

0 votes

Pull Request pipelines use special checkout rules, as noted in the docs

PR builds checkout the current branch and merge in the target branch. It is intended to mimic the state post-merge of complete branch histories.

Shallow clones sever the history prior to the number of commits specified.  Fine if you don't need the commit history, but of course git needs that history back to the point of divergence in order to merge correctly.  So shallow clone would then fail merge or worse have a different outcome than an actual merge to master later with full repos.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,497 views 4 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you