Skip to content

Save repository object format on project creation

What does this MR do and why?

Contributes to #419887 (closed)

Problem

In previous MR !136819 (merged) we extended project_repositories table with a new field object_format to keep the type of the repository (sha1 or sha256). But this field isn't populated in the application code yet.

Solution

Populate the field with a object_format value from Gitaly on project's creation.

How to set up and validate locally

  1. Enable feature flag Feature.enable(:support_sha256_repositories)
  2. Enable feature flag Feature.enable(:store_object_format)
  3. Visit create new project page (http://127.0.0.1:3000/projects/new)
  4. Select Create blank project
  5. Check Use SHA-256 for repository hashing algorithm checkbox
  6. Provide project name and group
  7. Click Create project button
  8. The project should be successfully created
  9. In Rails console: Project.last.project_repository.object_format should return sha256

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 Vasilii Iakliushin

Merge request reports