Skip to content

fix: hide Duo Chat features when disabled for a project

Splits !1613 (166ef57e) into a separate MR from these changes which replicate our existing JetBrains project disabled functionality pending further discussion of !1601 (comment 1918194013).


Original MR content below:

Description

Ensures that all Duo slash-command features are hidden when Duo is disabled for a given project.

Related Issues

issue: #1360 (closed)

How has this been tested?

  1. Create a personal project (e.g. https://gitlab.com/tristan.read/mock-token-server)
  2. Check out the project locally.
  3. Open graphql explorer: https://gitlab.com/-/graphql-explorer
  4. Disable AI features with the a mutation, e.g:
mutation toggle_duo {
  projectSettingsUpdate(input:{
      fullPath: "tristan.read/mock-token-server",
      duoFeaturesEnabled: true
    })
  {
    errors
    projectSettings {
      duoFeaturesEnabled
    }
  }
}
  1. Run the test extension host using the changes in this branch.
  2. Open the repo you created above in the test extension host.
  3. Select some code and look for the Duo actions in the dropdown, such as "Explain selected code" .

Expected Behavior: The action should not be present.

Optional extra: Test with a non-project workspace (aka not a git repository) and confirm AI actions appear there.

Screenshots (if appropriate)

before after
Screenshot_2024-05-23_at_21.08.55 Screenshot_2024-05-23_at_21.13.19

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes

Merge request reports