Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-11-16 21:07:32 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-16 21:07:32 +0300
commit6ba7c824e92d68c6ae25f64bda5ab213ad9c9a58 (patch)
tree72b28f0f5222162a67a1919ff25beff4c2cabc2d /scripts
parentacee9d6fb529ca8fb91b2b07bd49bd207df23c51 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/duo_chat/reporter.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/scripts/duo_chat/reporter.rb b/scripts/duo_chat/reporter.rb
index 686a49164a7..e72a393694f 100755
--- a/scripts/duo_chat/reporter.rb
+++ b/scripts/duo_chat/reporter.rb
@@ -5,7 +5,7 @@ require 'gitlab'
require 'json'
class Reporter
- IDENTIFIABLE_NOTE_TAG = 'gitlab-org/ai-powered/ai-framework:duo-chat-qa-evaluation-'
+ IDENTIFIABLE_NOTE_TAG = 'gitlab-org/ai-powered/ai-framework:duo-chat-qa-evaluation'
GRADE_TO_EMOJI_MAPPING = {
correct: ":white_check_mark:",
@@ -25,7 +25,7 @@ class Reporter
.merge_request_notes(ci_project_id, merge_request_iid)
.auto_paginate
.select do |note|
- note.body.include? note_identifier_tag
+ note.body.include? IDENTIFIABLE_NOTE_TAG
end
note = report_notes.max_by { |note| Time.parse(note.created_at) }
@@ -47,17 +47,13 @@ class Reporter
private
def report_filename
- "#{ENV['DUO_RSPEC']}.md"
+ ENV['QA_EVAL_REPORT_FILENAME']
end
def artifact_path
File.join(ENV['CI_PROJECT_DIR'], report_filename)
end
- def note_identifier_tag
- "#{IDENTIFIABLE_NOTE_TAG}#{ENV['DUO_RSPEC']}"
- end
-
def com_gitlab_client
@com_gitlab_client ||= Gitlab.client(
endpoint: "https://gitlab.com/api/v4",
@@ -67,7 +63,7 @@ class Reporter
def report_note
report = <<~MARKDOWN
- <!-- #{note_identifier_tag} -->
+ <!-- #{IDENTIFIABLE_NOTE_TAG} -->
## GitLab Duo Chat QA evaluation
@@ -105,7 +101,7 @@ class Reporter
if report.length > 1000000
return <<~MARKDOWN
- <!-- #{note_identifier_tag} -->
+ <!-- #{IDENTIFIABLE_NOTE_TAG} -->
## GitLab Duo Chat QA evaluation
@@ -125,7 +121,7 @@ class Reporter
def report_data
@report_data ||= Dir[File.join(ENV['CI_PROJECT_DIR'], "tmp/duo_chat/qa*.json")]
- .map { |file| JSON.parse(File.read(file)) }
+ .flat_map { |file| JSON.parse(File.read(file)) }
end
def eval_content