xref: /Lucene/dev-tools/scripts/README.md (revision 03e819267443b56709c57442fa7cc94b1b137ee0)
13bedc087SDawid Weiss<!--
23bedc087SDawid Weiss    Licensed to the Apache Software Foundation (ASF) under one or more
33bedc087SDawid Weiss    contributor license agreements.  See the NOTICE file distributed with
43bedc087SDawid Weiss    this work for additional information regarding copyright ownership.
53bedc087SDawid Weiss    The ASF licenses this file to You under the Apache License, Version 2.0
63bedc087SDawid Weiss    the "License"); you may not use this file except in compliance with
73bedc087SDawid Weiss    the License.  You may obtain a copy of the License at
83bedc087SDawid Weiss
93bedc087SDawid Weiss        http://www.apache.org/licenses/LICENSE-2.0
103bedc087SDawid Weiss
113bedc087SDawid Weiss    Unless required by applicable law or agreed to in writing, software
123bedc087SDawid Weiss    distributed under the License is distributed on an "AS IS" BASIS,
133bedc087SDawid Weiss    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
143bedc087SDawid Weiss    See the License for the specific language governing permissions and
153bedc087SDawid Weiss    limitations under the License.
163bedc087SDawid Weiss -->
173bedc087SDawid Weiss
1887c131baSJan Høydahl# Developer Scripts
1987c131baSJan Høydahl
2087c131baSJan HøydahlThis folder contains various useful scripts for developers, mostly related to
21674b66ddSJan Høydahlreleasing new versions of Lucene and testing those.
2287c131baSJan Høydahl
23*03e81926STomoko UchidaPython scripts require Python 3.6 or avobe. To install necessary python modules, please run:
2487c131baSJan Høydahl
2587c131baSJan Høydahl    pip3 install -r requirements.txt
2687c131baSJan Høydahl
2787c131baSJan Høydahl## Scripts description
2887c131baSJan Høydahl
2987c131baSJan Høydahl### smokeTestRelease.py
3087c131baSJan Høydahl
3187c131baSJan HøydahlUsed to validate new release candidates (RC). The script downloads an RC from a URL
3287c131baSJan Høydahlor local folder, then runs a number of sanity checks on the artifacts, and then runs
3387c131baSJan Høydahlthe full tests.
3487c131baSJan Høydahl
3587c131baSJan Høydahl    usage: smokeTestRelease.py [-h] [--tmp-dir PATH] [--not-signed]
3687c131baSJan Høydahl                               [--local-keys PATH] [--revision REVISION]
3787c131baSJan Høydahl                               [--version X.Y.Z(-ALPHA|-BETA)?]
3887c131baSJan Høydahl                               [--test-java12 JAVA12_HOME] [--download-only]
3987c131baSJan Høydahl                               url ...
4087c131baSJan Høydahl
4187c131baSJan Høydahl    Utility to test a release.
4287c131baSJan Høydahl
4387c131baSJan Høydahl    positional arguments:
4487c131baSJan Høydahl      url                   Url pointing to release to test
4587c131baSJan Høydahl      test_args             Arguments to pass to ant for testing, e.g.
4687c131baSJan Høydahl                            -Dwhat=ever.
4787c131baSJan Høydahl
4887c131baSJan Høydahl    optional arguments:
4987c131baSJan Høydahl      -h, --help            show this help message and exit
5087c131baSJan Høydahl      --tmp-dir PATH        Temporary directory to test inside, defaults to
5187c131baSJan Høydahl                            /tmp/smoke_lucene_$version_$revision
5287c131baSJan Høydahl      --not-signed          Indicates the release is not signed
5387c131baSJan Høydahl      --local-keys PATH     Uses local KEYS file instead of fetching from
5487c131baSJan Høydahl                            https://archive.apache.org/dist/lucene/KEYS
5587c131baSJan Høydahl      --revision REVISION   GIT revision number that release was built with,
5687c131baSJan Høydahl                            defaults to that in URL
5787c131baSJan Høydahl      --version X.Y.Z(-ALPHA|-BETA)?
5887c131baSJan Høydahl                            Version of the release, defaults to that in URL
5987c131baSJan Høydahl      --test-java12 JAVA12_HOME
6087c131baSJan Høydahl                            Path to Java12 home directory, to run tests with if
6187c131baSJan Høydahl                            specified
6287c131baSJan Høydahl      --download-only       Only perform download and sha hash check steps
6387c131baSJan Høydahl
6487c131baSJan Høydahl    Example usage:
65674b66ddSJan Høydahl    python3 -u dev-tools/scripts/smokeTestRelease.py https://dist.apache.org/repos/dist/dev/lucene/lucene-9.0.1-RC2-revc7510a0...
6687c131baSJan Høydahl
6787c131baSJan Høydahl### releaseWizard.py
6887c131baSJan Høydahl
6987c131baSJan HøydahlThe Release Wizard guides the Release Manager through the release process step
7087c131baSJan Høydahlby step, helping you to to run the right commands in the right order, generating
7187c131baSJan Høydahle-mail templates with the correct texts, versions, paths etc, obeying
7287c131baSJan Høydahlthe voting rules and much more. It also serves as a documentation of all the
7387c131baSJan Høydahlsteps, with timestamps, preserving log files from each command etc, showing only
7487c131baSJan Høydahlthe steps and commands required for a major/minor/bugfix release. It also lets
7587c131baSJan Høydahlyou generate a full Asciidoc guide for the release. The wizard will execute many
7687c131baSJan Høydahlof the other tools in this folder.
7787c131baSJan Høydahl
7887c131baSJan Høydahl    usage: releaseWizard.py [-h] [--dry-run] [--init]
7987c131baSJan Høydahl
8087c131baSJan Høydahl    Script to guide a RM through the whole release process
8187c131baSJan Høydahl
8287c131baSJan Høydahl    optional arguments:
8387c131baSJan Høydahl      -h, --help  show this help message and exit
8487c131baSJan Høydahl      --dry-run   Do not execute any commands, but echo them instead. Display
8587c131baSJan Høydahl                  extra debug info
8687c131baSJan Høydahl      --init      Re-initialize root and version
8787c131baSJan Høydahl
8887c131baSJan Høydahl    Go push that release!
8987c131baSJan Høydahl
9087c131baSJan Høydahl### buildAndPushRelease.py
9187c131baSJan Høydahl
9287c131baSJan Høydahl    usage: buildAndPushRelease.py [-h] [--no-prepare] [--local-keys PATH]
9387c131baSJan Høydahl                                  [--push-local PATH] [--sign KEYID]
9487c131baSJan Høydahl                                  [--rc-num NUM] [--root PATH] [--logfile PATH]
9587c131baSJan Høydahl
9687c131baSJan Høydahl    Utility to build, push, and test a release.
9787c131baSJan Høydahl
9887c131baSJan Høydahl    optional arguments:
9987c131baSJan Høydahl      -h, --help         show this help message and exit
10087c131baSJan Høydahl      --no-prepare       Use the already built release in the provided checkout
10187c131baSJan Høydahl      --local-keys PATH  Uses local KEYS file to validate presence of RM's gpg key
10287c131baSJan Høydahl      --push-local PATH  Push the release to the local path
10387c131baSJan Høydahl      --sign KEYID       Sign the release with the given gpg key
10487c131baSJan Høydahl      --rc-num NUM       Release Candidate number. Default: 1
105674b66ddSJan Høydahl      --root PATH        Root of Git working tree for lucene. Default: "."
10687c131baSJan Høydahl                         (the current directory)
10787c131baSJan Høydahl      --logfile PATH     Specify log file path (default /tmp/release.log)
10887c131baSJan Høydahl
10987c131baSJan Høydahl    Example usage for a Release Manager:
11087c131baSJan Høydahl    python3 -u dev-tools/scripts/buildAndPushRelease.py --push-local /tmp/releases/6.0.1 --sign 6E68DA61 --rc-num 1
11187c131baSJan Høydahl
11287c131baSJan Høydahl### addBackcompatIndexes.py
11387c131baSJan Høydahl
11487c131baSJan Høydahl    usage: addBackcompatIndexes.py [-h] [--force] [--no-cleanup] [--temp-dir DIR]
11587c131baSJan Høydahl                                   version
11687c131baSJan Høydahl
11787c131baSJan Høydahl    Add backcompat index and test for new version.  See:
11887c131baSJan Høydahl    http://wiki.apache.org/lucene-java/ReleaseTodo#Generate_Backcompat_Indexes
11987c131baSJan Høydahl
12087c131baSJan Høydahl    positional arguments:
12187c131baSJan Høydahl      version         Version to add, of the form X.Y.Z
12287c131baSJan Høydahl
12387c131baSJan Høydahl    optional arguments:
12487c131baSJan Høydahl      -h, --help      show this help message and exit
12587c131baSJan Høydahl      --force         Redownload the version and rebuild, even if it already
12687c131baSJan Høydahl                      exists
12787c131baSJan Høydahl      --no-cleanup    Do not cleanup the built indexes, so that they can be reused
12887c131baSJan Høydahl                      for adding to another branch
12987c131baSJan Høydahl      --temp-dir DIR  Temp directory to build backcompat indexes within
13087c131baSJan Høydahl
13187c131baSJan Høydahl### addVersion.py
13287c131baSJan Høydahl
13387c131baSJan Høydahl    usage: addVersion.py [-h] version
13487c131baSJan Høydahl
135674b66ddSJan Høydahl    Add a new version to CHANGES, to Version.java and build.gradle files
13687c131baSJan Høydahl
13787c131baSJan Høydahl    positional arguments:
13887c131baSJan Høydahl      version
13987c131baSJan Høydahl
14087c131baSJan Høydahl    optional arguments:
14187c131baSJan Høydahl      -h, --help  show this help message and exit
14287c131baSJan Høydahl
14387c131baSJan Høydahl### releasedJirasRegex.py
14487c131baSJan Høydahl
14587c131baSJan HøydahlPulls out all JIRAs mentioned at the beginning of bullet items
14687c131baSJan Høydahlunder the given version in the given CHANGES.txt file
14787c131baSJan Høydahland prints a regular expression that will match all of them
14887c131baSJan Høydahl
14987c131baSJan Høydahl    usage: releasedJirasRegex.py [-h] version changes
15087c131baSJan Høydahl
15187c131baSJan Høydahl    Prints a regex matching JIRAs fixed in the given version by parsing the given
15287c131baSJan Høydahl    CHANGES.txt file
15387c131baSJan Høydahl
15487c131baSJan Høydahl    positional arguments:
15587c131baSJan Høydahl      version     Version of the form X.Y.Z
15687c131baSJan Høydahl      changes     CHANGES.txt file to parse
15787c131baSJan Høydahl
15887c131baSJan Høydahl    optional arguments:
15987c131baSJan Høydahl      -h, --help  show this help message and exit
16087c131baSJan Høydahl
16187c131baSJan Høydahl### reproduceJenkinsFailures.py
16287c131baSJan Høydahl
16387c131baSJan Høydahl    usage: reproduceJenkinsFailures.py [-h] [--no-git] [--iters N] URL
16487c131baSJan Høydahl
165674b66ddSJan Høydahl    Must be run from a Lucene git workspace. Downloads the Jenkins
16687c131baSJan Høydahl    log pointed to by the given URL, parses it for Git revision and failed
167674b66ddSJan Høydahl    Lucene tests, checks out the Git revision in the local workspace,
16887c131baSJan Høydahl    groups the failed tests by module, then runs
16987c131baSJan Høydahl    'ant test -Dtest.dups=%d -Dtests.class="*.test1[|*.test2[...]]" ...'
17087c131baSJan Høydahl    in each module of interest, failing at the end if any of the runs fails.
17187c131baSJan Høydahl    To control the maximum number of concurrent JVMs used for each module's
17287c131baSJan Høydahl    test run, set 'tests.jvms', e.g. in ~/lucene.build.properties
17387c131baSJan Høydahl
17487c131baSJan Høydahl    positional arguments:
17587c131baSJan Høydahl      URL         Points to the Jenkins log to parse
17687c131baSJan Høydahl
17787c131baSJan Høydahl    optional arguments:
17887c131baSJan Høydahl      -h, --help  show this help message and exit
17987c131baSJan Høydahl      --no-git    Do not run "git" at all
18087c131baSJan Høydahl      --iters N   Number of iterations per test suite (default: 5)
18187c131baSJan Høydahl
18287c131baSJan Høydahl### githubPRs.py
18387c131baSJan Høydahl
18487c131baSJan Høydahl    usage: githubPRs.py [-h] [--json] [--token TOKEN]
18587c131baSJan Høydahl
18687c131baSJan Høydahl    Find open Pull Requests that need attention
18787c131baSJan Høydahl
18887c131baSJan Høydahl    optional arguments:
18987c131baSJan Høydahl      -h, --help     show this help message and exit
19087c131baSJan Høydahl      --json         Output as json
19187c131baSJan Høydahl      --token TOKEN  Github access token in case you query too often anonymously
19287c131baSJan Høydahl
19387c131baSJan Høydahl### gitignore-gen.sh
19487c131baSJan Høydahl
19587c131baSJan HøydahlTBD
19687c131baSJan Høydahl
197