404 Request for security configuration when the feature is disabled

Summary

On the project settings page, when the "Security & Compliance" feature is disabled, a request is sent to the /:namespace/:project/-/security/configuration endpoint.

This always seems to return a 404 (which makes sense since the feature is disabled).

Steps to reproduce

  1. Create a project
  2. Navigate to project settings, make sure that "Security and Compliance" is disabled
  3. Refresh the page and look at the network tab

Example Project

What is the current bug behavior?

An api request is made to /:namespace/:project/-/security/configuration

What is the expected correct behavior?

The request should not be made if the feature is disabled

Relevant logs and/or screenshots

Screen_Shot_2022-01-19_at_10.11.12_am

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes