Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from buildSrc/version.properties to Gradle version catalog (gradle/libs.versions.toml) to enable dependabot to perform automated upgrades on common libs #16284

Merged
merged 45 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
92dd2c4
WIP on lib toml
cwperks Oct 10, 2024
dacf648
SpotlessApply
cwperks Oct 10, 2024
221104d
Remove unnecessary lines
cwperks Oct 10, 2024
9bc3d4a
Merge branch 'lib-toml'
cwperks Oct 10, 2024
bd62395
Specify time when dependabot runs
cwperks Oct 10, 2024
3964cd9
Refer to version from libs.versions.toml
cwperks Oct 11, 2024
04d54b7
Use version
cwperks Oct 11, 2024
544d2cd
Specify version catalog
cwperks Oct 11, 2024
1d2d54a
Call .get()
cwperks Oct 11, 2024
43399ff
Define version catalog
cwperks Oct 11, 2024
aaee06f
Merge branch 'main' into lib-toml
cwperks Oct 11, 2024
07e7d1b
Use libraries
cwperks Oct 11, 2024
0103e32
Downgrade purposefully
cwperks Oct 11, 2024
fc10d68
Add mavenCentral
cwperks Oct 11, 2024
3295154
Try w/o libraries section
cwperks Oct 11, 2024
fc78a4c
reinstate
cwperks Oct 11, 2024
5a8f3d3
Merge branch 'main' into lib-toml
cwperks Oct 11, 2024
f3bbf06
Remove version.properties
cwperks Oct 11, 2024
c49df2d
Merge branch 'main' into lib-toml
cwperks Oct 11, 2024
2806f96
Update syntax
cwperks Oct 11, 2024
85856b1
Change back to weekly
cwperks Oct 11, 2024
724db17
Add grpc
cwperks Oct 11, 2024
c831360
Get relative to project root. Relative path not working on windows bc…
cwperks Oct 11, 2024
49ec14a
Add minimal version.properties with only opensearch version to accomm…
cwperks Oct 11, 2024
41d3ab8
singularize version.properties
cwperks Oct 11, 2024
6ea86b6
Get rootDir
cwperks Oct 12, 2024
06840e2
Fix issue loading snapshot
cwperks Oct 12, 2024
11b496a
Limit logic to generating version.properties file within buildSrc
cwperks Oct 16, 2024
8cc8f8b
Merge branch 'lib-toml' of https://github.com/cwperks/OpenSearch into…
cwperks Oct 16, 2024
553efe3
Remove unused exports
cwperks Oct 16, 2024
6f553ab
Add import
cwperks Oct 16, 2024
73e2d04
Remove unused code
cwperks Oct 16, 2024
f8b1fa0
Remove mavenCentral from publication section
cwperks Oct 16, 2024
8e5eb4b
Add to CHANGELOG
cwperks Oct 16, 2024
b9e799d
Merge branch 'main' into lib-toml
cwperks Oct 16, 2024
86f5c9b
Merge branch 'main' into lib-toml
cwperks Oct 17, 2024
eafb25e
Update reactor-netty version
cwperks Oct 17, 2024
4ad21d2
Merge branch 'main' into lib-toml
cwperks Oct 18, 2024
5003c97
Only keep versions section in toml
cwperks Oct 18, 2024
7edba63
Replaces versions catalog TOML parsing with Gradle's VersionCatalogsE…
reta Oct 18, 2024
2d89564
Merge branch 'main' into lib-toml
cwperks Oct 24, 2024
4b2b989
Update bundled_jdk
cwperks Oct 24, 2024
ef776e2
Merge branch 'lib-toml' of https://github.com/cwperks/OpenSearch into…
cwperks Oct 24, 2024
e07253e
Update bytebuddy and mockito
cwperks Oct 24, 2024
51e3d5b
Merge branch 'main' into lib-toml
dblock Oct 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Add support for restoring from snapshot with search replicas ([#16111](https://github.com/opensearch-project/OpenSearch/pull/16111))
- Add logic in master service to optimize performance and retain detailed logging for critical cluster operations. ([#14795](https://github.com/opensearch-project/OpenSearch/pull/14795))
- Add Setting to adjust the primary constraint weights ([#16471](https://github.com/opensearch-project/OpenSearch/pull/16471))
- Switch from `buildSrc/version.properties` to Gradle version catalog (`gradle/libs.versions.toml`) to enable dependabot to perform automated upgrades on common libs ([#16284](https://github.com/opensearch-project/OpenSearch/pull/16284))

### Dependencies
- Bump `com.azure:azure-identity` from 1.13.0 to 1.13.2 ([#15578](https://github.com/opensearch-project/OpenSearch/pull/15578))
Expand Down
20 changes: 12 additions & 8 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (project == rootProject) {
// we update the version property to reflect if we are building a snapshot or a release build
// we write this back out below to load it in the Build.java which will be shown in rest main action
// to indicate this being a snapshot build or a release build.
Properties props = VersionPropertiesLoader.loadBuildSrcVersion(project.file('version.properties'))
Properties props = VersionPropertiesLoader.loadBuildSrcVersion(project)
version = props.getProperty("opensearch")

def generateVersionProperties = tasks.register("generateVersionProperties", WriteProperties) {
Expand Down Expand Up @@ -287,15 +287,19 @@ if (project != rootProject) {
}
}

// Define this here because we need it early.
// Define this here because we need it early. It uses VersionCatalogsExtension to extract all versions
// and converts to a Java Properties object
class VersionPropertiesLoader {
static Properties loadBuildSrcVersion(File input) throws IOException {
static Properties loadBuildSrcVersion(Project project) throws IOException {
Properties props = new Properties();
InputStream is = new FileInputStream(input)
try {
props.load(is)
} finally {
is.close()

var catalogs = project.extensions.getByType(VersionCatalogsExtension)
var libs = catalogs.named("libs")
libs.getVersionAliases().forEach {
libs.findVersion(it).ifPresent { v ->
// Gradle replaces '_' with '.' so 'google_http_client' becomes 'google.http.client' instead
props.setProperty(it.replaceAll("[.]", "_"), v.requiredVersion)
}
}
loadBuildSrcVersion(props, System.getProperties())
return props
Expand Down
8 changes: 8 additions & 0 deletions buildSrc/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@
*/

include 'reaper'

dependencyResolutionManagement {
versionCatalogs {
libs {
from(files("../gradle/libs.versions.toml"))
}
}
}
79 changes: 1 addition & 78 deletions buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,79 +1,2 @@
# Please use ../gradle/libs.versions.toml for dependency management
opensearch = 3.0.0
reta marked this conversation as resolved.
Show resolved Hide resolved
lucene = 9.12.0

bundled_jdk_vendor = adoptium
bundled_jdk = 23.0.1+11

# optional dependencies
spatial4j = 0.7
jts = 1.15.0
jackson = 2.17.2
jackson_databind = 2.17.2
snakeyaml = 2.1
icu4j = 75.1
supercsv = 2.4.0
log4j = 2.21.0
slf4j = 1.7.36
asm = 9.7
jettison = 1.5.4
woodstox = 6.4.0
kotlin = 1.7.10
antlr4 = 4.13.1
guava = 32.1.1-jre
protobuf = 3.25.5
jakarta_annotation = 1.3.5
google_http_client = 1.44.1
tdigest = 3.3
hdrhistogram = 2.2.2
grpc = 1.68.0

# when updating the JNA version, also update the version in buildSrc/build.gradle
jna = 5.13.0

netty = 4.1.114.Final
joda = 2.12.7

# project reactor
reactor_netty = 1.1.23
reactor = 3.5.20

# client dependencies
httpclient5 = 5.3.1
httpcore5 = 5.2.5
httpclient = 4.5.14
httpcore = 4.4.16
httpasyncclient = 4.1.5
commonslogging = 1.2
commonscodec = 1.16.1
commonslang = 3.14.0
commonscompress = 1.26.1
commonsio = 2.16.0
# plugin dependencies
aws = 2.20.86
reactivestreams = 1.0.4

# when updating this version, you need to ensure compatibility with:
# - plugins/ingest-attachment (transitive dependency, check the upstream POM)
# - distribution/tools/plugin-cli
bouncycastle=1.78
# test dependencies
randomizedrunner = 2.7.1
junit = 4.13.2
hamcrest = 2.1
mockito = 5.14.1
objenesis = 3.2
bytebuddy = 1.15.4

# benchmark dependencies
jmh = 1.35

# compression
zstd = 1.5.5-5

jzlib = 1.1.3

resteasy = 6.2.4.Final

# opentelemetry dependencies
opentelemetry = 1.41.0
opentelemetrysemconv = 1.27.0-alpha
80 changes: 80 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[versions]
opensearch = "3.0.0"
lucene = "9.12.0"

bundled_jdk_vendor = "adoptium"
bundled_jdk = "23.0.1+11"

# optional dependencies
spatial4j = "0.7"
jts = "1.15.0"
jackson = "2.17.2"
jackson_databind = "2.17.2"
snakeyaml = "2.1"
icu4j = "75.1"
supercsv = "2.4.0"
log4j = "2.21.0"
slf4j = "1.7.36"
asm = "9.7"
jettison = "1.5.4"
woodstox = "6.4.0"
kotlin = "1.7.10"
antlr4 = "4.13.1"
guava = "32.1.1-jre"
protobuf = "3.25.5"
jakarta_annotation = "1.3.5"
google_http_client = "1.44.1"
tdigest = "3.3"
hdrhistogram = "2.2.2"
grpc = "1.68.0"

# when updating the JNA version, also update the version in buildSrc/build.gradle
jna = "5.13.0"

netty = "4.1.114.Final"
joda = "2.12.7"

# project reactor
reactor_netty = "1.1.23"
reactor = "3.5.20"

# client dependencies
httpclient5 = "5.3.1"
httpcore5 = "5.2.5"
httpclient = "4.5.14"
httpcore = "4.4.16"
httpasyncclient = "4.1.5"
commonslogging = "1.2"
commonscodec = "1.16.1"
commonslang = "3.14.0"
commonscompress = "1.26.1"
commonsio = "2.16.0"
# plugin dependencies
aws = "2.20.86"
reactivestreams = "1.0.4"

# when updating this version, you need to ensure compatibility with:
# - plugins/ingest-attachment (transitive dependency, check the upstream POM)
# - distribution/tools/plugin-cli
bouncycastle="1.78"
# test dependencies
randomizedrunner = "2.7.1"
junit = "4.13.2"
hamcrest = "2.1"
mockito = "5.14.1"
objenesis = "3.2"
bytebuddy = "1.15.4"

# benchmark dependencies
jmh = "1.35"

# compression
zstd = "1.5.5-5"

jzlib = "1.1.3"

resteasy = "6.2.4.Final"

# opentelemetry dependencies
opentelemetry = "1.41.0"
opentelemetrysemconv = "1.27.0-alpha"
Loading