Add ability to create sha256 project through using the GitLab API
What does this MR do and why?
Contributes to #419887 (closed)
Problem
For future support of SHA256 repositories we don't have a way to create a project via API.
Solution
- Adjust
Projects::CreateService
interface to acceptobject_format
instead ofuse_sha256_repository
- Extend allowed parameters for Project creation API
How to set up and validate locally
Projects API
- Visit http://127.0.0.1:3000/api/v4/projects
- You should see a new field
repository_object_format
in the response
Creation of the project
Feature.enable(:support_sha256_repositories)
curl --request POST --header "PRIVATE-TOKEN: <PRIVATE_TOKEN>" --header "Content-Type: application/json" --data '{"name": "sha256_project", "description": "New Project", "repository_object_format": "sha256", "initialize_with_readme": "true"}' "http://127.0.0.1:3000/api/v4/projects"
- You should see a new project with SHA256
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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin