[Qa-jenkins-scm] [jenkins.debian.net] 03/07: reproducible: rescheduler: add -t/--after and -b/--before options to select packages built before/after the specified date

Holger Levsen holger at moszumanska.debian.org
Sun Jul 5 13:12:15 UTC 2015


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

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

commit 5d4a6d8dc1f82f0f39297ca827dbdd85c299aa03
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Sun Jun 21 14:40:44 2015 +0000

    reproducible: rescheduler: add -t/--after and -b/--before options to select packages built before/after the specified date
---
 bin/reproducible_remote_scheduler.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/bin/reproducible_remote_scheduler.py b/bin/reproducible_remote_scheduler.py
index 2086e85..79b6054 100755
--- a/bin/reproducible_remote_scheduler.py
+++ b/bin/reproducible_remote_scheduler.py
@@ -33,6 +33,10 @@ parser.add_argument('-r', '--status', required=False,
                     help='Schedule all package with this status')
 parser.add_argument('-i', '--issue', required=False,
                     help='Schedule all packages with this issue')
+parser.add_argument('-t', '--after', required=False,
+                    help='Schedule all packages build after this date')
+parser.add_argument('-b', '--before', required=False,
+                    help='Schedule all packages build before this date')
 parser.add_argument('packages', metavar='package', nargs='*',
                     help='list of packages to reschedule')
 scheduling_args = parser.parse_known_args()[0]
@@ -71,6 +75,8 @@ suite = scheduling_args.suite
 reason = ' '.join(scheduling_args.message)
 issue = scheduling_args.issue
 status = scheduling_args.status
+built_after = scheduling_args.after
+built_before = scheduling_args.before
 packages = scheduling_args.packages
 artifacts = scheduling_args.artifacts
 notify = not scheduling_args.no_notify or scheduling_args.noisy
@@ -85,6 +91,8 @@ log.debug('Debug url: ' + str(debug_url))
 log.debug('Architecture: ' + defaultarch)
 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) +
+          ' before ' + built_before if built_before else str(None))
 log.debug('Suite: ' + suite)
 log.debug('Packages: ' + ' '.join(packages))
 
@@ -93,7 +101,7 @@ if suite not in SUITES:
     log.critical('Please chose between ' + ', '.join(SUITES))
     sys.exit(1)
 
-if issue or status:
+if issue or status or built_after or built_before:
     formatter = dict(suite=suite)
     log.info('Querying packages with given issues/status...')
     query = 'SELECT s.name ' + \
@@ -106,6 +114,12 @@ if issue or status:
     if status:
         query += 'AND r.status = "{status}"'
         formatter['status'] = status
+    if built_after:
+        query += 'AND r.build_date > "{built_after}" '
+        formatter['built_after'] = built_after
+    if built_before:
+        query += 'AND r.build_date < "{built_before}" '
+        formatter['built_before'] = built_before
     results = query_db(query.format_map(formatter))
     results = [x for (x,) in results]
     log.info('Selected packages: ' + ' '.join(results))

-- 
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