Commit ca3416d7 authored by Mattia Rizzolo's avatar Mattia Rizzolo

reproducible: rename status '404' to 'E404' to make a future planned change easier

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent ccc94fcf
......@@ -57,7 +57,7 @@ def get_status_icon(status):
table = {'reproducible': 'weather-clear.png',
'FTBFS': 'weather-storm.png',
'FTBR': 'weather-showers-scattered.png',
'404': 'weather-severe-alert.png',
'E404': 'weather-severe-alert.png',
'depwait': 'weather-snow.png',
'NFU': 'weather-few-clouds-night.png',
'untested': 'weather-clear-night.png',
......
......@@ -141,7 +141,7 @@ update_db_and_html() {
fi
if [ "$OLD_STATUS" != "$STATUS" ] && [ "$NOTIFY_MAINTAINER" -eq 1 ] && \
[ "$OLD_STATUS" != "depwait" ] && [ "$STATUS" != "depwait" ] && \
[ "$OLD_STATUS" != "404" ] && [ "$STATUS" != "404" ]; then
[ "$OLD_STATUS" != "E404" ] && [ "$STATUS" != "E404" ]; then
# spool notifications and mail them once a day
mkdir -p /srv/reproducible-results/notification-emails
echo "$(date -u +'%Y-%m-%d %H:%M') $DEBIAN_URL/$SUITE/$ARCH/$SRCPACKAGE changed from $OLD_STATUS -> $STATUS" >> /srv/reproducible-results/notification-emails/$SRCPACKAGE
......@@ -156,7 +156,7 @@ update_db_and_html() {
query_db "INSERT INTO results (package_id, version, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPKGID', '$VERSION', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')" || \
query_db "INSERT INTO results (package_id, version, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPKGID', '$VERSION', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')"
fi
if [ ! -z "$DURATION" ] ; then # this happens when not 404 and NFU
if [ ! -z "$DURATION" ] ; then # this happens when not E404 and NFU
query_db "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPACKAGE', '$VERSION', '$SUITE', '$ARCH', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')" || \
query_db "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPACKAGE', '$VERSION', '$SUITE', '$ARCH', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')"
fi
......@@ -203,13 +203,13 @@ diff_copy_buildlogs() {
fi
}
handle_404() {
handle_E404() {
log_warning "Download of ${SRCPACKAGE} sources from ${SUITE} failed."
ls -l ${SRCPACKAGE}* | log_file -
log_warning "Maybe there was a network problem, or ${SRCPACKAGE} is not a source package in ${SUITE}, or it was removed or renamed. Please investigate. Sleeping 30m as this should not happen."
DURATION=0
update_rbuildlog
update_db_and_html "404"
update_db_and_html "E404"
if [ $SAVE_ARTIFACTS -eq 1 ] ; then SAVE_ARTIFACTS=0 ; fi
if [ ! -z "$NOTIFY" ] ; then NOTIFY="failure" ; fi
sleep 30m
......@@ -550,9 +550,9 @@ get_source_package() {
download_again_if_needed # yes, this is called three times. this should really not happen
if [ "$(ls ${SRCPACKAGE}_${EVERSION}.dsc 2> /dev/null)" = "" ] || [ ! -z "$PARSED_RESULT" ] ; then
if [ "$MODE" = "master" ] ; then
handle_404
handle_E404
else
exit 404
exit E404
fi
fi
}
......@@ -739,7 +739,7 @@ remote_build() {
RESULT=$?
# 404-256=148... (ssh 'really' only 'supports' exit codes below 255...)
if [ $RESULT -eq 148 ] ; then
handle_404
handle_E404
elif [ $RESULT -eq 100 ] ; then
log_error "Version mismatch between main node and build $BUILDNR, aborting. Please upgrade the schroots..."
# reschedule the package for later and quit the build without saving anything
......
......@@ -147,7 +147,7 @@ set_icon() {
;;
depwait) ICON=weather-snow.png
;;
404) ICON=weather-severe-alert.png
E404) ICON=weather-severe-alert.png
;;
NFU|not_for_us|"not for us") ICON=weather-few-clouds-night.png
STATE_TARGET_NAME="NFU"
......
......@@ -649,6 +649,11 @@ schema_updates = {
"RENAME COLUMN oldest_unreproducible to oldest_FTBR",
"INSERT INTO rb_schema (version, date) VALUES (35, CURRENT_TIMESTAMP)",
],
36: [ # rename status "404" to "E404"
"UPDATE results SET status='E404' WHERE status='404'",
"UPDATE stats_build SET status='E404' WHERE status='404'",
"INSERT INTO rb_schema (version, date) VALUES (36, CURRENT_TIMESTAMP)",
],
}
......
......@@ -110,7 +110,7 @@ def lack_buildinfo():
query = '''SELECT s.name, r.version, s.suite, s.architecture
FROM sources AS s JOIN results AS r ON r.package_id=s.id
WHERE r.status NOT IN
('blacklisted', 'NFU', 'FTBFS', 'depwait', '404', '')
('blacklisted', 'NFU', 'FTBFS', 'depwait', 'E404', '')
ORDER BY s.name ASC, s.suite DESC, s.architecture ASC'''
results = query_db(query)
for pkg, version, suite, arch in results:
......
......@@ -194,7 +194,7 @@ gather_suite_arch_stats() {
COUNT_GOOD=$(query_db "SELECT COUNT(*) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status='reproducible'")
COUNT_BAD=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'FTBR'")
COUNT_UGLY=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'FTBFS'")
COUNT_SOURCELESS=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = '404'")
COUNT_SOURCELESS=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'E404'")
COUNT_NOTFORUS=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'NFU'")
COUNT_BLACKLISTED=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'blacklisted'")
COUNT_DEPWAIT=$(query_db "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND r.status = 'depwait'")
......@@ -472,7 +472,7 @@ create_suite_arch_stats_page() {
write_page "$COUNT_DEPWAIT ($PERCENT_DEPWAIT%) source packages had build-depends which could not be satisfied.<br />"
fi
if [ $COUNT_SOURCELESS -gt 0 ] ; then
set_icon 404
set_icon E404
write_icon
write_page "$COUNT_SOURCELESS ($PERCENT_SOURCELESS%) source packages could not be downloaded.<br />"
fi
......
......@@ -235,15 +235,15 @@ queries = {
).order_by(
desc(results.c.build_date)
),
"404_all":
"E404_all":
select_sources.where(
results.c.status == '404',
results.c.status == 'E404',
).order_by(
desc(results.c.build_date)
),
"404_all_abc":
"E404_all_abc":
select_sources.where(
results.c.status == '404',
results.c.status == 'E404',
).order_by(
sources.c.name
),
......@@ -368,8 +368,8 @@ pages = {
'title': 'Packages in {suite}/{arch} where the sources failed to download',
'body': [
{
'icon_status': '404',
'query': '404_all',
'icon_status': 'E404',
'query': 'E404_all',
'text': Template('$tot ($percent%) packages where the sources failed to download in $suite/$arch:')
}
]
......@@ -426,9 +426,9 @@ pages = {
'text': Template('$tot ($percent%) packages which should not be build in $suite/$arch:')
},
{
'icon_status': '404',
'icon_status': 'E404',
'icon_link': '/index_404.html',
'query': '404_all_abc',
'query': 'E404_all_abc',
'text': Template('$tot ($percent%) source packages could not be downloaded in $suite/$arch:')
},
{
......
......@@ -244,7 +244,7 @@ def create_pkgset_page_and_graphs(suite, arch, stats, pkgset_name):
for (status, cutename, description) in status_cutename_descriptions:
icon_html = ''
if status == 'rest':
for s in ['depwait', 'blacklisted', 'NFU', '404']:
for s in ['depwait', 'blacklisted', 'NFU', 'E404']:
s, icon, spokenstatus = get_status_icon(s)
icon_html += gen_status_link_icon(s, None, icon, suite, arch)
else:
......
......@@ -34,7 +34,7 @@ log.info('Creating json dump of current reproducible status')
# filter_query is defined in reproducible_common.py and excludes some FTBFS issues
query = "SELECT s.name, r.version, s.suite, s.architecture, r.status, r.build_date " + \
"FROM results AS r JOIN sources AS s ON r.package_id = s.id "+ \
"WHERE status != '' AND status NOT IN ('NFU', '404', 'blacklisted' ) AND (( status != 'FTBFS' ) OR " \
"WHERE status != '' AND status NOT IN ('NFU', 'E404', 'blacklisted' ) AND (( status != 'FTBFS' ) OR " \
" ( status = 'FTBFS' and r.package_id NOT IN (SELECT n.package_id FROM NOTES AS n WHERE " + filter_query + " )))"
result = sorted(query_db(query))
......
......@@ -64,7 +64,7 @@ else:
So, the 3rd step happens only when there are more than 350 packages queued up.
LIMITS_404 defines how many packages with status 404 are rescheduled at max.
LIMITS_E404 defines how many packages with status E404 are rescheduled at max.
"""
# only old packages older than this will be rescheduled
......@@ -204,8 +204,8 @@ LIMITS = {
}
}
}
# maximum amount of packages with status 404 which will be rescheduled
LIMIT_404 = 255
# maximum amount of packages with status E404 which will be rescheduled
LIMIT_E404 = 255
class Limit:
......@@ -540,14 +540,14 @@ def query_old_versions(suite, arch, limit):
print_schedule_result(suite, arch, criteria, packages)
return packages
def query_404_versions(suite, arch, limit):
criteria = """tested at least 12h ago, status 404,
def query_e404_versions(suite, arch, limit):
criteria = """tested at least 12h ago, status E404,
sorted by last build date"""
date = (datetime.now()-timedelta(days=0.5)).strftime('%Y-%m-%d %H:%M')
query = """SELECT s.id, s.name, max(r.build_date) max_date
FROM sources AS s JOIN results AS r ON s.id = r.package_id
WHERE s.suite='{suite}' AND s.architecture='{arch}'
AND r.status = '404'
AND r.status = 'E404'
AND r.build_date < '{date}'
AND s.id NOT IN (SELECT schedule.package_id FROM schedule)
GROUP BY s.id, s.name
......@@ -657,18 +657,18 @@ def schedule_old_versions(arch, total):
msg = ''
return packages, msg
def schedule_404_versions(arch, total):
def schedule_e404_versions(arch, total):
packages = {}
for suite in SUITES:
log.info('Requesting 404 packages in %s/%s...',
log.info('Requesting E404 packages in %s/%s...',
suite, arch)
packages[suite] = query_404_versions(suite, arch, LIMIT_404)
packages[suite] = query_e404_versions(suite, arch, LIMIT_E404)
log.info('Received ' + str(len(packages[suite])) +
' 404 packages in ' + suite + '/' + arch + ' to schedule.')
' E404 packages in ' + suite + '/' + arch + ' to schedule.')
log.info('--------------------------------------------------------------')
msg = add_up_numbers(packages, arch)
if msg != '0':
msg += ' with status \'404\''
msg += ' with status \'E404\''
else:
msg = ''
return packages, msg
......@@ -692,7 +692,7 @@ def scheduler(arch):
old_ftbfs, msg_old_ftbfs = empty_pkgs, ''
old_depwait, msg_old_depwait = empty_pkgs, ''
old, msg_old = empty_pkgs, ''
four04, msg_404 = empty_pkgs, ''
four04, msg_e404 = empty_pkgs, ''
else:
log.info(str(total) + ' packages already scheduled' +
', scheduling some more...')
......@@ -700,7 +700,7 @@ def scheduler(arch):
new, msg_new = schedule_new_versions(arch, total+len(untested))
old_ftbfs, msg_old_ftbfs = schedule_old_ftbfs_versions(arch, total+len(untested)+len(new))
old_depwait, msg_old_depwait = schedule_old_depwait_versions(arch, total+len(untested)+len(new)+len(old_ftbfs))
four04, msg_404 = schedule_404_versions(arch, total+len(untested)+len(new)+len(old_ftbfs)+len(old_depwait))
four04, msg_e404 = schedule_e404_versions(arch, total+len(untested)+len(new)+len(old_ftbfs)+len(old_depwait))
old, msg_old = schedule_old_versions(arch, total+len(untested)+len(new)+len(old_ftbfs)+len(old_depwait)+len(four04))
now_queued_here = {}
......@@ -734,8 +734,8 @@ def scheduler(arch):
message += msg_untested + ', '
if msg_new:
message += msg_new + ', '
if msg_404:
message += msg_404 + ', '
if msg_e404:
message += msg_e404 + ', '
if msg_old_ftbfs:
message += msg_old_ftbfs + ', '
if msg_old_depwait:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment