Skip to content
代码片段 群组 项目
未验证 提交 a03b9bcf 编辑于 作者: Tetiana Chupryna's avatar Tetiana Chupryna 提交者: GitLab
浏览文件

Add feature flag for removing CI tool

上级 2febd87f
No related branches found
No related tags found
无相关合并请求
---
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% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册