You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2016/06/21 00:48:58 UTC

[01/13] lucene-solr:branch_5_5: Improve addVersion.py: in Version.java, remove 'Use this to get the latest...' from the previous LATEST, and add it to the new LATEST

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_5_5 59a664ec2 -> cfb792be2


Improve addVersion.py: in Version.java, remove 'Use this to get the latest...' from the previous LATEST, and add it to the new LATEST


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

Branch: refs/heads/branch_5_5
Commit: d879f59488f815c7fbe1b06cfe67f034adec8f36
Parents: 59a664e
Author: Steve Rowe <sa...@apache.org>
Authored: Fri May 13 15:23:18 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:31:01 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addVersion.py | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d879f594/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index 4b78c8d..7382906 100644
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -50,28 +50,36 @@ def add_constant(new_version, deprecate):
     last = buffer[-1]
     if last.strip() != '@Deprecated':
       spaces = ' ' * (len(last) - len(last.lstrip()) - 1)
-      buffer[-1] = spaces + (' * @deprecated (%s) Use latest\n' % new_version)
-      buffer.append(spaces + ' */\n')
-      buffer.append(spaces + '@Deprecated\n')
+      del buffer[-1] # Remove comment closer line
+      if (len(buffer) >= 4 and re.search('for Lucene.\s*$', buffer[-1]) != None):
+        del buffer[-3:] # drop the trailing lines '<p> / Use this to get the latest ... / ... for Lucene.'
+      buffer.append(( '{0} * @deprecated ({1}) Use latest\n'
+                    + '{0} */\n'
+                    + '{0}@Deprecated\n').format(spaces, new_version))
 
   def buffer_constant(buffer, line):
     spaces = ' ' * (len(line) - len(line.lstrip()))
-    buffer.append('\n' + spaces + '/**\n')
-    buffer.append(spaces + ' * Match settings and bugs in Lucene\'s %s release.\n' % new_version)
+    buffer.append(( '\n{0}/**\n'
+                  + '{0} * Match settings and bugs in Lucene\'s {1} release.\n')
+                  .format(spaces, new_version))
     if deprecate:
-      buffer.append(spaces + ' * @deprecated Use latest\n')
-    buffer.append(spaces + ' */\n')
+      buffer.append('%s * @deprecated Use latest\n' % spaces)
+    else:
+      buffer.append(( '{0} * <p>\n'
+                    + '{0} * Use this to get the latest &amp; greatest settings, bug\n'
+                    + '{0} * fixes, etc, for Lucene.\n').format(spaces))
+    buffer.append('%s */\n' % spaces)
     if deprecate:
-      buffer.append(spaces + '@Deprecated\n')
-    buffer.append(spaces + 'public static final Version %s = new Version(%d, %d, %d);\n' %
-                  (new_version.constant, new_version.major, new_version.minor, new_version.bugfix))
+      buffer.append('%s@Deprecated\n' % spaces)
+    buffer.append('{0}public static final Version {1} = new Version({2}, {3}, {4});\n'.format
+                  (spaces, new_version.constant, new_version.major, new_version.minor, new_version.bugfix))
   
   class Edit(object):
     found = -1
     def __call__(self, buffer, match, line):
       if new_version.constant in line:
         return None # constant already exists
-      # outter match is just to find lines declaring version constants
+      # outer match is just to find lines declaring version constants
       match = prev_matcher.search(line)
       if match is not None:
         ensure_deprecated(buffer) # old version should be deprecated


[04/13] lucene-solr:branch_5_5: replace svn up with git pull in buildAndPushRelease.py

Posted by sa...@apache.org.
replace svn up with git pull in buildAndPushRelease.py


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

Branch: refs/heads/branch_5_5
Commit: aeb1d2e19acfce00724e9579e2d403821164a9a6
Parents: 569672b
Author: nknize <nk...@apache.org>
Authored: Thu Mar 31 13:40:04 2016 -0500
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:45:54 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/buildAndPushRelease.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/aeb1d2e1/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 8a6d6ba..47a986d 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -73,8 +73,8 @@ def prepare(root, version, gpgKeyID, gpgPassword):
     os.remove(LOG)
 
   os.chdir(root)
-  print('  svn up...')
-  run('svn up')
+  print('  git pull...')
+  run('git pull')
 
   rev = getGitRev()
   print('  git rev: %s' % rev)
@@ -236,7 +236,7 @@ def parse_config():
   if config.rc_num <= 0:
     parser.error('Release Candidate number must be a positive integer')
   if not os.path.isdir(config.root):
-    # TODO: add additional svn check to ensure dir is a real lucene-solr checkout
+    # TODO: add additional git check to ensure dir is a real lucene-solr checkout
     parser.error('Root path is not a valid lucene-solr checkout')
 
   config.version = read_version(config.root)


[02/13] lucene-solr:branch_5_5: addVersion.py (via scriptutil.py): fix name of the running script in error message

Posted by sa...@apache.org.
addVersion.py (via scriptutil.py): fix name of the running script in error message


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/20ffd683
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/20ffd683
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/20ffd683

Branch: refs/heads/branch_5_5
Commit: 20ffd68314dea38f2f51d6b5b8cf324d28425b4e
Parents: d879f59
Author: Steve Rowe <sa...@apache.org>
Authored: Fri May 13 15:36:31 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:31:24 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/scriptutil.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/20ffd683/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index 216bde4..419ccbe 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -115,7 +115,7 @@ def find_branch_type():
     return BranchType.stable
   if re.match(r'branch_(\d+)_(\d+)', branchName.decode('UTF-8')):
     return BranchType.release
-  raise Exception('Cannot run bumpVersion.py on feature branch')
+  raise Exception('Cannot run %s on feature branch' % sys.argv[0].rsplit('/', 1)[-1])
 
 version_prop_re = re.compile('version\.base=(.*)')
 def find_current_version():


[11/13] lucene-solr:branch_5_5: Hide 'git --version' output

Posted by sa...@apache.org.
Hide 'git --version' output


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

Branch: refs/heads/branch_5_5
Commit: e47289200d3b91814ad9ef15d555058e1914a29c
Parents: 7f41a77
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 16:28:35 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:47:46 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/buildAndPushRelease.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e4728920/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 1bf0854..199a494 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -215,7 +215,7 @@ def parse_config():
   return config
 
 def check_cmdline_tools():  # Fail fast if there are cmdline tool problems
-  if os.system('git --version'):
+  if os.system('git --version >/dev/null 2>/dev/null'):
     raise RuntimeError('"git --version" returned a non-zero exit code.')
   antVersion = os.popen('ant -version').read().strip()
   if not antVersion.startswith('Apache Ant(TM) version 1.8'):


[03/13] lucene-solr:branch_5_5: LUCENE-7265: Pull change id related code out of addVersion.py; rename 'major' BranchType to 'unstable'

Posted by sa...@apache.org.
LUCENE-7265: Pull change id related code out of addVersion.py; rename 'major' BranchType to 'unstable'


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/569672bb
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/569672bb
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/569672bb

Branch: refs/heads/branch_5_5
Commit: 569672bbcfd1c04da1e50877898df1fc69dec3b7
Parents: 20ffd68
Author: Steve Rowe <sa...@apache.org>
Authored: Fri May 13 17:06:16 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:43:06 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addVersion.py | 13 ++-----------
 dev-tools/scripts/scriptutil.py | 10 +++++-----
 2 files changed, 7 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/569672bb/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index 7382906..cc41116 100644
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -176,23 +176,14 @@ def check_solr_version_tests():
 def read_config():
   parser = argparse.ArgumentParser(description='Add a new version')
   parser.add_argument('version', type=Version.parse)
-  parser.add_argument('-c', '--changeid', type=str, help='Git ChangeId (commit hash) for downstream version change to merge')
   c = parser.parse_args()
 
   c.branch_type = find_branch_type()
   c.matching_branch = c.version.is_bugfix_release() and c.branch_type == BranchType.release or \
                       c.version.is_minor_release() and c.branch_type == BranchType.stable or \
-                      c.version.is_major_release() and c.branch_type == BranchType.major
+                      c.version.is_major_release() and c.branch_type == BranchType.unstable
 
   print ("branch_type is %s " % c.branch_type)
-  if c.changeid and c.version.is_major_release():
-    parser.error('Cannot use --changeid for major release')
-  if c.changeid and c.matching_branch:
-    parser.error('Cannot use --changeid on branch that new version will originate on')
-  if c.version.is_bugfix_release() and c.branch_type in [BranchType.major, BranchType.stable] and not c.changeid:
-    parser.error('Adding bugfix release on master or stable branch requires --changeid')
-  if c.version.is_minor_release() and c.branch_type in [BranchType.major] and not c.changeid:
-    parser.error('Adding minor release on master branch requires --changeid')
 
   return c
 
@@ -228,7 +219,7 @@ def main():
   update_changes('solr/CHANGES.txt', c.version, get_solr_init_changes())
   add_constant(c.version, not c.matching_branch)
 
-  if not c.changeid:
+  if c.matching_branch:
     print('\nUpdating latest version')
     update_build_version(c.version)
     update_latest_constant(c.version)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/569672bb/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index 419ccbe..84c39cd 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -94,11 +94,11 @@ def update_file(filename, line_re, edit):
     f.write(''.join(buffer))
   return True
 
-# branch types are "release", "stable" and "major"
+# branch types are "release", "stable" and "unstable"
 class BranchType(Enum):
-  major   = 1
-  stable  = 2
-  release = 3
+  unstable = 1
+  stable   = 2
+  release  = 3
 
 def find_branch_type():
   output = subprocess.check_output('git status', shell=True)
@@ -110,7 +110,7 @@ def find_branch_type():
     raise Exception('git status missing branch name')
 
   if branchName == b'master':
-    return BranchType.major
+    return BranchType.unstable
   if re.match(r'branch_(\d+)x', branchName.decode('UTF-8')):
     return BranchType.stable
   if re.match(r'branch_(\d+)_(\d+)', branchName.decode('UTF-8')):


[08/13] lucene-solr:branch_5_5: Fix current branch detection

Posted by sa...@apache.org.
Fix current branch detection


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/52b812f2
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/52b812f2
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/52b812f2

Branch: refs/heads/branch_5_5
Commit: 52b812f2187d7af2eb9d48f349350c1c440c5d1f
Parents: d9d3dae
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:44:11 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:47:02 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/buildAndPushRelease.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/52b812f2/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index de50d32..07ac6d4 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -61,7 +61,7 @@ def getGitRev():
   status = os.popen('git status').read().strip()
   if 'nothing to commit, working directory clean' not in status:
     raise RuntimeError('git clone is dirty:\n\n%s' % status)
-  branch = os.popen('git rev-parse --abbrev-ref HEAD')
+  branch = os.popen('git rev-parse --abbrev-ref HEAD').read().strip()
   unpushedCommits = os.popen('git log origin/%s..' % branch).read().strip()
   if len(unpushedCommits) > 0:
     raise RuntimeError('There are unpushed commits - "git log origin.." output is:\n\n%s' % unpushedCommits)


[09/13] lucene-solr:branch_5_5: When there are unpushed commits, print out the full command used to show the commits

Posted by sa...@apache.org.
When there are unpushed commits, print out the full command used to show the commits


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

Branch: refs/heads/branch_5_5
Commit: dc76390ce4f8be7063f5ad4ba402d428da0ef107
Parents: 52b812f
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:47:06 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:47:23 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/buildAndPushRelease.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dc76390c/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 07ac6d4..12fb799 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -62,9 +62,10 @@ def getGitRev():
   if 'nothing to commit, working directory clean' not in status:
     raise RuntimeError('git clone is dirty:\n\n%s' % status)
   branch = os.popen('git rev-parse --abbrev-ref HEAD').read().strip()
-  unpushedCommits = os.popen('git log origin/%s..' % branch).read().strip()
+  command = 'git log origin/%s..' % branch
+  unpushedCommits = os.popen(command).read().strip()
   if len(unpushedCommits) > 0:
-    raise RuntimeError('There are unpushed commits - "git log origin.." output is:\n\n%s' % unpushedCommits)
+    raise RuntimeError('There are unpushed commits - "%s" output is:\n\n%s' % (command, unpushedCommits))
 
   print('  git clone is clean')
   return os.popen('git rev-parse HEAD').read().strip()


[07/13] lucene-solr:branch_5_5: Check for unpushed commits only on the current branch

Posted by sa...@apache.org.
Check for unpushed commits only on the current branch


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

Branch: refs/heads/branch_5_5
Commit: d9d3dae14b2f49320f61c2ca88563608f9f85baa
Parents: 77b9246
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:40:44 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:46:50 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/buildAndPushRelease.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d9d3dae1/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 46be0fe..de50d32 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -61,7 +61,8 @@ def getGitRev():
   status = os.popen('git status').read().strip()
   if 'nothing to commit, working directory clean' not in status:
     raise RuntimeError('git clone is dirty:\n\n%s' % status)
-  unpushedCommits = os.popen('git log origin..').read().strip()
+  branch = os.popen('git rev-parse --abbrev-ref HEAD')
+  unpushedCommits = os.popen('git log origin/%s..' % branch).read().strip()
   if len(unpushedCommits) > 0:
     raise RuntimeError('There are unpushed commits - "git log origin.." output is:\n\n%s' % unpushedCommits)
 


[10/13] lucene-solr:branch_5_5: - In help text, show default RC number. - In help text, state that the default --root value is '.' (the current directory)

Posted by sa...@apache.org.
- In help text, show default RC number.
- In help text, state that the default --root value is '.' (the current directory)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/7f41a77d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/7f41a77d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/7f41a77d

Branch: refs/heads/branch_5_5
Commit: 7f41a77d17726aaa8558b1774b5f6d34b8c47ddd
Parents: dc76390
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:55:51 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:47:34 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/buildAndPushRelease.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7f41a77d/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 12fb799..1bf0854 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -181,9 +181,9 @@ def parse_config():
   parser.add_argument('--sign', metavar='KEYID',
                       help='Sign the release with the given gpg key')
   parser.add_argument('--rc-num', metavar='NUM', type=int, default=1,
-                      help='Release Candidate number, required')
-  parser.add_argument('--root', metavar='WORKING_TREE_PATH', default='.',
-                      help='Root of Git working tree for lucene-solr')
+                      help='Release Candidate number.  Default: 1')
+  parser.add_argument('--root', metavar='PATH', default='.',
+                      help='Root of Git working tree for lucene-solr.  Default: "." (the current directory)')
   config = parser.parse_args()
 
   if not config.prepare and config.sign:


[06/13] lucene-solr:branch_5_5: os.isdir => os.path.isdir

Posted by sa...@apache.org.
os.isdir => os.path.isdir


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/77b92464
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/77b92464
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/77b92464

Branch: refs/heads/branch_5_5
Commit: 77b924647d11a3099a897a3bb65f1633833980a8
Parents: a6f9e5e
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:32:20 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:46:38 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/buildAndPushRelease.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/77b92464/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 8da13d3..46be0fe 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -195,7 +195,7 @@ def parse_config():
   cwd = os.getcwd()
   os.chdir(config.root)
   config.root = os.getcwd() # Absolutize root dir
-  if os.system('git rev-parse') or 3 != len([d for d in ('dev-tools','lucene','solr') if os.isdir(d)]):
+  if os.system('git rev-parse') or 3 != len([d for d in ('dev-tools','lucene','solr') if os.path.isdir(d)]):
     parser.error('Root path "%s" is not a valid lucene-solr checkout' % config.root)
   os.chdir(cwd)
 


[05/13] lucene-solr:branch_5_5: - Fail if there are unpushed commits in the Git working tree - Drop obsolete "--push-remote" param - Drop obsolete "--smoke-test" param - Update example RM cmdline usage - Support relative working tree root directory - Con

Posted by sa...@apache.org.
- Fail if there are unpushed commits in the Git working tree
- Drop obsolete "--push-remote" param
- Drop obsolete "--smoke-test" param
- Update example RM cmdline usage
- Support relative working tree root directory
- Convert "root" positional cmdline arg into an optional "--root" arg defaulting to '.'
- Use sys.executable instead of $PYTHON_EXEC when printing smoke tester cmdline
- Add new fail-fast checks:
   - Check for a functional "git" executable
   - Ensure "ant" version is 1.8.X
   - Ensure working tree is under Git control, and contains 'lucene/', 'solr/' and 'dev-tools/' dirs


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

Branch: refs/heads/branch_5_5
Commit: a6f9e5eef069e4054decb818b612551ae81b1762
Parents: aeb1d2e
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 15:28:06 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:46:01 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/buildAndPushRelease.py | 85 ++++++++-------------------
 1 file changed, 26 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a6f9e5ee/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 47a986d..8da13d3 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -61,8 +61,10 @@ def getGitRev():
   status = os.popen('git status').read().strip()
   if 'nothing to commit, working directory clean' not in status:
     raise RuntimeError('git clone is dirty:\n\n%s' % status)
+  unpushedCommits = os.popen('git log origin..').read().strip()
+  if len(unpushedCommits) > 0:
+    raise RuntimeError('There are unpushed commits - "git log origin.." output is:\n\n%s' % unpushedCommits)
 
-  # TODO: we should also detect unpushed changes here?  Something like "git cherry -v origin/branch_5_5"?
   print('  git clone is clean')
   return os.popen('git rev-parse HEAD').read().strip()
 
@@ -115,47 +117,6 @@ def prepare(root, version, gpgKeyID, gpgPassword):
   print()
   return rev
 
-def push(version, root, rev, rcNum, username):
-  print('Push...')
-  dir = 'lucene-solr-%s-RC%d-rev%s' % (version, rcNum, rev)
-  s = os.popen('ssh %s@people.apache.org "ls -ld public_html/staging_area/%s" 2>&1' % (username, dir)).read()
-  if 'no such file or directory' not in s.lower():
-    print('  Remove old dir...')
-    run('ssh %s@people.apache.org "chmod -R u+rwX public_html/staging_area/%s; rm -rf public_html/staging_area/%s"' % 
-        (username, dir, dir))
-  run('ssh %s@people.apache.org "mkdir -p public_html/staging_area/%s/lucene public_html/staging_area/%s/solr"' % \
-      (username, dir, dir))
-  print('  Lucene')
-  os.chdir('%s/lucene/dist' % root)
-  print('    zip...')
-  if os.path.exists('lucene.tar.bz2'):
-    os.remove('lucene.tar.bz2')
-  run('tar cjf lucene.tar.bz2 *')
-  print('    copy...')
-  run('scp lucene.tar.bz2 %s@people.apache.org:public_html/staging_area/%s/lucene' % (username, dir))
-  print('    unzip...')
-  run('ssh %s@people.apache.org "cd public_html/staging_area/%s/lucene; tar xjf lucene.tar.bz2; rm -f lucene.tar.bz2"' % (username, dir))
-  os.remove('lucene.tar.bz2')
-
-  print('  Solr')
-  os.chdir('%s/solr/package' % root)
-  print('    zip...')
-  if os.path.exists('solr.tar.bz2'):
-    os.remove('solr.tar.bz2')
-  run('tar cjf solr.tar.bz2 *')
-  print('    copy...')
-  run('scp solr.tar.bz2 %s@people.apache.org:public_html/staging_area/%s/solr' % (username, dir))
-  print('    unzip...')
-  run('ssh %s@people.apache.org "cd public_html/staging_area/%s/solr; tar xjf solr.tar.bz2; rm -f solr.tar.bz2"' % (username, dir))
-  os.remove('solr.tar.bz2')
-
-  print('  chmod...')
-  run('ssh %s@people.apache.org "chmod -R a+rX-w public_html/staging_area/%s"' % (username, dir))
-
-  print('  done!')
-  url = 'http://people.apache.org/~%s/staging_area/%s' % (username, dir)
-  return url
-
 def pushLocal(version, root, rev, rcNum, localDir):
   print('Push local [%s]...' % localDir)
   os.makedirs(localDir)
@@ -206,29 +167,23 @@ def read_version(path):
 def parse_config():
   epilogue = textwrap.dedent('''
     Example usage for a Release Manager:
-    python3.2 -u buildAndPushRelease.py --push-remote mikemccand --sign 6E68DA61 --rc-num 1 /path/to/lucene_solr_4_7
+    python3 -u dev-tools/scripts/buildAndPushRelease.py --push-local /tmp/releases/6.0.1 --sign 6E68DA61 --rc-num 1
   ''')
   description = 'Utility to build, push, and test a release.'
   parser = argparse.ArgumentParser(description=description, epilog=epilogue,
                                    formatter_class=argparse.RawDescriptionHelpFormatter)
   parser.add_argument('--no-prepare', dest='prepare', default=True, action='store_false',
                       help='Use the already built release in the provided checkout')
-  parser.add_argument('--push-remote', metavar='USERNAME',
-                      help='Push the release to people.apache.org for the given user')
   parser.add_argument('--push-local', metavar='PATH',
                       help='Push the release to the local path')
   parser.add_argument('--sign', metavar='KEYID',
                       help='Sign the release with the given gpg key')
   parser.add_argument('--rc-num', metavar='NUM', type=int, default=1,
                       help='Release Candidate number, required')
-  parser.add_argument('--smoke-test', metavar='PATH', 
-                      help='Run the smoker tester on the release in the given directory')
-  parser.add_argument('root', metavar='checkout_path',
-                      help='Root of SVN checkout for lucene-solr')
+  parser.add_argument('--root', metavar='WORKING_TREE_PATH', default='.',
+                      help='Root of Git working tree for lucene-solr')
   config = parser.parse_args()
 
-  if config.push_remote is not None and config.push_local is not None:
-    parser.error('Cannot specify --push-remote and --push-local together')
   if not config.prepare and config.sign:
     parser.error('Cannot sign already built release')
   if config.push_local is not None and os.path.exists(config.push_local):
@@ -236,8 +191,13 @@ def parse_config():
   if config.rc_num <= 0:
     parser.error('Release Candidate number must be a positive integer')
   if not os.path.isdir(config.root):
-    # TODO: add additional git check to ensure dir is a real lucene-solr checkout
-    parser.error('Root path is not a valid lucene-solr checkout')
+    parser.error('Root path "%s" is not a directory' % config.root)
+  cwd = os.getcwd()
+  os.chdir(config.root)
+  config.root = os.getcwd() # Absolutize root dir
+  if os.system('git rev-parse') or 3 != len([d for d in ('dev-tools','lucene','solr') if os.isdir(d)]):
+    parser.error('Root path "%s" is not a valid lucene-solr checkout' % config.root)
+  os.chdir(cwd)
 
   config.version = read_version(config.root)
   print('Building version: %s' % config.version)
@@ -251,8 +211,17 @@ def parse_config():
     config.gpg_password = None
 
   return config
+
+def check_cmdline_tools():  # Fail fast if there are cmdline tool problems
+  if os.system('git --version'):
+    raise RuntimeError('"git --version" returned a non-zero exit code.')
+  antVersion = os.popen('ant -version').read().strip()
+  if not antVersion.startswith('Apache Ant(TM) version 1.8'):
+    raise RuntimeError('ant version is not 1.8.X: "%s"' % antVersion)
   
 def main():
+  check_cmdline_tools()
+
   c = parse_config()
 
   if c.prepare:
@@ -261,19 +230,17 @@ def main():
     os.chdir(root)
     rev = open('rev.txt', encoding='UTF-8').read()
 
-  if c.push_remote:
-    url = push(c.version, c.root, rev, c.rc_num, c.push_remote)
-  elif c.push_local:
+  if c.push_local:
     url = pushLocal(c.version, c.root, rev, c.rc_num, c.push_local)
   else:
     url = None
 
   if url is not None:
     print('  URL: %s' % url)
-    print('Next set the PYTHON_EXEC env var and you can run the smoker tester:')
-    p = re.compile("(.*)\/")
+    print('Next run the smoker tester:')
+    p = re.compile(".*/")
     m = p.match(sys.argv[0])
-    print(' $PYTHON_EXEC %ssmokeTestRelease.py %s' % (m.group(), url))
+    print('%s -u %(s)smokeTestRelease.py %s' % (sys.executable, m.group(), url))
 
 if __name__ == '__main__':
   try:


[13/13] lucene-solr:branch_5_5: - Modernize example usage - Fail if script version is incompatible with release version

Posted by sa...@apache.org.
- Modernize example usage
- Fail if script version is incompatible with release version


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

Branch: refs/heads/branch_5_5
Commit: cfb792be2c783fc0dfee97a779281e0ef0148006
Parents: b657576
Author: Steve Rowe <sa...@apache.org>
Authored: Wed May 25 16:09:22 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:48:12 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/smokeTestRelease.py | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cfb792be/dev-tools/scripts/smokeTestRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py
index 8288a9d..3316583 100644
--- a/dev-tools/scripts/smokeTestRelease.py
+++ b/dev-tools/scripts/smokeTestRelease.py
@@ -1227,7 +1227,7 @@ revision_re = re.compile(r'rev([a-f\d]+)')
 def parse_config():
   epilogue = textwrap.dedent('''
     Example usage:
-    python3.2 -u dev-tools/scripts/smokeTestRelease.py http://people.apache.org/~whoever/staging_area/lucene-solr-4.3.0-RC1-rev1469340
+    python3 -u dev-tools/scripts/smokeTestRelease.py https://dist.apache.org/repos/dist/dev/lucene/lucene-solr-6.0.1-RC2-revc7510a0...
   ''')
   description = 'Utility to test a release.'
   parser = argparse.ArgumentParser(description=description, epilog=epilogue,
@@ -1381,8 +1381,25 @@ def confirmAllReleasesAreTestedForBackCompat(smokeVersion, unpackPath):
   else:
     print('    success!')
 
+def getScriptVersion():
+  topLevelDir = '../..'                       # Assumption: this script is in dev-tools/scripts/ of a checkout
+  m = re.compile(r'(.*)/').match(sys.argv[0]) # Get this script's directory
+  if m is not None and m.group(1) != '.':
+    origCwd = os.getcwd()
+    os.chdir(m.group(1))
+    os.chdir('../..')
+    topLevelDir = os.getcwd()
+    os.chdir(origCwd)
+  reBaseVersion = re.compile(r'version\.base\s*=\s*(\d+\.\d+)')
+  return reBaseVersion.search(open('%s/lucene/version.properties' % topLevelDir).read()).group(1)
+
 def main():
   c = parse_config()
+
+  scriptVersion = getScriptVersion()
+  if not c.version.startswith(scriptVersion + '.'):
+    raise RuntimeError('smokeTestRelease.py for %s.X is incompatible with a %s release.' % (scriptVersion, c.version))
+
   print('NOTE: output encoding is %s' % sys.stdout.encoding)
   smokeTest(c.java, c.url, c.revision, c.version, c.tmp_dir, c.is_signed, ' '.join(c.test_args))
 


[12/13] lucene-solr:branch_5_5: fix smokeTestRelease.py directory interpolation

Posted by sa...@apache.org.
fix smokeTestRelease.py directory interpolation


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

Branch: refs/heads/branch_5_5
Commit: b6575765692ac4fb2bf9a8da60ad417f7e292e2b
Parents: e472892
Author: Steve Rowe <sa...@apache.org>
Authored: Mon May 23 16:50:02 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Mon Jun 20 20:48:01 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/buildAndPushRelease.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b6575765/dev-tools/scripts/buildAndPushRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py
index 199a494..5945044 100644
--- a/dev-tools/scripts/buildAndPushRelease.py
+++ b/dev-tools/scripts/buildAndPushRelease.py
@@ -242,7 +242,7 @@ def main():
     print('Next run the smoker tester:')
     p = re.compile(".*/")
     m = p.match(sys.argv[0])
-    print('%s -u %(s)smokeTestRelease.py %s' % (sys.executable, m.group(), url))
+    print('%s -u %ssmokeTestRelease.py %s' % (sys.executable, m.group(), url))
 
 if __name__ == '__main__':
   try: