Skip to content
Snippets Groups Projects
Commit 604fd939 authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖
Browse files

Automatic merge of gitlab-org/gitlab master

parents e8fbdb77 e3d3aea2
No related branches found
No related tags found
1 merge request!170053Security patch upgrade alert: Only expose to admins 17-4
Showing
with 27 additions and 15 deletions
......@@ -130,7 +130,11 @@ def wiki_markup_hash_by_name_id
private
def wiki_page_render_api_endpoint_params(page)
{ id: page.container.id, slug: ERB::Util.url_encode(page.slug), params: { version: page.version.id } }
{
id: page.container.id,
slug: ERB::Util.url_encode(page.slug).gsub(/%2f/i, '/'),
params: { version: page.version.id }
}
end
def wiki_page_info(page, uploads_path: '')
......
......@@ -65,6 +65,11 @@ To restrict project deletion to only administrators:
- (GitLab 15.0 and earlier) **Default project deletion protection**, and select **Only admins can delete project**.
1. Select **Save changes**.
To disable the restriction:
1. Select **Owners and administators**.
1. Select **Save changes**.
## Deletion protection
DETAILS:
......
......@@ -156,6 +156,7 @@ After you delete a project:
Prerequisites:
- You must have the Owner role for a project.
- Owners must be [allowed to delete projects](../../administration/settings/visibility_and_access_controls.md#restrict-project-deletion-to-administrators).
To delete a project:
......
......@@ -118,7 +118,7 @@ def perform_agent_request(params)
end
if response.success?
log_conditional_info(user,
log_info(
message: "Finished streaming from v2/chat/agent", event_name: 'streaming_finished',
ai_component: 'duo_chat')
return
......
......@@ -45,7 +45,6 @@ def request(prompt, unit_primitive: nil)
log_conditional_info(user,
message: "Made request to AI Client",
klass: self.class.to_s,
event_name: 'response_received',
ai_component: 'duo_chat',
prompt: prompt[:prompt],
......
......@@ -60,10 +60,6 @@ def get_completions_ai_gateway(search_documents)
prompt: final_prompt[:prompt],
response_from_llm: final_prompt_result)
log_info(message: "Got Final Result for documentation question",
event_name: 'response_received',
ai_component: 'duo_chat')
Gitlab::Llm::Anthropic::ResponseModifiers::TanukiBot.new(
{ completion: final_prompt_result }.to_json,
current_user,
......
......@@ -29,7 +29,6 @@ def perform(&_block)
# We can't reuse the injected client here but need to call TanukiBot as it uses the
# embedding database and calls the VertexAI text embeddings API endpoint internally.
log_info(message: "Calling TanukiBot",
klass: self.class.to_s,
event_name: 'documentation_question_initial_request',
ai_component: 'duo_chat')
streamed_answer = StreamedDocumentationAnswer.new
......
......@@ -28,7 +28,6 @@ def perform(&_block)
unless authorizer.allowed?
log_error(message: "Error finding #{resource_name}",
klass: self.class.to_s,
event_name: 'incorrect_response_received',
ai_component: 'duo_chat',
error_message: authorizer.message)
......@@ -44,7 +43,7 @@ def perform(&_block)
message: "Answer received from LLM",
event_name: 'response_received',
ai_component: 'duo_chat',
content_of_response: content)
response_from_llm: content)
return Answer.new(status: :ok, context: context, content: content, tool: nil)
rescue JSON::ParserError
......
......@@ -84,7 +84,6 @@ def perform(&)
log_conditional_info(context.current_user,
message: "Answer content for summarize_comments",
klass: self.class.to_s,
event_name: 'response_received',
ai_component: 'feature',
response_from_llm: content)
......
......@@ -54,7 +54,6 @@ def run_retry_with_exponential_backoff
delay *= EXPONENTIAL_BASE * (1 + Random.rand)
log_info(message: "Too many requests, will retry in #{delay} seconds",
klass: self.class.to_s,
event_name: 'retrying_request',
ai_component: 'abstraction_layer')
......
......@@ -33,6 +33,11 @@ def debug(message:, klass:, event_name:, ai_component:, **options)
options.merge!(message: message, class: klass, ai_event_name: event_name, ai_component: ai_component)
super(options)
end
def warn(message:, klass:, event_name:, ai_component:, **options)
options.merge!(message: message, class: klass, ai_event_name: event_name, ai_component: ai_component)
super(options)
end
end
end
end
......@@ -62,7 +62,7 @@ class Wikis < ::API::Base
optional :version, type: String, desc: 'The version hash of a wiki page'
optional :render_html, type: Boolean, default: false, desc: 'Render content to HTML'
end
get ':id/wikis/:slug', urgency: :low do
get ':id/wikis/:slug', requirements: { slug: /.+/ }, urgency: :low do
authorize! :read_wiki, container
options = {
......@@ -122,7 +122,7 @@ class Wikis < ::API::Base
use :common_wiki_page_params
at_least_one_of :content, :title, :format
end
put ':id/wikis/:slug' do
put ':id/wikis/:slug', requirements: { slug: /.+/ } do
authorize! :create_wiki, container
response = WikiPages::UpdateService
......@@ -148,7 +148,7 @@ class Wikis < ::API::Base
params do
requires :slug, type: String, desc: 'The slug of a wiki page'
end
delete ':id/wikis/:slug' do
delete ':id/wikis/:slug', requirements: { slug: /.+/ } do
authorize! :admin_wiki, container
response = WikiPages::DestroyService
......
......@@ -139,4 +139,10 @@ def expected_link_args(direction, icon_class)
it_behaves_like 'wiki endpoint helpers' do
let_it_be(:page) { create(:wiki_page) }
end
context 'for wiki subpages' do
it_behaves_like 'wiki endpoint helpers' do
let_it_be(:page) { create(:wiki_page, title: 'foo/bar') }
end
end
end
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