Skip to content

Fix destruction of projects with pipelines

Stan Hu requested to merge sh-fix-rugged-list-commits-by-oid-no-repo into master

What does this MR do and why?

Background: We have legacy code that uses Rugged to access Git data (https://docs.gitlab.com/ee/development/gitaly.html#legacy-rugged-code). We preserved this because some customers are using network filesystems, and the Rugged access is faster than Gitaly access.

If a repository were deleted, the Gitaly implementation of list_commits_by_oid would catch a GRPC NotFound error and simply return an empty set.

However, the Rugged implementation would throw an NoRepository exception. This would prevent a repository from being deleted.

We make the Rugged implementation consistent with Gitaly since the behavior of destroying projects and CI pipelines relies on the Gitaly implementation.

Relates to #349414 (closed)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

On master with a GDK or Omnibus installation:

  1. Create blank project
  2. Create .gitlab-ci.yml with default template
  3. Wait for pipelines
  4. Delete project (Settings -> General -> Advanced -> Delete)
  5. Project still exists in state.

Apply this branch and you should be able to delete the project.

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 Stan Hu

Merge request reports

Loading