Skip to content

feat(desktop): stop code suggestions for gitlab projects if disabled

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

  1. Create a project on your local GDK and git clone it locally
  2. Disable code suggestions on that project with project.project_setting.update!(code_suggestions: false) in rails console
  3. Open that project in VS Code (make sure GitLab project is checked out from your local GDK)
  4. Code Suggestion status should be "Code Suggestions is disabled by project"
Edited by Tomas Vik

Merge request reports