Skip to content

Introduce one-line rake task to setup GitLab Duo Chat

Shinya Maeda requested to merge dex-improvement-gitlab-duo-chat into master

What does this MR do and why?

This MR introduces a new rake task that enables GitLab Duo features (except Code Suggestions) on local GitLab development instance.

It basically replaces $2554994 which is a private snippet that easily get outdated.

Usage example:

RAILS_ENV=development bundle exec rake gitlab:duo:setup['duo-test']

Also, We add rspec-ee unit gitlab-duo pg14 test job to makes sure that the settings changes are up-to-date. For example, if a feature flag is renamed, we can detect in advance.

Screenshots or screen recordings

  1. Make sure GDK is running.
  2. Go to gitlab directory (GitLab-Rails).
  3. Execute RAILS_ENV=development bundle exec rake gitlab:duo:setup['duo-test']

Example:

shinya@shinya-XPS-15-9530:~/gitlab-development-kit/gitlab$ RAILS_ENV=development bundle exec rake gitlab:duo:setup['duo-test-sm']
Validating settings....
Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a "quota exceeded" or "API not enabled" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/. To suppress this message, set the GOOGLE_AUTH_SUPPRESS_CREDENTIALS_WARNINGS environment variable.
Enabling feature flags....
Enabling application settings....
Checking the specified group exists....
The specified group is not found. Creating a new one...
Activating an Ultimate license to the group....
Enabling the group settings....
Embeddings of GitLab Documentations already exist. Skipping....
----------------------------------------
Setup Complete!
----------------------------------------

Visit "http://gdk.test:3000/duo-test-sm" for testing GitLab Duo features.

All GitLab Duo features except Code Suggestions should be available under the root group.
To setup Code Suggestions, see https://docs.gitlab.com/ee/development/code_suggestions/.

For more development guidelines, see https://docs.gitlab.com/ee/development/ai_features/index.html.

Testing GitLab Duo Chat in UI:

2023-11-24_13-48

How to set up and validate locally

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

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related

Edited by Shinya Maeda

Merge request reports