Skip to content

Refactor `Projects::CreateService` to accept `repository_object_format`

Vasilii Iakliushin requested to merge 419887_rework_create_service into master

What does this MR do and why?

Contributes to #419887 (closed)

Problem

The previous implementation of SHA256 support for Projects::CreateService is not convenient for future usage from Projects API endpoint. Users will provide a repository_object_format parameter with a desired type instead of a boolean value.

Solution

  • Refactor Projects::CreateService interface to accept repository_object_format parameter instead of boolean use_sha256_repository param.
  • Adapt a project creation code for this change.

How to set up and validate locally

  1. Enable feature flag Feature.enable(:support_sha256_repositories)

  2. Visit create new project page (http://127.0.0.1:3000/projects/new)

  3. Select Create blank project

  4. Check Use SHA-256 for repository hashing algorithm checkbox

  5. Provide project name and group

  6. Click Create project button

  7. The project should be successfully created

  8. Copy the last commit hash Screenshot_2023-11-15_at_10.19.58

  9. It should have 64 characters (for 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