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

janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new af0f819  SOLR-15852 Update dev-tools/scripts for 9.0 (#486)
af0f819 is described below

commit af0f819f08285546329a4c86070fe9351f8f327a
Author: Jan Høydahl <[email protected]>
AuthorDate: Sun Jan 2 23:44:23 2022 +0100

    SOLR-15852 Update dev-tools/scripts for 9.0 (#486)
    
    * SOLR-15852 Update githubPRs.py for solr-only
    
    * Update README.md
    
    * Add license header to create_line_file_docs.py
    
    * Update releasedJirasRegex.py for solr-only
---
 dev-tools/scripts/README.md                | 19 +++++++++----------
 dev-tools/scripts/create_line_file_docs.py | 17 +++++++++++++++++
 dev-tools/scripts/githubPRs.py             |  8 ++++----
 dev-tools/scripts/releasedJirasRegex.py    | 16 ++++++----------
 4 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/dev-tools/scripts/README.md b/dev-tools/scripts/README.md
index f2024b7..de03489 100644
--- a/dev-tools/scripts/README.md
+++ b/dev-tools/scripts/README.md
@@ -1,9 +1,9 @@
 # Developer Scripts
 
 This folder contains various useful scripts for developers, mostly related to
-releasing new versions of Lucene/Solr and testing those.
+releasing new versions of Solr and testing those.
 
-Python scripts require Python 3. To install necessary python modules, please 
run:
+Python scripts require Python 3.6 or above. To install necessary python 
modules, please run:
 
     pip3 install -r requirements.txt
 
@@ -31,10 +31,10 @@ the full tests.
     optional arguments:
       -h, --help            show this help message and exit
       --tmp-dir PATH        Temporary directory to test inside, defaults to
-                            /tmp/smoke_lucene_$version_$revision
+                            /tmp/smoke_solr_$version_$revision
       --not-signed          Indicates the release is not signed
       --local-keys PATH     Uses local KEYS file instead of fetching from
-                            https://archive.apache.org/dist/lucene/KEYS
+                            https://archive.apache.org/dist/solr/KEYS
       --revision REVISION   GIT revision number that release was built with,
                             defaults to that in URL
       --version X.Y.Z(-ALPHA|-BETA)?
@@ -45,7 +45,7 @@ the full tests.
       --download-only       Only perform download and sha hash check steps
     
     Example usage:
-    python3 -u dev-tools/scripts/smokeTestRelease.py 
https://dist.apache.org/repos/dist/dev/lucene/lucene-solr-6.0.1-RC2-revc7510a0...
+    python3 -u dev-tools/scripts/smokeTestRelease.py 
https://dist.apache.org/repos/dist/dev/solr/solr-9.0.1-RC2-revc7510a0...
 
 ### releaseWizard.py
 
@@ -85,7 +85,7 @@ of the other tools in this folder.
       --push-local PATH  Push the release to the local path
       --sign KEYID       Sign the release with the given gpg key
       --rc-num NUM       Release Candidate number. Default: 1
-      --root PATH        Root of Git working tree for lucene-solr. Default: "."
+      --root PATH        Root of Git working tree for solr. Default: "."
                          (the current directory)
       --logfile PATH     Specify log file path (default /tmp/release.log)
     
@@ -96,8 +96,7 @@ of the other tools in this folder.
 
     usage: addVersion.py [-h] version
     
-    Add a new version to CHANGES, to Version.java, build.gradle and
-    solrconfig.xml files
+    Add a new version to CHANGES, SolrVersion.java, build.gradle and 
solrconfig.xml files
     
     positional arguments:
       version
@@ -127,9 +126,9 @@ and prints a regular expression that will match all of them
 
     usage: reproduceJenkinsFailures.py [-h] [--no-git] [--iters N] URL
     
-    Must be run from a Lucene/Solr git workspace. Downloads the Jenkins
+    Must be run from a Solr git workspace. Downloads the Jenkins
     log pointed to by the given URL, parses it for Git revision and failed
-    Lucene/Solr tests, checks out the Git revision in the local workspace,
+    Solr tests, checks out the Git revision in the local workspace,
     groups the failed tests by module, then runs
     'ant test -Dtest.dups=%d -Dtests.class="*.test1[|*.test2[...]]" ...'
     in each module of interest, failing at the end if any of the runs fails.
diff --git a/dev-tools/scripts/create_line_file_docs.py 
b/dev-tools/scripts/create_line_file_docs.py
index 875cd65..55417d4 100644
--- a/dev-tools/scripts/create_line_file_docs.py
+++ b/dev-tools/scripts/create_line_file_docs.py
@@ -1,3 +1,20 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import os
 import gzip
 import time
diff --git a/dev-tools/scripts/githubPRs.py b/dev-tools/scripts/githubPRs.py
index 20f4536..457455e 100755
--- a/dev-tools/scripts/githubPRs.py
+++ b/dev-tools/scripts/githubPRs.py
@@ -16,7 +16,7 @@
 # limitations under the License.
 
 """
-Simple script that queries Github for all open PRs, then finds the ones without
+Simple script that queries GitHub for all open PRs, then finds the ones without
 issue number in title, and the ones where the linked JIRA is already closed
 """
 
@@ -93,7 +93,7 @@ def main():
   out("Number of open Pull Requests: %s" % open_prs.totalCount)
   result['open_count'] = open_prs.totalCount
 
-  lack_jira = list(filter(lambda x: not 
re.match(r'.*\b(LUCENE|SOLR)-\d{3,6}\b', x.title), open_prs))
+  lack_jira = list(filter(lambda x: not re.match(r'.*\b(SOLR)-\d{3,6}\b', 
x.title), open_prs))
   result['no_jira_count'] = len(lack_jira)
   lack_jira_list = []
   for pr in lack_jira:
@@ -104,12 +104,12 @@ def main():
     out("  #%s: %s %s (%s)" % (pr['number'], pr['created'], pr['title'], 
pr['user'] ))
 
   out("\nOpen PRs with a resolved JIRA")
-  has_jira = list(filter(lambda x: re.match(r'.*\b(LUCENE|SOLR)-\d{3,6}\b', 
x.title), open_prs))
+  has_jira = list(filter(lambda x: re.match(r'.*\b(SOLR)-\d{3,6}\b', x.title), 
open_prs))
 
   issue_ids = []
   issue_to_pr = {}
   for pr in has_jira:
-    jira_issue_str = re.match(r'.*\b((LUCENE|SOLR)-\d{3,6})\b', 
pr.title).group(1)
+    jira_issue_str = re.match(r'.*\b((SOLR)-\d{3,6})\b', pr.title).group(1)
     issue_ids.append(jira_issue_str)
     issue_to_pr[jira_issue_str] = pr
 
diff --git a/dev-tools/scripts/releasedJirasRegex.py 
b/dev-tools/scripts/releasedJirasRegex.py
index 7de0b05..77780ff 100755
--- a/dev-tools/scripts/releasedJirasRegex.py
+++ b/dev-tools/scripts/releasedJirasRegex.py
@@ -26,15 +26,15 @@ import re
 # under the given version in the given CHANGES.txt file
 # and prints a regular expression that will match all of them
 #
-# Caveat: In ancient versions (Lucene v1.9 and older; Solr v1.1 and older),
+# Caveat: In ancient versions (Solr v1.1 and older),
 # does not find Bugzilla bugs or JIRAs not mentioned at the beginning of
 # bullets or numbered entries.
 #
 def print_released_jiras_regex(version, filename):
   release_boundary_re = re.compile(r'\s*====*\s+(.*)\s+===')
   version_re = re.compile(r'%s(?:$|[^-])' % version)
-  bullet_re = re.compile(r'\s*(?:[-*]|\d+\.(?=(?:\s|(?:LUCENE|SOLR)-)))(.*)')
-  jira_ptn = r'(?:LUCENE|SOLR)-\d+'
+  bullet_re = re.compile(r'\s*(?:[-*]|\d+\.(?=(?:\s|(?:SOLR)-)))(.*)')
+  jira_ptn = r'(?:SOLR)-\d+'
   jira_re = re.compile(jira_ptn)
   jira_list_ptn = r'(?:[:,/()\s]*(?:%s))+' % jira_ptn
   jira_list_re = re.compile(jira_list_ptn)
@@ -42,7 +42,6 @@ def print_released_jiras_regex(version, filename):
   under_requested_version = False
   requested_version_found = False
   more_jiras_on_next_line = False
-  lucene_jiras = []
   solr_jiras = []
   with open(filename, 'r') as changes:
     for line in changes:
@@ -63,18 +62,15 @@ def print_released_jiras_regex(version, filename):
             if jira_list_match is not None:
               jira_match = jira_re.findall(jira_list_match.group(0))
               for jira in jira_match:
-                (lucene_jiras if jira.startswith('LUCENE-') else 
solr_jiras).append(jira.rsplit('-', 1)[-1])
+                solr_jiras.append(jira.rsplit('-', 1)[-1])
             more_jiras_on_next_line = more_jiras_on_next_line_re.match(content)
   if not requested_version_found:
     raise Exception('Could not find %s in %s' % (version, filename))
   print()
-  if (len(lucene_jiras) == 0 and len(solr_jiras) == 0):
+  if (len(solr_jiras) == 0):
     print('(No JIRAs => no regex)', end='')
   else:
-    if len(lucene_jiras) > 0:
-      print(r'LUCENE-(?:%s)\b%s' % ('|'.join(lucene_jiras), '|' if 
len(solr_jiras) > 0 else ''), end='')
-    if len(solr_jiras) > 0:
-      print(r'SOLR-(?:%s)\b' % '|'.join(solr_jiras), end='')
+    print(r'SOLR-(?:%s)\b' % '|'.join(solr_jiras), end='')
   print()
 
 def read_config():

Reply via email to