yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajayyad...@apache.org
Subject yetus git commit: YETUS-459 Option to suppress assignee and contributor from RDM output
Date Sat, 18 Feb 2017 03:31:23 GMT
Repository: yetus
Updated Branches:
  refs/heads/master f70fcebd7 -> ab902e27b


YETUS-459 Option to suppress assignee and contributor from RDM output

Added a new flag to be passed to RDM --skip-credits
This will ignore both the reporter and the contributor.

Signed-off-by: Ajay Yadava <ajayyadava@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/ab902e27
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/ab902e27
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/ab902e27

Branch: refs/heads/master
Commit: ab902e27b9d174d677bbe2ae6053b56be5a61f74
Parents: f70fceb
Author: sacharya <suraj@apache.org>
Authored: Mon Feb 6 18:12:29 2017 -0600
Committer: Ajay Yadava <ajayyadava@apache.org>
Committed: Fri Feb 17 22:30:39 2017 -0500

----------------------------------------------------------------------
 release-doc-maker/releasedocmaker.py | 36 ++++++++++++++++++++-----------
 release-doc-maker/utils.py           | 26 +++++++++++++---------
 2 files changed, 40 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/ab902e27/release-doc-maker/releasedocmaker.py
----------------------------------------------------------------------
diff --git a/release-doc-maker/releasedocmaker.py b/release-doc-maker/releasedocmaker.py
index 589a8c3..75b3904 100755
--- a/release-doc-maker/releasedocmaker.py
+++ b/release-doc-maker/releasedocmaker.py
@@ -48,9 +48,6 @@ NUM_RETRIES = 5
 
 # label to be used to mark an issue as Incompatible change.
 BACKWARD_INCOMPATIBLE_LABEL = 'backward-incompatible'
-CHANGEHDR1 = "| JIRA | Summary | Priority | " + \
-             "Component | Reporter | Contributor |\n"
-CHANGEHDR2 = "|:---- |:---- | :--- |:---- |:---- |:---- |\n"
 
 ASF_LICENSE = '''
 <!---
@@ -646,6 +643,12 @@ def parse_args():
         action="append",
         type="int",
         help="Specify how many times to retry connection for each URL.")
+    parser.add_option(
+        "--skip-credits",
+        dest="skip_credits",
+        action="store_true",
+        default=False,
+        help="While creating release notes skip the 'reporter' and 'contributor' columns")
     parser.add_option("-X",
                       "--incompatiblelabel",
                       dest="incompatible_label",
@@ -843,54 +846,63 @@ def main():
         reloutputs.write_all("\n\n")
         reloutputs.close()
 
+        if options.skip_credits:
+            CHANGEHDR1 = "| JIRA | Summary | Priority | " + \
+                     "Component |\n"
+            CHANGEHDR2 = "|:---- |:---- | :--- |:---- |\n"
+        else:
+            CHANGEHDR1 = "| JIRA | Summary | Priority | " + \
+                         "Component | Reporter | Contributor |\n"
+            CHANGEHDR2 = "|:---- |:---- | :--- |:---- |:---- |:---- |\n"
+
         if incompatlist:
             choutputs.write_all("### INCOMPATIBLE CHANGES:\n\n")
             choutputs.write_all(CHANGEHDR1)
             choutputs.write_all(CHANGEHDR2)
-            choutputs.write_list(incompatlist)
+            choutputs.write_list(incompatlist, options.skip_credits)
 
         if importantlist:
             choutputs.write_all("\n\n### IMPORTANT ISSUES:\n\n")
             choutputs.write_all(CHANGEHDR1)
             choutputs.write_all(CHANGEHDR2)
-            choutputs.write_list(importantlist)
+            choutputs.write_list(importantlist, options.skip_credits)
 
         if newfeaturelist:
             choutputs.write_all("\n\n### NEW FEATURES:\n\n")
             choutputs.write_all(CHANGEHDR1)
             choutputs.write_all(CHANGEHDR2)
-            choutputs.write_list(newfeaturelist)
+            choutputs.write_list(newfeaturelist, options.skip_credits)
 
         if improvementlist:
             choutputs.write_all("\n\n### IMPROVEMENTS:\n\n")
             choutputs.write_all(CHANGEHDR1)
             choutputs.write_all(CHANGEHDR2)
-            choutputs.write_list(improvementlist)
+            choutputs.write_list(improvementlist, options.skip_credits)
 
         if buglist:
             choutputs.write_all("\n\n### BUG FIXES:\n\n")
             choutputs.write_all(CHANGEHDR1)
             choutputs.write_all(CHANGEHDR2)
-            choutputs.write_list(buglist)
+            choutputs.write_list(buglist, options.skip_credits)
 
         if testlist:
             choutputs.write_all("\n\n### TESTS:\n\n")
             choutputs.write_all(CHANGEHDR1)
             choutputs.write_all(CHANGEHDR2)
-            choutputs.write_list(testlist)
+            choutputs.write_list(testlist, options.skip_credits)
 
         if subtasklist:
             choutputs.write_all("\n\n### SUB-TASKS:\n\n")
             choutputs.write_all(CHANGEHDR1)
             choutputs.write_all(CHANGEHDR2)
-            choutputs.write_list(subtasklist)
+            choutputs.write_list(subtasklist, options.skip_credits)
 
         if tasklist or otherlist:
             choutputs.write_all("\n\n### OTHER:\n\n")
             choutputs.write_all(CHANGEHDR1)
             choutputs.write_all(CHANGEHDR2)
-            choutputs.write_list(otherlist)
-            choutputs.write_list(tasklist)
+            choutputs.write_list(otherlist, options.skip_credits)
+            choutputs.write_list(tasklist, options.skip_credits)
 
         choutputs.write_all("\n\n")
         choutputs.close()

http://git-wip-us.apache.org/repos/asf/yetus/blob/ab902e27/release-doc-maker/utils.py
----------------------------------------------------------------------
diff --git a/release-doc-maker/utils.py b/release-doc-maker/utils.py
index d2bb7cc..6d89f59 100644
--- a/release-doc-maker/utils.py
+++ b/release-doc-maker/utils.py
@@ -139,15 +139,21 @@ class Outputs(object):
         for value in self.others.values():
             value.close()
 
-    def write_list(self, mylist):
+    def write_list(self, mylist, skip_credits):
         for jira in sorted(mylist):
-            line = '| [%s](' + BASE_URL + '/browse/%s) ' +\
-                   '| %s |  %s | %s | %s | %s |\n'
-            line = line % (encode_utf8(jira.get_id()),
-                           encode_utf8(jira.get_id()),
-                           sanitize_text(jira.get_summary()),
-                           sanitize_text(jira.get_priority()),
-                           format_components(jira.get_components()),
-                           sanitize_text(jira.get_reporter()),
-                           sanitize_text(jira.get_assignee()))
+            if skip_credits:
+                line = '| [{id}]({base_url}/browse/{id}) | {summary} |  ' \
+                       '{priority} | {component} |\n'
+            else:
+                line = '| [{id}]({base_url}/browse/{id}) | {summary} |  ' \
+                       '{priority} | {component} | {reporter} | {assignee} |\n'
+            args = {'id': encode_utf8(jira.get_id()),
+                    'base_url': BASE_URL,
+                    'summary': sanitize_text(jira.get_summary()),
+                    'priority': sanitize_text(jira.get_priority()),
+                    'component': format_components(jira.get_components()),
+                    'reporter': sanitize_text(jira.get_reporter()),
+                    'assignee': sanitize_text(jira.get_assignee())
+                    }
+            line = line.format(**args)
             self.write_key_raw(jira.get_project(), line)


Mime
View raw message