Skip to content

Ignore ci_default_git_depth parameter for project creation endpoint

What does this MR do and why?

The ci_default_git_depth parameter was included among the declared parameters for project creation. This is not actually supported and would result in the ci_cd_setting association being loaded before being created. With the ci_cd_setting not being created as a result.

Instead we ignore the ci_default_git_depth parameter during create by moving it to the update parameters.

Contributes to: #393502 (closed)

How to set up and validate locally

  1. Try creating a project through the API (Something like curl -XPOST 'http://gdk.test:3000/api/v4/projects' --header "PRIVATE-TOKEN: token" --header "Content-Type: application/json" --data '{"name": "test-settings", "namespace_id": 1, "ci_default_git_depth": 1}') and see that the project is created and the ci_default_git_depth parameter is ignored
  2. Try to change ci/cd settings for the project (Settings -> CI/CD) that exist on the ci_cd_setting association. For example Keep artifacts from most recent successful jobs or Git shallow clone. There should be no unexpected errors here.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #393502 (closed)

Edited by Jerry Seto

Merge request reports