Skip to content

Bitbucket Server importer: create refs for fetched commits

What does this MR do and why?

Follow-up to !133606 (merged). If we fetch commits from Bitbucket Server without creating refs, then garbage collection will delete these commits eventually since they are not tied to any refs.

To fix this, we fetch the commits and create refs for them in the format

  • #{diff.head_commit_sha}:refs/merge-requests/#{iid}/head for head commit SHA
  • #{diff.start_commit_sha}:refs/keep-around/#{diff.start_commit_sha} for start commit SHA

Ref paths need to be unique and we want a way to easily identify these refs so that we can do cleanup and investigations if needed.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Madelein van Niekerk

Merge request reports