Skip to content
Snippets Groups Projects
Verified Commit 016ba09b authored by Missy Davies's avatar Missy Davies :speech_balloon: Committed by GitLab
Browse files

Rename code suggestions ops flag

parent 37ce7689
No related branches found
No related tags found
1 merge request!147615Rename code suggestions ops flag
---
name: code_suggestions_tokens_api
name: ai_duo_code_suggestions_switch
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120892
rollout_issue_url:
milestone: '16.1'
......
......@@ -30,10 +30,10 @@ This should enable everyone to see locally any change in an IDE being sent to th
1. You will see completion request URLs being fetched that match the Git remote URL for your GDK.
1. Main Application (GDK):
1. Install the [GitLab Development Kit](https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/index.md#one-line-installation).
1. Enable Feature Flag ```code_suggestions_tokens_api```:
1. Enable Feature Flag ```ai_duo_code_suggestions_switch```:
1. In your terminal, go to your `gitlab-development-kit` > `gitlab` directory.
1. Run `gdk rails console` or `bundle exec rails c` to start a Rails console.
1. [Enable the Feature Flag](../../administration/feature_flags.md#enable-or-disable-the-feature) for the code suggestions tokens API by calling `Feature.enable(:code_suggestions_tokens_api)` from the console.
1. [Enable the Feature Flag](../../administration/feature_flags.md#enable-or-disable-the-feature) for the code suggestions tokens API by calling `Feature.enable(:ai_duo_code_suggestions_switch)` from the console.
1. Set the AI Gateway URL environmental variable by running `export AI_GATEWAY_URL=http://localhost:5052`.
1. Run your GDK server with `gdk start` if it's not already running.
1. [Setup AI Gateway](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist):
......
......@@ -8,7 +8,7 @@ class CodeSuggestionsAccessResolver < BaseResolver
def resolve
return false unless current_user
Feature.enabled?(:code_suggestions_tokens_api, type: :ops) && current_user.duo_pro_add_on_available?
Feature.enabled?(:ai_duo_code_suggestions_switch, type: :ops) && current_user.duo_pro_add_on_available?
end
end
end
......
......@@ -19,7 +19,7 @@ class CodeSuggestions < ::API::Base
before do
authenticate!
not_found! unless Feature.enabled?(:code_suggestions_tokens_api, type: :ops)
not_found! unless Feature.enabled?(:ai_duo_code_suggestions_switch, type: :ops)
unauthorized! unless current_user.can?(:access_code_suggestions)
end
......
......@@ -93,7 +93,7 @@
let(:access_token) { tokens[:api] }
before do
stub_feature_flags(code_suggestions_tokens_api: true)
stub_feature_flags(ai_duo_code_suggestions_switch: true)
headers["Authorization"] = "Bearer #{access_token.token}"
post_api
......
......@@ -60,7 +60,7 @@
context 'when feature flag is off' do
before do
stub_feature_flags(code_suggestions_tokens_api: false)
stub_feature_flags(ai_duo_code_suggestions_switch: false)
end
it 'returns false' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment