Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 0 additions & 29 deletions .github/workflows/auto-release.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/backport.yml

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v4
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Build and Test
run: |
Expand All @@ -50,7 +50,7 @@ jobs:
./gradlew publishToMavenLocal"

- name: Upload Coverage Report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -61,17 +61,17 @@ jobs:
- 11
- 17
- 21
- 23
name: Build and Test
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: temurin
java-version: ${{ matrix.java }}

- name: Build and Test
Expand All @@ -83,7 +83,7 @@ jobs:
./gradlew publishToMavenLocal

- name: Upload Coverage Report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}

15 changes: 0 additions & 15 deletions .github/workflows/delete_backport_branch.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
contents: write

steps:
- uses: actions/setup-java@v3
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: temurin # Temurin is a distribution of adoptium
distribution: temurin
java-version: 17
- uses: actions/checkout@v3
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Load secret
uses: 1password/load-secrets-action@70062d7a876d3eb6334754fa26efd2fbd90c32f2 # v5.0.1
Expand All @@ -36,7 +36,7 @@ jobs:
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v5
uses: aws-actions/configure-aws-credentials@cbe3b392738ccf3f987d68400dafcf4b0624a56c # v6.2.4
with:
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
aws-region: us-east-1
Expand Down
26 changes: 24 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}"
// classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.20.0-RC1"
// Spotless 8.10.x requires a Java 17+ runtime to resolve its plugin. Only put it on the
// buildscript classpath on Java 17+ so the Java 11 CI matrix doesn't fail resolving it.
// The plugin is applied (also gated to Java 17+) further below only when available.
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
classpath "com.diffplug.spotless:spotless-plugin-gradle:8.10.1"
}
}
}

plugins {
id 'java-library'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.22.0'
}

repositories {
Expand Down Expand Up @@ -110,15 +115,32 @@ test {
}
}

// Spotless 8.10.x (the pinned Eclipse-JDT toolchain) requires a Java 17+ runtime to even
// resolve/apply its Gradle plugin. Skip it on older JDKs (e.g. the Java 11 CI matrix) so
// non-spotless builds don't fail at configuration time. Formatting still runs on Java 17+.
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
apply plugin: 'com.diffplug.spotless'

// Only wire the Eclipse JDT step when a spotless task is actually being run, so non-spotless
// Gradle invocations don't provision the formatter at configuration time.
def runningSpotlessTask = gradle.startParameter.taskNames.any { it.toLowerCase(Locale.ROOT).contains('spotless') }

spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'
licenseHeaderFile 'spotless.license.java'

eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://ci.opensearch.org/")).configFile rootProject.file('.eclipseformat.xml')
// Pin 4.27 explicitly: spotless 8.10.0+ ships an embedded lockfile for it, so the
// formatter resolves from Maven Central through the mirror below instead of querying a
// P2 update site at configuration time. 4.27 keeps the formatting identical to the
// eclipse() default of the previous spotless 6.22.0 this branch used.
if (runningSpotlessTask) {
eclipse('4.27').withP2Mirrors(Map.of("https://download.eclipse.org/", "https://ci.opensearch.org/")).configFile rootProject.file('.eclipseformat.xml')
}
}
}
}

// TODO: enable detekt only when snakeyaml vulnerability is fixed
/*detekt {
Expand Down
Loading