Skip to content

Update copy when snippet git feature disabled

What does this MR do?

When the snippet git feature is disabled, we return the copy as when a project is not found. I think it is best to return a more accurate message to help debugging.

We also change the return code return in those request. Notice, that we can't return the 403 or 401 when in both places, the controller and the internal API, because each place behaves differently.

If we return :unauthorized from the git controllers, git will think that we are asking for credentials and it will try to send another request with them. Therefore, we need :forbidden, to stop the process.

Nevertheless, in the internal API, because of https://gitlab.com/gitlab-org/gitlab/blob/fj-replace-snippet-git-message/lib/api/internal/base.rb#L53, we can't return :forbidden and :unauthorized should be sent instead.

Anyway, these changes will go away once we remove the feature flag. Planned for the %13.0.

Does this MR meet the acceptance criteria?

Conformity

Edited by 🤖 GitLab Bot 🤖

Merge request reports