feat(desktop): stop code suggestions for gitlab projects if disabled
requested to merge 1218-vs-code-extension-should-not-supply-code-suggestions-on-disabled-projects into main
Description
This adds a new check to code suggestions to check the /code_suggestions/enabled
endpoint, if it returns a 403 unauthorized for a gitlab project, code suggestions are disabled for that project, until it is enabled on the server.
If there is no gitlab project, code suggestions should proceed as normal
Related Issues
Part of #1218 (closed)
How has this been tested?
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
How to Reproduce
- Create a project on your local GDK and
git clone
it locally - Disable code suggestions on that project with
project.project_setting.update!(code_suggestions: false)
in rails console - Open that project in VS Code (make sure GitLab project is checked out from your local GDK)
- Code Suggestion status should be "Code Suggestions is disabled by project"
Edited by Tomas Vik