[Libreoffice-commits] dev-tools.git: 2 commits - ciabot/libreoffice-bugzilla2.py

Jan Holesovsky kendy at collabora.com
Wed Oct 7 05:40:19 PDT 2015


 ciabot/libreoffice-bugzilla2.py |   31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

New commits:
commit 052f5e102682a1e4694d330aa3ee50aa9149125c
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Oct 7 14:29:51 2015 +0200

    libreoffice-bugzilla2.py: Don't add comment about testing when not 'core'.
    
    Change-Id: I95756f4ec2edcf9f070c1eb3591494313ecec8ea
    Reviewed-on: https://gerrit.libreoffice.org/19227
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/ciabot/libreoffice-bugzilla2.py b/ciabot/libreoffice-bugzilla2.py
index c3a18f0..310fe20 100644
--- a/ciabot/libreoffice-bugzilla2.py
+++ b/ciabot/libreoffice-bugzilla2.py
@@ -79,7 +79,10 @@ It has been pushed to "%s":
 
 %s
 
-%s
+%s""" %(commit.author, branch, cgiturl, commit.summary)
+
+        if (repo_name == "core"):
+            comment_msg += """
 
 It will be available in %s.
 
@@ -87,7 +90,8 @@ The patch should be included in the daily builds available at
 http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
 information about daily builds can be found at:
 http://wiki.documentfoundation.org/Testing_Daily_Builds
-Affected users are encouraged to test the fix and report feedback.""" %(commit.author, branch, cgiturl, commit.summary, new_version)
+
+Affected users are encouraged to test the fix and report feedback.""" %(new_version)
 
         if dry_run:
             print("DRY RUN, we would add the following comment:\n%s" %(new_whiteboard))
commit eeaa92d1cc29aaf3e1a4d8eee93b307f8a5d0b42
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Oct 7 14:24:48 2015 +0200

    libreoffice-buglizilla2.py: Add --dry-run parameter to simplify testing.
    
    Change-Id: I1d25afe4b122b409253ef83bd5f0ff726b27201e
    Reviewed-on: https://gerrit.libreoffice.org/19226
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/ciabot/libreoffice-bugzilla2.py b/ciabot/libreoffice-bugzilla2.py
index 17fa6d1..c3a18f0 100644
--- a/ciabot/libreoffice-bugzilla2.py
+++ b/ciabot/libreoffice-bugzilla2.py
@@ -35,6 +35,7 @@ from bugzilla.base import _BugzillaToken
 
 master_target = "5.1.0"
 bug_regex = "(?:tdf|fdo)#(\d+)"
+dry_run = False
 
 class FreedesktopBZ:
     bzclass = bugzilla.Bugzilla44
@@ -62,7 +63,10 @@ class FreedesktopBZ:
         m = re.findall(new_version, old_whiteboard)
         if m is None or len(m) == 0:
             new_whiteboard = old_whiteboard + " target:" + new_version
-            bug.setwhiteboard(new_whiteboard)
+            if dry_run:
+                print("DRY RUN, we would set the whiteboard to:\n%s" %(new_whiteboard))
+            else:
+                bug.setwhiteboard(new_whiteboard)
 
         cgiturl = "http://cgit.freedesktop.org/libreoffice/%s/commit/?id=%s" %(repo_name, commit.hexsha)
         if branch is not None and branch != "master":
@@ -84,7 +88,11 @@ http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
 information about daily builds can be found at:
 http://wiki.documentfoundation.org/Testing_Daily_Builds
 Affected users are encouraged to test the fix and report feedback.""" %(commit.author, branch, cgiturl, commit.summary, new_version)
-        bug.addcomment(comment_msg)
+
+        if dry_run:
+            print("DRY RUN, we would add the following comment:\n%s" %(new_whiteboard))
+        else:
+            bug.addcomment(comment_msg)
 
 
 
@@ -168,10 +176,11 @@ def read_repo(repo_name):
 
 def main(argv):
     print(argv)
+    help_text = 'libreoffice-bugzilla2.py -c commitid [-b branchname] [-r repo] [--dry-run]'
     try:
-        opts, args = getopt.getopt(argv,"hc:b:r:",["commit=","branch=","repo=","help"])
+        opts, args = getopt.getopt(argv,"dhc:b:r:",["dry-run","help","commit=","branch=","repo="])
     except getopt.GetoptError:
-        print('test.py -c commitid -r repo [-b branchname]')
+        print(help_text)
         sys.exit(2)
 
     commit_id = None
@@ -180,9 +189,11 @@ def main(argv):
 
     for opt, arg in opts:
         if opt == '-h':
-            print('test.py -c commitid [-b branchname] [-r repo]')
+            print(help_text)
             sys.exit()
-        elif opt in ("-c", "--commit_id"):
+        elif opt in ("-d", "--dry-run"):
+            dry_run = True
+        elif opt in ("-c", "--commit"):
             commit_id = arg
         elif opt in ("-b", "--branch"):
             branch = arg


More information about the Libreoffice-commits mailing list