Skip to content
Commits on Source (3)
......@@ -41,6 +41,9 @@ def lazyproperty(fn):
return _lazy
_status = namedtuple('Status', 'name, spokenstatus, icon')
class Status(Enum):
"""
Values of the tuple:
......@@ -48,7 +51,6 @@ class Status(Enum):
spokenstatus: to be used in human-oriented strings
icon: file name of the icon representing the status
"""
_status = namedtuple('Status', 'name, spokenstatus, icon')
REPRODUCIBLE = _status('reproducible', 'reproducible', 'weather-clear.png')
FTBFS = _status('FTBFS', 'FTBFS', 'weather-storm.png')
FTBR = _status('FTBR', 'unreproducible', 'weather-showers-scattered.png')
......
......@@ -95,7 +95,8 @@ save_artifacts() {
# irc message
if [ ! -z "$NOTIFY" ] ; then
local MESSAGE="Artifacts for ${SRCPACKAGE}, $STATUS in ${SUITE}/${ARCH}: $URL"
if [ "$NOTIFY" = "diffoscope" ] ; then
if [ "$NOTIFY" = "diffoscope_err" ] ; then
irc_message debian-reproducible-changes "$DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE $STATUS and $DIFFOSCOPE failed"
irc_message debian-reproducible-changes "$MESSAGE (error running $DIFFOSCOPE)"
MESSAGE="$MESSAGE (error running $DIFFOSCOPE)"
else
......@@ -109,14 +110,11 @@ notification() {
if [ "$SAVE_ARTIFACTS" = "1" ] ; then
save_artifacts # this will also notify IRC as needed
else
case "$NOTIFY" in
case "$NOTIFY" in # the diffoscope_err case is handled by save_artifacts()
''|0) ;;
1|2)
irc_message debian-reproducible "$DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE done: $STATUS"
;;
diffoscope_err)
irc_message debian-reproducible-changes "$DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE $STATUS and $DIFFOSCOPE failed"
;;
diffoscope_timeout)
irc_message debian-reproducible-changes "$DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE $STATUS and $DIFFOSCOPE timed out"
;;
......
......@@ -314,17 +314,18 @@ def gen_html_issue(issue, suite):
)
try:
arch = 'amd64'
for status in ['FTBR', 'FTBFS', 'NFU', 'blacklisted', 'reproducible', 'depwait']:
for status in Status:
status = status.value
pkgs = query_db(sql.where(sources.c.name.in_(issues_count[issue]))\
.params({'suite': suite, 'arch': arch, 'status': status}))
.params({'suite': suite, 'arch': arch, 'status': status.name}))
pkgs = [p[0] for p in pkgs]
if not pkgs:
continue
affected += tab*4 + '<p>\n'
icon = Status.get(status).value.icon
affected += tab*5 + '<img src="/static/{}"'.format(icon)
affected += ' alt="' + status + ' icon" />\n'
affected += tab*5 + str(len(pkgs)) + ' ' + status + ' packages in ' + suite + '/' + arch +':\n'
affected += tab*5 + '<img src="/static/{}"'.format(status.icon)
affected += ' alt="' + status.name + ' icon" />\n'
affected += tab*5 + str(len(pkgs)) + ' ' + status.spokenstatus
affected += ' packages in ' + suite + '/' + arch +':\n'
affected += tab*5 + '<code>\n'
pkgs_popcon = issues_popcon_annotate(pkgs)
try:
......