Add an option to enable/disable Code intelligence feature
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=487325) </details> <!--IssueSummary end--> Follow-up for https://gitlab.com/gitlab-org/gitlab/-/issues/472420+ ### Problem Currently, there is no way to disable Code intelligence feature. On blob's load we always search for [LSIF generated artifact](https://gitlab.com/gitlab-org/gitlab/-/blob/b28a1ad7082bbcb0fcf5fc99051a5cc9ee1e2edb/lib/gitlab/code_navigation_path.rb#L30-34) even if the LSIF job is missing. The Postgres planner problem occurred in https://gitlab.com/gitlab-org/gitlab/-/issues/472420 highlighted that Code intelligence feature cannot be disabled and available for all projects that don't even use it. ### Current status https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162894+ added a workaround that disables the whole Code intelligence feature on the instance if fetching of LSIF artifact takes too long. However, it's not an ideal solution. ### Proposal 1. Add an option to enable/disable Code intelligence feature per project or group. 2. Explore an option to optimize LSIF discovery. Try to fetch LSIF artifact only if the project supports it.
issue