Apache Solr open-source search software
SOLR-15852 Update dev-tools/scripts for 9.0 (#486)
Jan Høydahlaf0f819f0828
diff --git a/dev-tools/scripts/README.md b/dev-tools/scripts/README.mdindex f2024b72643..de034893141 100644--- a/dev-tools/scripts/README.md+++ b/dev-tools/scripts/README.md@@ -1,9 +1,9 @@# Developer ScriptsThis 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 stepsExample 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 filespositional arguments:version@@ -127,9 +126,9 @@ and prints a regular expression that will match all of themusage: 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 Jenkinslog 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.pyindex 875cd6520f0..55417d4634e 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 osimport gzipimport timediff --git a/dev-tools/scripts/githubPRs.py b/dev-tools/scripts/githubPRs.pyindex 20f45366de4..457455e4aef 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 withoutissue 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] = prdiff --git a/dev-tools/scripts/releasedJirasRegex.py b/dev-tools/scripts/releasedJirasRegex.pyindex 7de0b059755..77780ffcaa6 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_ptnjira_list_re = re.compile(jira_list_ptn)@@ -42,7 +42,6 @@ def print_released_jiras_regex(version, filename):under_requested_version = Falserequested_version_found = Falsemore_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():