[Qa-jenkins-scm] [jenkins.debian.net] 01/03: reproducible debian: do not store the scheduling message anymore

Mattia Rizzolo mattia at debian.org
Sat Apr 7 20:49:19 UTC 2018


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository jenkins.debian.net.

commit fbe16ad812306e5ab843d4bb0bde6a4afd783576
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Sat Apr 7 22:45:03 2018 +0200

    reproducible debian: do not store the scheduling message anymore
    
    It proved to be unneeded, and furthermore the scheduling script had not
    been storing the message since years, as it proved to be a vector for
    SQL injection…  (right now with sqlalchemy woulnd't be anymore, but
    still).
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 TODO                               | 1 -
 bin/reproducible_build.sh          | 5 ++---
 bin/reproducible_db_maintenance.py | 4 ++++
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/TODO b/TODO
index 3345f9f..3325f28 100644
--- a/TODO
+++ b/TODO
@@ -153,7 +153,6 @@ See link:https://jenkins.debian.net/userContent/about.html["about jenkins.debian
 *** replace bin/reproducible_installed_on_debian.org with a proper data provider from DSA, eg https://anonscm.debian.org/git/mirror/debian.org.git/plain/debian/control
 ** a reproducible_log_grep_by_sql.(py|sh) would be nice, to only grep in packages with a certain status (build in the last X days)
 ** database issues
-*** remove the rescheduling reason from the DB, that's really not needed
 *** stats_build table should have package ids, not just src+suite+arch as primary key
 *** move "untested" field in stats table too? (as in csv output...)
 *** new status: "timeout" - for when packages fail to build due to the max build time timeout
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index aec15b7..04dac1d 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -157,8 +157,8 @@ 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')"
 	fi
 	if [ ! -z "$DURATION" ] ; then  # this happens when not 404 and not_for_us
-		query_db "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration, node1, node2, job, schedule_message) VALUES ('$SRCPACKAGE', '$VERSION', '$SUITE', '$ARCH', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB', '$SCHEDULE_MESSAGE')" || \
-		query_db "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration, node1, node2, job, schedule_message) VALUES ('$SRCPACKAGE', '$VERSION', '$SUITE', '$ARCH', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB', '$SCHEDULE_MESSAGE')"
+		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
 	# unmark build since it's properly finished
 	query_db "DELETE FROM schedule WHERE package_id='$SRCPKGID';" || \
@@ -450,7 +450,6 @@ choose_package() {
 	SAVE_ARTIFACTS=$(echo $RESULT|cut -d "|" -f5)
 	NOTIFY=$(echo $RESULT|cut -d "|" -f6)
 	NOTIFY_MAINTAINER=$(echo $RESULT|cut -d "|" -f7)
-	SCHEDULE_MESSAGE=$(echo $RESULT|cut -d "|" -f8)
 	# remove previous build attempts which didnt finish correctly:
 	JOB_PREFIX="${JOB_NAME#reproducible_builder_}/"
 	BAD_BUILDS=$(mktemp --tmpdir=$TMPDIR)
diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py
index 61b9374..e4739d9 100755
--- a/bin/reproducible_db_maintenance.py
+++ b/bin/reproducible_db_maintenance.py
@@ -627,6 +627,10 @@ schema_updates = {
                     AND b.architecture=sr.architecture""",
         "INSERT INTO rb_schema (version, date) VALUES (32, '" + now + "')"
     ],
+    33: [ # the message columns.  They are not actually needed.
+        "ALTER TABLE schedule DROP COLUMN message",
+        "ALTER TABLE stats_build DROP COLUMN schedule_message",
+        "INSERT INTO rb_schema (version, date) VALUES (33, '" + now + "')"],
 }
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list