[ci] Stop uploading regression tester record to chunk.io

This commit is contained in:
Andreas Dangel 2023-08-10 17:48:01 +02:00
parent 2b0cadf0ed
commit faa2d0ae56
No known key found for this signature in database
GPG Key ID: 93450DF2DF9A3FA3

View File

@ -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