summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-11-29 23:30:20 +0000
committerHolger Levsen <holger@layer-acht.org>2015-12-09 11:28:32 +0100
commit46ddc27f0bbdc0aa0c27541d63460214c4686498 (patch)
treeb0624a9e5e36c11438d6fcf285e3ee2fa6ab2001 /bin
parente8a1da03fee36b81a2fb75e3c564237e66931a5c (diff)
downloadjenkins.debian.net-46ddc27f0bbdc0aa0c27541d63460214c4686498.tar.xz
reproducible: refactor how the 'notify on build start' feature is handled, stop abusing of the builder column in the db for this
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_build.sh3
-rwxr-xr-xbin/reproducible_remote_scheduler.py22
2 files changed, 11 insertions, 14 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index e8256318..87dda59a 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -417,7 +417,6 @@ choose_package() {
SAVE_ARTIFACTS=$(echo $RESULT|cut -d "|" -f5)
NOTIFY=$(echo $RESULT|cut -d "|" -f6)
NOTIFY_MAINTAINER=$(echo $RESULT|cut -d "|" -f7)
- local DEBUG_URL=$(echo $RESULT|cut -d "|" -f8) # this is abuse (state-handling...) of the boulder column in the schedule table…
# remove previous build attempts which didnt finish correctly:
BUILDER_PREFIX="${JOB_NAME#reproducible_builder_}/"
BAD_BUILDS=$(mktemp --tmpdir=$TMPDIR)
@@ -464,7 +463,7 @@ choose_package() {
;;
*) ;;
esac
- if [ "$DEBUG_URL" = "TBD" ] ; then
+ if [ "$NOTIFY" = "2" ] ; then
irc_message "$SRCPACKAGE/$SUITE/$ARCH started building at ${BUILD_URL}console"
fi
echo "$(date -u ) - starting to build ${SRCPACKAGE}/${SUITE}/${ARCH} on $(hostname -f) on '$DATE'" | tee ${RBUILDLOG}
diff --git a/bin/reproducible_remote_scheduler.py b/bin/reproducible_remote_scheduler.py
index cf8a7479..39befb23 100755
--- a/bin/reproducible_remote_scheduler.py
+++ b/bin/reproducible_remote_scheduler.py
@@ -80,7 +80,7 @@ built_before = scheduling_args.before
packages = [x for x in scheduling_args.packages if x]
artifacts = scheduling_args.keep_artifacts
notify = scheduling_args.notify or scheduling_args.noisy
-debug_url = scheduling_args.noisy
+notify_on_start = scheduling_args.noisy
dry_run = scheduling_args.dry_run
log.debug('Requester: ' + requester)
@@ -89,7 +89,7 @@ log.debug('Local call: ' + str(local))
log.debug('Reason: ' + reason)
log.debug('Artifacts: ' + str(artifacts))
log.debug('Notify: ' + str(notify))
-log.debug('Debug url: ' + str(debug_url))
+log.debug('Debug url: ' + str(notify_on_start))
log.debug('Issue: ' + issue if issue else str(None))
log.debug('Status: ' + status if status else str(None))
log.debug('Date: after ' + built_after if built_after else str(None) +
@@ -151,7 +151,7 @@ if artifacts:
log.info('The artifacts of the build(s) will be saved to the location '
'mentioned at the end of the build log(s).')
-if debug_url:
+if notify_on_start:
log.info('The channel will be notified when the build starts')
ids = []
@@ -188,7 +188,7 @@ blablabla = '✂…' if len(' '.join(pkgs)) > 257 else ''
packages_txt = str(len(ids)) + ' packages ' if len(pkgs) > 1 else ''
trailing = ' - artifacts will be preserved' if artifacts else ''
trailing += ' - with irc notification' if notify else ''
-trailing += ' - notify on start too' if debug_url else ''
+trailing += ' - notify on start too' if notify_on_start else ''
message = requester + ' scheduled ' + packages_txt + \
'in ' + suite + '/' + arch
@@ -232,19 +232,17 @@ if amount + len(ids) > 200 and not local:
# do the actual scheduling
to_schedule = []
save_schedule = []
-notify = '' if not notify else notify
-debug_url = '' if not debug_url else 'TBD'
+notify = 1 if notify else 0
+notify = 2 if notify_on_start else 0
+artifacts_value = 1 if artifacts else 0
for id in ids:
- artifacts_value = 1 if artifacts else 0
- to_schedule.append((id, date, artifacts_value, str(notify).lower(),
- requester, debug_url))
+ to_schedule.append((id, date, artifacts_value, str(notify), requester))
save_schedule.append((id, requester, epoch))
log.debug('Packages about to be scheduled: ' + str(to_schedule))
query1 = '''REPLACE INTO schedule
- (package_id, date_scheduled, date_build_started, save_artifacts, notify,
- scheduler, builder)
- VALUES (?, ?, "", ?, ?, ?, ?)'''
+ (package_id, date_scheduled, save_artifacts, notify, scheduler)
+ VALUES (?, ?, ?, ?, ?)'''
query2 = '''INSERT INTO manual_scheduler
(package_id, requester, date_request) VALUES (?, ?, ?)'''