Skip to content
Merged
7 changes: 7 additions & 0 deletions .github/.codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.codecov.com/docs/codecov-yaml
coverage:
status:
project:
default:
# https://docs.codecov.com/docs/commit-status#target
target: auto # coverage must be equal or above the previous commit
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Dependabot
updates:
- directory: /
open-pull-requests-limit: 1
package-ecosystem: gradle
schedule:
interval: daily
labels:
- "dependabot"
- "dependencies"
version: 2
32 changes: 9 additions & 23 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
java: [11, 17]
os: [ubuntu-latest, macos-latest] # want to get the build running first; fixing windows build after- windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]

name: Build and Test Search Request Processor Plugin
runs-on: ${{ matrix.os }}
Expand All @@ -30,34 +30,20 @@ jobs:
with:
java-version: ${{ matrix.java }}

- name: Run build
- name: Run build Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
./gradlew.bat build

- name: Run non-Windows
if: ${{ matrix.os != 'windows-latest' }}
run: |
./gradlew build

- name: Upload Coverage Report
if: startsWith(matrix.os,'ubuntu')
if: ${{matrix.os}} == 'ubuntu'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

# Build-search-request-processor-Windows:
# strategy:
# matrix:
# java: [ 11, 17 ]
#
# name: Build and Test Search Request Processor Plugin on Windows
# runs-on: windows-latest

# steps:
# - name: Checkout Search Request Processor
# uses: actions/checkout@v1

# - name: Setup Java ${{ matrix.java }}
# uses: actions/setup-java@v1
# with:
# java-version: ${{ matrix.java }}
#
# - name: Run build
# run: |
# ./gradlew.bat build

59 changes: 59 additions & 0 deletions .github/workflows/dependabot_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Dependabot PR actions
on: pull_request

jobs:
dependabot:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/github-app-token@v1.5.0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780

- name: Check out code
uses: actions/checkout@v2
with:
token: ${{ steps.github_app_token.outputs.token }}

- name: Update Gradle SHAs
run: |
./gradlew updateSHAs

- name: Commit the changes
uses: stefanzweifel/git-auto-commit-action@v4.7.2
with:
commit_message: Updating SHAs
branch: ${{ github.head_ref }}
commit_user_name: dependabot[bot]
commit_user_email: support@github.com
commit_options: '--signoff'

- name: Commit the changes
uses: stefanzweifel/git-auto-commit-action@v4.7.2
with:
commit_message: Spotless formatting
branch: ${{ github.head_ref }}
commit_user_name: dependabot[bot]
commit_user_email: support@github.com
commit_options: '--signoff'

- name: Update the changelog
uses: dangoslen/dependabot-changelog-helper@v1
with:
version: 'Unreleased'

- name: Commit the changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update changelog"
branch: ${{ github.head_ref }}
commit_user_name: dependabot[bot]
commit_user_email: support@github.com
commit_options: '--signoff'
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apply plugin: 'idea'
apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.pluginzip'
apply plugin: 'jacoco'

group = 'org.opensearch'

Expand Down Expand Up @@ -89,6 +90,7 @@ dependencies {

test {
include '**/*Tests.class'
finalizedBy jacocoTestReport
}

task integTest(type: RestIntegTestTask) {
Expand Down Expand Up @@ -125,6 +127,15 @@ sourceSets {
}
}


jacocoTestReport {
reports {
xml.enabled = true
html.enabled = false
}
dependsOn test
}

// TODO: Enable these checks
dependencyLicenses.enabled = false
thirdPartyAudit.enabled = false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
package org.opensearch.search.relevance.transformer.kendraintelligentranking.configuration;

import org.junit.Test;
import org.opensearch.test.OpenSearchTestCase;

import java.io.IOException;

public class KendraIntelligentRankingConfigurationTests extends OpenSearchTestCase {
public void testParseWithNullParserAndContext() {
try {
KendraIntelligentRankingConfiguration.parse(null, null);
fail();
} catch (NullPointerException | IOException e) {
}
}
}