lib/dri/report.rb in dri-0.3.1 vs lib/dri/report.rb in dri-0.4.0

- old
+ new

@@ -28,11 +28,11 @@ labels = failure["labels"] created_at = failure["created_at"] assignees = failure["assignees"] description = failure["description"] - related_mrs = @api_client.fetch_related_mrs(issue_iid: iid) + related_mrs = @api_client.fetch_related_mrs(iid) emoji = classify_failure_emoji(created_at) emojified_link = "#{emoji} #{link}" stack_blob = if description.empty? "No stack trace found" @@ -69,11 +69,11 @@ 'staging-ref' => '/quality/staging-ref', 'staging.gitlab.com' => '/quality/staging', 'release' => '/quality/release' } - failure_notes = @api_client.fetch_failure_notes(issue_iid: iid) + failure_notes = @api_client.fetch_failure_notes(iid) return if pipelines.empty? pipelines.each do |pipeline| next unless label_pipeline_map.has_key?(pipeline) @@ -81,14 +81,14 @@ pipeline_in_notes_found = false pipeline_link = '' pipeline_markdown = pipeline.gsub(/.gitlab.com/, '') failure_notes.each do |note| - next unless note["body"].include?(label_pipeline_map.fetch(pipeline)) + next unless note.body.include?(label_pipeline_map.fetch(pipeline)) pipeline_in_notes_found = true - pipeline_link = URI.extract(note["body"], %w[https]) + pipeline_link = URI.extract(note.body, %w[https]) end unless pipeline_in_notes_found links_description = URI.extract(description, %w[https]) pipeline_link = links_description.select { |link| link.include? label_pipeline_map.fetch(pipeline) } @@ -191,9 +191,9 @@ def format_title(title) path, desc = title.split('|') path = "Failure in `#{path.strip}`" if path.delete_prefix!('Failure in ') path = path.strip.gsub(' ', ' ') if desc - "#{path} | #{desc}" + [path, desc].compact.join(' | ') end end end