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

[2.x] Lucene 9.9.1 Upgrade #99

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
51 changes: 51 additions & 0 deletions .github/actions/create-bwc-build/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Create a backwards compatible ready build'
description: 'Checkouts the official version of a the custom-codecs plugin and builds it so it can be used for BWC tests'

inputs:
plugin-branch:
description: 'The branch of the plugin that should be built, e.g "2.2", "1.x"'
required: true

outputs:
built-version:
description: 'The version of OpenSearch that was associated with this branch'
value: ${{ steps.get-opensearch-version.outputs.version }}

runs:
using: "composite"
steps:
- name: Enable Longpaths if on Windows
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
shell: pwsh

- name: Checkout Branch from Fork
if: ${{ inputs.plugin-branch == 'current_branch' }}
uses: actions/checkout@v2
with:
path: ${{ inputs.plugin-branch }}

- uses: actions/checkout@v3
if: ${{ inputs.plugin-branch != 'current_branch' }}
with:
repository: opensearch-project/custom-codecs
ref: ${{ inputs.plugin-branch }}
path: ${{ inputs.plugin-branch }}

- name: Build
uses: gradle/gradle-build-action@v2
with:
cache-disabled: true
arguments: assemble
build-root-directory: ${{ inputs.plugin-branch }}

- id: get-opensearch-version
uses: peternied/get-opensearch-version@v1
with:
working-directory: ${{ inputs.plugin-branch }}

- name: Copy current distro into the expected folder
run: |
mkdir -p ./bwc-test/src/test/resources/${{ steps.get-opensearch-version.outputs.version }}
cp ${{ inputs.plugin-branch }}/build/distributions/opensearch-custom-codecs-${{ steps.get-opensearch-version.outputs.version }}-SNAPSHOT.zip ./bwc-test/src/test/resources/${{ steps.get-opensearch-version.outputs.version }}
shell: bash
57 changes: 57 additions & 0 deletions .github/actions/run-bwc-suite/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Runs the backward compatiblity test suite'
description: 'Tests backwards compability between a previous and next version of this plugin'

inputs:
plugin-previous-branch:
description: 'The branch of the plugin that should be built for the previous version, e.g "2.2", "1.x"'
required: true

plugin-next-branch:
description: 'The branch of the plugin that should be built for the next version, e.g "2.3", "main"'
required: true

report-artifact-name:
description: 'The name of the artifacts for this run, e.g. "BWC-2.1-to-2.4-results"'
required: true

username:
description: 'Username to use for cluster health check in testClusters'
required: true

password:
description: 'Password to use for cluster health check in testClusters'
required: true

runs:
using: "composite"
steps:

- id: build-previous
uses: ./.github/actions/create-bwc-build
with:
plugin-branch: ${{ inputs.plugin-previous-branch }}

- id: build-next
uses: ./.github/actions/create-bwc-build
with:
plugin-branch: ${{ inputs.plugin-next-branch }}

- name: Run BWC tests
uses: gradle/gradle-build-action@v2
with:
cache-disabled: true
arguments: |
-p bwc-test
bwcTestSuite
-Dtests.security.manager=true
-Dtests.opensearch.username=${{ inputs.username }}
-Dtests.opensearch.password=${{ inputs.password }}
-Dbwc.version.previous=${{ steps.build-previous.outputs.built-version }}
-Dbwc.version.next=${{ steps.build-next.outputs.built-version }} -i

- uses: alehechka/upload-tartifact@v2
if: always()
with:
name: ${{ inputs.report-artifact-name }}
path: |
./bwc-test/build/reports/
125 changes: 125 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: CI
sarthakaggarwal97 marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches:
- main
sarthakaggarwal97 marked this conversation as resolved.
Show resolved Hide resolved
- 2.*
pull_request:

env:
GRADLE_OPTS: -Dhttp.keepAlive=true
CI_ENVIRONMENT: normal

jobs:
generate-test-list:
sarthakaggarwal97 marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
outputs:
separateTestsNames: ${{ steps.set-matrix.outputs.separateTestsNames }}
steps:
- name: Set up JDK for build and test
uses: actions/setup-java@v4
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 17

- name: Checkout custom-codecs
uses: actions/checkout@v4

- name: Generate list of tasks
id: set-matrix
run: |
echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT

test:
sarthakaggarwal97 marked this conversation as resolved.
Show resolved Hide resolved
name: test
needs: generate-test-list
strategy:
fail-fast: false
matrix:
gradle_task: ${{ fromJson(needs.generate-test-list.outputs.separateTestsNames) }}
platform: [windows-latest, ubuntu-latest]
jdk: [11, 17, 21]
runs-on: ${{ matrix.platform }}

steps:
- name: Set up JDK for build and test
uses: actions/setup-java@v4
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: ${{ matrix.jdk }}

- name: Checkout custom-codecs
uses: actions/checkout@v4

- name: Build and Test
uses: gradle/gradle-build-action@v2
with:
cache-disabled: true
arguments: |
${{ matrix.gradle_task }} -Dbuild.snapshot=false

- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.platform }}-JDK${{ matrix.jdk }}-${{ matrix.gradle_task }}-reports
path: |
./build/reports/

backward-compatibility-build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-java@v4
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 17

- name: Checkout custom-codecs Repo
uses: actions/checkout@v4

- name: Build BWC tests
uses: gradle/gradle-build-action@v2
with:
cache-disabled: true
arguments: |
-p bwc-test build -x test -x integTest

backward-compatibility:
strategy:
fail-fast: false
matrix:
jdk: [11, 17]
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/setup-java@v4
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: ${{ matrix.jdk }}

- name: Checkout custom-codecs Repo
uses: actions/checkout@v4

- id: build-previous
uses: ./.github/actions/run-bwc-suite
with:
plugin-previous-branch: "2.11"
plugin-next-branch: "current_branch"
report-artifact-name: bwc-${{ matrix.platform }}-jdk${{ matrix.jdk }}
username: admin
password: admin

code-ql:
sarthakaggarwal97 marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 11
- uses: github/codeql-action/init@v3
with:
languages: java
- run: ./gradlew clean assemble
- uses: github/codeql-action/analyze@v3
Loading
Loading