Fix for User Personal Projects if Instance AI Features are disabled

What does this MR do and why?

The purposes of this MR is to fix the bug reported in this Issue - where in a User's Personal Projects (example: user > personal_project) an error is thrown when an Instance has AI Settings banned.

Related Issues:

  • #493718 (closed) - Error 500 when opening General settings of personal projects if Duo is disabled

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-09-24_at_11.55.48_AM Screenshot_2024-09-24_at_11.50.42_AM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

For frontend changes:

  1. Go to Admin > Settings > GitLab Duo
  2. Select Never on and Click Save changes.
  3. Validate that Never on has been saved.
  4. Go to a User's personal Project. Ex: Go to Homepage by clicking the Tanuki Icon in the upper left hand corner. Click a personal project from the Personal projects tab and select a project.
  5. Go to the project's Settings, validate the page loads correctly.
  6. Go to Visibility, project features, permissions and validate that the GitLab Duo toggle is disabled with a cascading checkbox.

For backend changes:

  1. Run bundle exec rspec spec/helpers/namespaces_helper_spec.rb

Merge request reports

Loading