From faa2d0ae563db058cb5dab281317f9d01b263189 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 10 Aug 2023 17:48:01 +0200 Subject: [PATCH] [ci] Stop uploading regression tester record to chunk.io --- Dangerfile | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/Dangerfile b/Dangerfile index beb059fd46..1d608f200e 100644 --- a/Dangerfile +++ b/Dangerfile @@ -51,18 +51,16 @@ def run_pmdtester message2 = create_message end - report_url = upload_report + tar_report - if report_url - message1 += "[Full report](#{report_url}/diff1/index.html)" + message1 += "[Download full report as build artifact](#{ENV['PMD_CI_JOB_URL']}" + # set value of sticky to true and the message is kept after new commits are submitted to the PR + message(message1, sticky: true) + + if message2 + message2 += "[Download full report as build artifact](#{ENV['PMD_CI_JOB_URL']}" # set value of sticky to true and the message is kept after new commits are submitted to the PR - message(message1, sticky: true) - - if message2 - message2 += "[Full report](#{report_url}/diff2/index.html)" - # set value of sticky to true and the message is kept after new commits are submitted to the PR - message(message2, sticky: true) - end + message(message2, sticky: true) end rescue StandardError => e @@ -84,23 +82,13 @@ def create_message "#{@summary[:configerrors][:removed]} configuration errors.\n" end -def upload_report +def tar_report Dir.chdir('target') do tar_filename = "pr-#{ENV['PMD_CI_PULL_REQUEST_NUMBER']}-diff-report-#{Time.now.strftime("%Y-%m-%dT%H-%M-%SZ")}.tar.gz" `tar czf #{tar_filename} diff1/ diff2/` tar_size = (10 * File.size(tar_filename) / 1024 / 1024)/10.0 - @logger.info "Uploading file #{tar_filename} (#{tar_size}mb) now..." - report_url = `curl -u #{ENV['PMD_CI_CHUNK_TOKEN']} -T #{tar_filename} https://chunk.io` - if $?.success? - report_url.chomp! - @logger.info "Successfully uploaded #{tar_filename} to #{report_url}" - report_url - else - @logger.error "Error while uploading #{tar_filename} to chunk.io: #{report_url}" - warn("Uploading the diff report failed, this message is mainly used to remind the maintainers of PMD.") - nil - end + @logger.info "Created file #{tar_filename} (#{tar_size}mb)" end end