You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2019/08/06 11:53:27 UTC

[lucene-solr] branch branch_8x updated: LUCENE-8883: addVersion.py now adds categories to CHANGES.txt

This is an automated email from the ASF dual-hosted git repository.

dsmiley pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 8233981  LUCENE-8883: addVersion.py now adds categories to CHANGES.txt
8233981 is described below

commit 8233981e7f0e5bddc25860b02421a559dd38ccb3
Author: David Smiley <ds...@salesforce.com>
AuthorDate: Tue Aug 6 13:53:22 2019 +0200

    LUCENE-8883: addVersion.py now adds categories to CHANGES.txt
    
    (cherry picked from commit 742e6b7effe96977fa5372c0c4a8413528fd99cd)
---
 dev-tools/scripts/addVersion.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index 64f0398..0344151 100755
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -25,7 +25,7 @@ import re
 from configparser import ConfigParser, ExtendedInterpolation
 from textwrap import dedent
 
-def update_changes(filename, new_version, init_changes = '(No Changes)\n\n'):
+def update_changes(filename, new_version, init_changes, headers):
   print('  adding new section to %s...' % filename, end='', flush=True)
   matcher = re.compile(r'\d+\.\d+\.\d+\s+===')
   def edit(buffer, match, line):
@@ -35,6 +35,8 @@ def update_changes(filename, new_version, init_changes = '(No Changes)\n\n'):
     if match is not None:
       buffer.append(line.replace(match.group(0), new_version.dot))
       buffer.append(init_changes)
+      for header in headers:
+        buffer.append('%s\n---------------------\n(No changes)\n\n' % header)
     buffer.append(line)
     return match is not None
      
@@ -206,8 +208,6 @@ def get_solr_init_changes():
     Apache ZooKeeper %(/org.apache.zookeeper/zookeeper)s
     Jetty %(org.eclipse.jetty.version)s
 
-
-    (No Changes)\n\n
     ''' % parse_properties_file('lucene/ivy-versions.properties'))
   
 def main():
@@ -215,10 +215,14 @@ def main():
     sys.exit("Tool must be run from the root of a source checkout.")
   current_version = Version.parse(find_current_version())
   newconf = read_config(current_version)
+  is_bugfix = newconf.version.is_bugfix_release()
 
   print('\nAdding new version %s' % newconf.version)
-  update_changes('lucene/CHANGES.txt', newconf.version)
-  update_changes('solr/CHANGES.txt', newconf.version, get_solr_init_changes())
+  # See LUCENE-8883 for some thoughts on which categories to use
+  update_changes('lucene/CHANGES.txt', newconf.version, '\n',
+                 ['Bug Fixes'] if is_bugfix else ['API Changes', 'New Features', 'Improvements', 'Optimizations', 'Bug Fixes', 'Other'])
+  update_changes('solr/CHANGES.txt', newconf.version, get_solr_init_changes(),
+                 ['Bug Fixes'] if is_bugfix else ['Upgrade Notes', 'New Features', 'Improvements', 'Optimizations', 'Bug Fixes', 'Other Changes'])
 
   latest_or_backcompat = newconf.is_latest_version or current_version.is_back_compat_with(newconf.version)
   if latest_or_backcompat: