Skip to content
Snippets Groups Projects
Verified Commit c5eae9cd authored by Rodrigo Tomonari's avatar Rodrigo Tomonari :two: Committed by GitLab
Browse files

Merge branch 'ff-ci_editor_tool_removed' into 'master'

Add feature flag for removing CI tool

See merge request !171017



Merged-by: default avatarRodrigo Tomonari <rtomonari@gitlab.com>
Approved-by: default avatarEva Kadlecová <ekadlecova@gitlab.com>
Approved-by: default avatarRodrigo Tomonari <rtomonari@gitlab.com>
Co-authored-by: default avatarTetiana Chupryna <tchupryna@gitlab.com>
parents fe2952ba a03b9bcf
No related branches found
No related tags found
2 merge requests!171309Draft: Fetch issues / MRs / epics count in the sidebar with GraphQL,!171017Add feature flag for removing CI tool
Pipeline #1523336525 passed
---
name: ci_editor_tool_removed
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/495684
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/171017
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/501273
milestone: '17.6'
group: group::duo chat
type: gitlab_com_derisk
default_enabled: false
......@@ -178,6 +178,10 @@ def push_feature_flags
Gitlab::AiGateway.push_feature_flag(:ai_commit_reader_for_chat, user)
Gitlab::AiGateway.push_feature_flag(:expanded_ai_logging, user)
Gitlab::AiGateway.push_feature_flag(:ai_build_reader_for_chat, user)
return unless Feature.enabled?(:ci_editor_tool_removed, user)
Gitlab::AiGateway.push_feature_flag(:ci_editor_tool_removed, user)
end
end
end
......
......@@ -218,6 +218,10 @@
stub_saas_features(duo_chat_categorize_question: true)
stub_feature_flags(ai_commit_reader_for_chat: false)
stub_feature_flags(ai_build_reader_for_chat: false)
# This flag is used only on AI Gateway and we need to stub it to
# prevent Rubocop from marking this flag as unused
# and raising an error
stub_feature_flags(ci_editor_tool_removed: false)
end
context 'when resource is an issue' do
......@@ -338,6 +342,25 @@
end
end
context 'with ci editor toll disabled' do
before do
stub_feature_flags(ci_editor_tool_removed: true)
allow(ai_request).to receive(:request)
allow(::Gitlab::AiGateway).to receive(:push_feature_flag)
end
it 'pushes feature flag to AI Gateway' do
allow_next_instance_of(::Gitlab::Duo::Chat::ReactExecutor) do |instance|
allow(instance).to receive(:execute).and_return(answer)
end
expect(::Gitlab::AiGateway).to receive(:push_feature_flag)
.with(:ci_editor_tool_removed, user).and_return(:ci_editor_tool_removed)
subject
end
end
context 'when message is a slash command' do
shared_examples_for 'slash command execution' do
let(:executor) { instance_double(Gitlab::Llm::Chain::Tools::ExplainCode::Executor) }
......
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