Skip to content

Commit

Permalink
Replace references to versions.props, versions.lock and writeLocks
Browse files Browse the repository at this point in the history
  • Loading branch information
malliaridis committed Jan 11, 2025
1 parent e87dbbe commit 1e806d7
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore all differences in line endings for the lock file.
# Ignore all differences in line endings for lock files.
versions.lock text eol=lf
**/*.lockfile text eol=lf

# Gradle files are always in LF.
*.gradle text eol=lf
9 changes: 5 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
dependencies:
- changed-files:
- any-glob-to-any-file:
- gradle/libs.versions.toml # Solr 10+
- versions.props # Solr < v10
- versions.lock
- solr/licenses/**
- "gradle/libs.versions.toml" # Solr 10+
- "**/*.lockfile"
- "versions.props" # Solr < v10
- "versions.lock"
- "solr/licenses/**"

# Add 'documentation' label to any changes within ref-guide or dev-docs
documentation:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bin-solr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-binsolr-${{ hashFiles('versions.lock') }}
key: ${{ runner.os }}-gradle-binsolr-${{ hashFiles('**/*.lockfile') }}
restore-keys: |
${{ runner.os }}-gradle-binsolr-
${{ runner.os }}-gradle-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-docker-${{ hashFiles('versions.lock') }}
key: ${{ runner.os }}-gradle-docker-${{ hashFiles('**/*.lockfile') }}
restore-keys: |
${{ runner.os }}-gradle-docker-
${{ runner.os }}-gradle-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-precommit-${{ hashFiles('versions.lock') }}
key: ${{ runner.os }}-gradle-precommit-${{ hashFiles('**/*.lockfile') }}
restore-keys: |
${{ runner.os }}-gradle-precommit-
${{ runner.os }}-gradle-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solrj-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-solrj-${{ hashFiles('versions.lock') }}
key: ${{ runner.os }}-gradle-solrj-${{ hashFiles('**/*.lockfile') }}
restore-keys: |
${{ runner.os }}-gradle-solrj-
${{ runner.os }}-gradle-
Expand Down
4 changes: 2 additions & 2 deletions dev-docs/lucene-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ Create a new branch locally e.g. `git checkout -b lucene940 -t origin/main` for
+ org.apache.lucene:*=9.4.0
```

### `versions.lock` update
### lockfiles update

```
gradlew :writeLocks
gradlew :resolveAndLockAll
```

### `solr/licenses` update
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ of the other tools in this folder.

optional arguments:
-h, --help show this help message and exit
-l LUCENE_VERSION Optional lucene version. By default will read versions.props
-l LUCENE_VERSION Optional lucene version. By default will read gradle/libs.versions.toml

### releasedJirasRegex.py

Expand Down
4 changes: 2 additions & 2 deletions dev-tools/scripts/addVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import argparse
import re
from configparser import ConfigParser, ExtendedInterpolation
from textwrap import dedent


def update_changes(filename, new_version, init_changes, headers):
print(' adding new section to %s...' % filename, end='', flush=True)
Expand Down Expand Up @@ -115,7 +115,7 @@ def check_lucene_match_version_tests():
def read_config(current_version, current_lucene_version):
parser = argparse.ArgumentParser(description='Add a new version to CHANGES, to Version.java, build.gradle and solrconfig.xml files')
parser.add_argument('version', type=Version.parse, help='New Solr version')
parser.add_argument('-l', dest='lucene_version', type=Version.parse, help='Optional lucene version. By default will read versions.props')
parser.add_argument('-l', dest='lucene_version', type=Version.parse, help='Optional lucene version. By default will read gradle/libs.versions.toml')
newconf = parser.parse_args()
if not newconf.lucene_version:
newconf.lucene_version = current_lucene_version
Expand Down
13 changes: 8 additions & 5 deletions dev-tools/scripts/scriptutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
# limitations under the License.

import argparse
import os
import re
import subprocess
import sys
import os
from enum import Enum
import time
import urllib.request, urllib.error, urllib.parse
import urllib.error
import urllib.parse
import urllib.request
from enum import Enum


class Version(object):
def __init__(self, major, minor, bugfix, prerelease):
Expand Down Expand Up @@ -179,7 +182,7 @@ def attemptDownload(urlString, fileName):

version_prop_re = re.compile(r'baseVersion\s*=\s*([\'"])(.*)\1')

lucene_version_prop_re = re.compile(r'org\.apache\.lucene:\*=(.*?)\n')
lucene_version_prop_re = re.compile(r'^apache-lucene\s*=\s*"([a-zA-Z0-9\.\-]+)"')

def find_current_version():
script_path = os.path.dirname(os.path.realpath(__file__))
Expand All @@ -190,7 +193,7 @@ def find_current_version():
def find_current_lucene_version():
script_path = os.path.dirname(os.path.realpath(__file__))
top_level_dir = os.path.join(os.path.abspath("%s/" % script_path), os.path.pardir, os.path.pardir)
versions_file = open('%s/versions.props' % top_level_dir).read()
versions_file = open('%s/gradle/libs.versions.toml' % top_level_dir).read()
return lucene_version_prop_re.search(versions_file).group(1).strip()


Expand Down
5 changes: 3 additions & 2 deletions dev-tools/scripts/smokeTestRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import hashlib
import http.client
import os
import platform
import re
import shutil
import subprocess
Expand All @@ -35,6 +34,8 @@
import xml.etree.ElementTree as ET
import zipfile
from collections import namedtuple

import platform
import scriptutil

# This tool expects to find /solr off the base URL. You
Expand Down Expand Up @@ -626,7 +627,7 @@ def verifyUnpacked(java, artifact, unpackPath, gitRevision, version, testArgs):

if isSrc:
expected_src_root_folders = ['buildSrc', 'dev-docs', 'dev-tools', 'gradle', 'help', 'solr']
expected_src_root_files = ['build.gradle', 'gradlew', 'gradlew.bat', 'settings.gradle', 'versions.lock', 'versions.props']
expected_src_root_files = ['build.gradle', 'gradlew', 'gradlew.bat', 'settings.gradle', 'settings.gradle.lockfile']
expected_src_solr_files = ['build.gradle']
expected_src_solr_folders = ['benchmark', 'bin', 'modules', 'api', 'core', 'cross-dc-manager', 'docker', 'documentation', 'example', 'licenses', 'packaging', 'distribution', 'prometheus-exporter', 'server', 'solr-ref-guide', 'solrj', 'solrj-streaming', 'solrj-zookeeper', 'test-framework', 'webapp', '.gitignore', '.gitattributes']
is_in_list(in_root_folder, expected_src_root_folders)
Expand Down
2 changes: 1 addition & 1 deletion gradle/validation/error-prone.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ allprojects { prj ->
tasks.withType(JavaCompile) { task -> task.dependsOn ":errorProneSkipped" }

// Error prone plugin adds error prone to test classpath. We need to add it here too
// (manually) so that versions.lock is consistent with or without error prone.
// (manually) so that lockfiles are consistent with or without error prone.
configurations {
errorprone
}
Expand Down
2 changes: 1 addition & 1 deletion help/dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ If you want to upgrade Lucene to a newer build proceed like the following:
- Edit ./gradle/globals.gradle and change jenkins build number, too
(this directs the repository to the one created by latest build):
def lucenePrereleaseBuild = 'X'
- Run: gradlew writeLocks (as described before)
- Run: gradlew resolveAndLockAll (as described before)


Lucene local dependency substitution
Expand Down

0 comments on commit 1e806d7

Please sign in to comment.