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
- Enable feature flag
Feature.enable(:support_sha256_repositories)
- Enable feature flag
Feature.enable(:store_object_format)
- Visit create new project page (http://127.0.0.1:3000/projects/new)
- Select Create blank project
- Check
Use SHA-256 for repository hashing algorithm
checkbox - Provide project name and group
- Click
Create project
button - The project should be successfully created
- In Rails console:
Project.last.project_repository.object_format
should returnsha256
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin