You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ji...@apache.org on 2018/09/15 19:30:28 UTC

lucene-solr:branch_7x: LUCENE-8500: Fix release smoke test to always use the downloaded KEYS file

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 4febf7783 -> dfe2778b1


LUCENE-8500: Fix release smoke test to always use the downloaded KEYS file


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

Branch: refs/heads/branch_7x
Commit: dfe2778b1c2fcbfd72e11cfc168652e506eba719
Parents: 4febf77
Author: Jim Ferenczi <ji...@apache.org>
Authored: Sat Sep 15 21:28:12 2018 +0200
Committer: Jim Ferenczi <ji...@apache.org>
Committed: Sat Sep 15 21:30:12 2018 +0200

----------------------------------------------------------------------
 dev-tools/scripts/smokeTestRelease.py | 39 ++++++++++++++----------------
 1 file changed, 18 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dfe2778b/dev-tools/scripts/smokeTestRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py
index af26ae1..70bea24 100644
--- a/dev-tools/scripts/smokeTestRelease.py
+++ b/dev-tools/scripts/smokeTestRelease.py
@@ -285,7 +285,7 @@ def checkAllJARs(topDir, project, gitRevision, version, tmpDir, baseURL):
                                % (fullPath, luceneDistFilenames[jarFilename]))
 
 
-def checkSigs(project, urlString, version, tmpDir, isSigned, local_keys):
+def checkSigs(project, urlString, version, tmpDir, isSigned, keysFile):
 
   print('  test basics...')
   ents = getDirEntries(urlString)
@@ -344,16 +344,6 @@ def checkSigs(project, urlString, version, tmpDir, isSigned, local_keys):
   actual = [x[0] for x in artifacts]
   if expected != actual:
     raise RuntimeError('%s: wrong artifacts: expected %s but got %s' % (project, expected, actual))
-                
-  print('  get KEYS')
-  if local_keys is not None:
-    print("    Using local KEYS file %s" % local_keys)
-    keysFile = local_keys
-  else:
-    keysFileURL = "https://archive.apache.org/dist/lucene/KEYS"
-    print("    Downloading online KEYS file %s" % keysFileURL)
-    download('KEYS', keysFileURL, tmpDir)
-    keysFile = '%s/KEYS' % (tmpDir)
   
   # Set up clean gpg world; import keys file:
   gpgHomeDir = '%s/%s.gpg' % (tmpDir, project)
@@ -978,7 +968,7 @@ def testDemo(run_java, isSrc, version, jdk):
 def removeTrailingZeros(version):
   return re.sub(r'(\.0)*$', '', version)
 
-def checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigned):
+def checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigned, keysFile):
   POMtemplates = defaultdict()
   getPOMtemplates(solrSrcUnpackPath, POMtemplates, tmpDir)
   print('    download artifacts')
@@ -996,7 +986,7 @@ def checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigne
   checkJavadocAndSourceArtifacts(artifacts, version)
   verifyDeployedPOMsCoordinates(artifacts, version)
   if isSigned:
-    verifyMavenSigs(baseURL, tmpDir, artifacts)
+    verifyMavenSigs(baseURL, tmpDir, artifacts, keysFile)
 
   distFiles = getBinaryDistFilesForMavenChecks(tmpDir, version, baseURL)
   checkIdenticalMavenArtifacts(distFiles, artifacts, version)
@@ -1118,13 +1108,9 @@ def getPOMcoordinate(treeRoot):
   packaging = 'jar' if packaging is None else packaging.text.strip()
   return groupId, artifactId, packaging, version
 
-def verifyMavenSigs(baseURL, tmpDir, artifacts):
+def verifyMavenSigs(baseURL, tmpDir, artifacts, keysFile):
   print('    verify maven artifact sigs', end=' ')
   for project in ('lucene', 'solr'):
-    keysFile = '%s/%s.KEYS' % (tmpDir, project)
-    if not os.path.exists(keysFile):
-      keysURL = '%s/%s/KEYS' % (baseURL, project)
-      download('%s.KEYS' % project, keysURL, tmpDir, quiet=True)
 
     # Set up clean gpg world; import keys file:
     gpgHomeDir = '%s/%s.gpg' % (tmpDir, project)
@@ -1505,15 +1491,26 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys,
     raise RuntimeError('could not find solr subdir')
 
   print()
+  print('Get KEYS...')
+  if local_keys is not None:
+    print("    Using local KEYS file %s" % local_keys)
+    keysFile = local_keys
+  else:
+    keysFileURL = "https://archive.apache.org/dist/lucene/KEYS"
+    print("    Downloading online KEYS file %s" % keysFileURL)
+    download('KEYS', keysFileURL, tmpDir)
+    keysFile = '%s/KEYS' % (tmpDir)
+
+  print()
   print('Test Lucene...')
-  checkSigs('lucene', lucenePath, version, tmpDir, isSigned, local_keys)
+  checkSigs('lucene', lucenePath, version, tmpDir, isSigned, keysFile)
   for artifact in ('lucene-%s.tgz' % version, 'lucene-%s.zip' % version):
     unpackAndVerify(java, 'lucene', tmpDir, artifact, gitRevision, version, testArgs, baseURL)
   unpackAndVerify(java, 'lucene', tmpDir, 'lucene-%s-src.tgz' % version, gitRevision, version, testArgs, baseURL)
 
   print()
   print('Test Solr...')
-  checkSigs('solr', solrPath, version, tmpDir, isSigned, local_keys)
+  checkSigs('solr', solrPath, version, tmpDir, isSigned, keysFile)
   for artifact in ('solr-%s.tgz' % version, 'solr-%s.zip' % version):
     unpackAndVerify(java, 'solr', tmpDir, artifact, gitRevision, version, testArgs, baseURL)
   solrSrcUnpackPath = unpackAndVerify(java, 'solr', tmpDir, 'solr-%s-src.tgz' % version,
@@ -1521,7 +1518,7 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys,
 
   print()
   print('Test Maven artifacts for Lucene and Solr...')
-  checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigned)
+  checkMaven(solrSrcUnpackPath, baseURL, tmpDir, gitRevision, version, isSigned, keysFile)
 
   print('\nSUCCESS! [%s]\n' % (datetime.datetime.now() - startTime))