Multiple QA failures in Gitaly and Praefect scenarios due to API failed (400) with `{"message":"denied by custom hooks"}`
Summary
Failing job(s): https://gitlab.com/gitlab-org/gitlab/-/jobs/4266798638, https://gitlab.com/gitlab-org/gitlab/-/jobs/4266798538
Stack trace
39) Create Group file templates creates file via custom Dockerfile file template
      Failure/Error:
        Resource::Repository::Commit.fabricate_via_api! do |commit|
          commit.project = file_template_project
          commit.commit_message = 'Add group file templates'
          commit.add_files(templates)
          commit.api_client = api_client
        end
      
      QA::Resource::Errors::ResourceFabricationFailedError:
        Fabrication of QA::Resource::Repository::Commit using the API failed (400) with `{"message":"denied by custom hooks"}`.
        Correlation Id: 01H05D0FAS00RKFHN4KY89MR7H
      # ./qa/resource/api_fabricator.rb:131:in `api_post_to'
      # ./qa/resource/api_fabricator.rb:104:in `api_post'
      # ./qa/resource/api_fabricator.rb:29:in `fabricate_via_api!'
      # ./qa/resource/repository/commit.rb:34:in `fabricate_via_api!'
      # ./qa/resource/base.rb:65:in `block (2 levels) in fabricate_via_api!'QA::Resource::Errors::ResourceFabricationFailedError:
        Fabrication of QA::Resource::Repository::Commit using the API failed (400) with `{"message":"denied by custom hooks"}`expected no Exception, got #<QA::Resource::Errors::ResourceFabricationFailedError: Fabrication of QA::Resource::File using the A...ailed (400) with `{"message":"denied by custom hooks"}`>The command HOME="/tmp/qa-netrc-credentials/39" git push http://root@gitlab-gitaly-cluster.test/gitlab-qa-sandbox-group-5/qa-test-2023-05-11-15-56-43-bc42dc380cff744c/project-with-secure-0d40b86483bbe1d6.git secure-mr:secure-mr 2>&1 failed (1) with the following output:
        remote: GitLab: 500 Internal Server Error
        To http://gitlab-gitaly-cluster.test/gitlab-qa-sandbox-group-5/qa-test-2023-05-11-15-56-43-bc42dc380cff744c/project-with-secure-0d40b86483bbe1d6.git
         ! [remote rejected] secure-mr -> secure-mr (pre-receive hook declined)Screenshot / HTML page
Possible fixes
Edited  by Dan Davison
