Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions utils/pr_commenter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ function get_message(res, org, new_org, old_commit, new_branch_name)
for r in res
if r.status != ControlExamplePlots.EXACT_MATCH
ndiff += 1
diff = (isdefined(r, :diff) && isa(r.diff, Number)) ? r.diff : 1.0
# An image that could not be loaded has status PROCESSING_ERROR and diff 1.0
has_diff = r.status != ControlExamplePlots.PROCESSING_ERROR && isdefined(r, :diff) && isa(r.diff, Number)
diff = has_diff ? r.diff : 1.0
# Symbol in front of number
symbol = ( diff < 0.015 ? good : (diff < 0.03 ? warning : error))
# Number/message we print
status = (isdefined(r, :diff) && isa(r.diff, Number)) ? round(r.diff, digits=3) : string(r.status)
status = has_diff ? round(r.diff, digits=3) : string(r.status)
# Name of file
fig_name = basename(r.refFilename)
# Append figure to message
Expand Down Expand Up @@ -156,7 +158,9 @@ try
println("adding packages")
Pkg.add("UUIDs")
Pkg.add("GitHub")
Pkg.add("ImageMagick") # Has no UUID
# FileIO loads PNG files with ImageIO when it is installed, otherwise with ImageMagick.
# ImageMagick_jll v7.1.2001 requires libgs.so.9, which Ghostscript_jll v10 does not provide.
Pkg.add("ImageIO")

println("running checkout_ControlSystems_PR")
checkout_ControlSystems_PR(org, origin, ENV["PR_ID"])
Expand All @@ -168,6 +172,9 @@ try
res, ndiff = gen_figures()

println("$ndiff images have changes")
for r in res
r.status == ControlExamplePlots.PROCESSING_ERROR && println("Failed to compare $(basename(r.refFilename)): ", r.err)
end
import UUIDs


Expand Down