diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml deleted file mode 100644 index b8d3912c5864a..0000000000000 --- a/.github/workflows/auto-release.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Releases - -on: - push: - tags: - - '*' - -jobs: - - build: - runs-on: ubuntu-latest - permissions: - contents: write - 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: Get tag - id: tag - uses: dawidd6/action-get-tag@v1 - - uses: actions/checkout@v2 - - uses: ncipollo/release-action@v1 - with: - github_token: ${{ steps.github_app_token.outputs.token }} - bodyFile: release-notes/opensearch.release-notes-${{steps.tag.outputs.tag}}.md diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index 5a75d2c877992..0000000000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Backport -on: - pull_request_target: - types: - - closed - - labeled - -jobs: - backport: - if: ${{ contains(github.event.label.name, 'backport') }} - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - name: Backport - 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: Backport - uses: VachaShah/backport@v2.1.0 - with: - github_token: ${{ steps.github_app_token.outputs.token }} - head_template: backport/backport-<%= number %>-to-<%= base %> diff --git a/.github/workflows/changelog_verifier.yml b/.github/workflows/changelog_verifier.yml deleted file mode 100644 index 992a38b624d7a..0000000000000 --- a/.github/workflows/changelog_verifier.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: "Changelog Verifier" -on: - pull_request: - types: [opened, edited, review_requested, synchronize, reopened, ready_for_review, labeled, unlabeled] - -jobs: - # Enforces the update of a changelog file on every pull request - verify-changelog: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ github.event.pull_request.head.sha }} - - - uses: dangoslen/changelog-enforcer@v3 - with: - skipLabels: "autocut, skip-changelog" diff --git a/.github/workflows/code-hygiene.yml b/.github/workflows/code-hygiene.yml deleted file mode 100644 index a1adbb8a87507..0000000000000 --- a/.github/workflows/code-hygiene.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Code Hygiene - -on: [pull_request] - -jobs: - linelint: - runs-on: ubuntu-latest - name: Check if all files end in newline - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Linelint - uses: fernandrone/linelint@0.0.4 diff --git a/.github/workflows/create-documentation-issue.yml b/.github/workflows/create-documentation-issue.yml deleted file mode 100644 index c81f7355a0d22..0000000000000 --- a/.github/workflows/create-documentation-issue.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Create Documentation Issue -on: - pull_request: - types: - - labeled -env: - PR_NUMBER: ${{ github.event.number }} - -jobs: - create-issue: - if: ${{ github.event.label.name == 'needs-documentation' }} - runs-on: ubuntu-latest - name: Create Documentation Issue - 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: Checkout code - uses: actions/checkout@v2 - - - name: Edit the issue template - run: | - echo "https://github.com/opensearch-project/OpenSearch/pull/${{ env.PR_NUMBER }}." >> ./ci/documentation/issue.md - - - name: Create Issue From File - id: create-issue - uses: peter-evans/create-issue-from-file@v4 - with: - title: Add documentation related to new feature - content-filepath: ./ci/documentation/issue.md - labels: documentation - repository: opensearch-project/documentation-website - token: ${{ steps.github_app_token.outputs.token }} - - - name: Print Issue - run: echo Created related documentation issue ${{ steps.create-issue.outputs.issue-number }} diff --git a/.github/workflows/delete_backport_branch.yml b/.github/workflows/delete_backport_branch.yml deleted file mode 100644 index 387a124b8cb6a..0000000000000 --- a/.github/workflows/delete_backport_branch.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Delete merged branch of the backport PRs -on: - pull_request: - types: - - closed - -jobs: - delete-branch: - runs-on: ubuntu-latest - if: startsWith(github.event.pull_request.head.ref,'backport/') - steps: - - name: Delete merged branch - uses: SvanBoxel/delete-merged-branch@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/dependabot_pr.yml b/.github/workflows/dependabot_pr.yml deleted file mode 100644 index ed98bae8978ed..0000000000000 --- a/.github/workflows/dependabot_pr.yml +++ /dev/null @@ -1,63 +0,0 @@ -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: Run spotless - run: | - ./gradlew spotlessApply - - - 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' diff --git a/.github/workflows/gradle-check.yml b/.github/workflows/gradle-check.yml index c29e0a71260c2..9a873807e407d 100644 --- a/.github/workflows/gradle-check.yml +++ b/.github/workflows/gradle-check.yml @@ -5,7 +5,7 @@ on: - 'backport/**' - 'create-pull-request/**' - 'dependabot/**' - pull_request_target: + pull_request: types: [opened, synchronize, reopened] permissions: @@ -26,7 +26,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} - name: Setup environment variables (PR) - if: github.event_name == 'pull_request_target' + if: github.event_name == 'pull_request' run: | echo "pr_from_sha=$(jq --raw-output .pull_request.head.sha $GITHUB_EVENT_PATH)" >> $GITHUB_ENV echo "pr_from_clone_url=$(jq --raw-output .pull_request.head.repo.clone_url $GITHUB_EVENT_PATH)" >> $GITHUB_ENV @@ -55,26 +55,18 @@ jobs: - name: Trigger jenkins workflow to run gradle check run: | - set -e - set -o pipefail - bash opensearch-build/scripts/gradle/gradle-check.sh ${{ secrets.JENKINS_GRADLE_CHECK_GENERIC_WEBHOOK_TOKEN }} | tee -a gradle-check.log + # ignore - name: Setup Result Status if: always() run: | - WORKFLOW_URL=`cat gradle-check.log | grep 'WORKFLOW_URL' | awk '{print $2}'` + WORKFLOW_URL=https://build.ci.opensearch.org/job/gradle-check/7517/ RESULT=`cat gradle-check.log | grep 'Result:' | awk '{print $2}'` echo "workflow_url=$WORKFLOW_URL" >> $GITHUB_ENV echo "result=$RESULT" >> $GITHUB_ENV - - name: Upload Coverage Report - if: success() - uses: codecov/codecov-action@v2 - with: - files: ./codeCoverage.xml - - name: Create Comment Success - if: ${{ github.event_name == 'pull_request_target' && success() && env.result == 'SUCCESS' }} + if: ${{ github.event_name == 'pull_request' && success() && env.result == 'SUCCESS' }} uses: peter-evans/create-or-update-comment@v2 with: issue-number: ${{ env.pr_number }} @@ -85,7 +77,7 @@ jobs: * **CommitID:** ${{ env.pr_from_sha }} - name: Extract Test Failure - if: ${{ github.event_name == 'pull_request_target' && env.result != 'SUCCESS' }} + if: ${{ github.event_name == 'pull_request' && env.result != 'SUCCESS' }} run: | TEST_FAILURES=`curl -s "${{ env.workflow_url }}/testReport/api/json?tree=suites\[cases\[status,className,name\]\]" | jq -r '.. | objects | select(.status=="FAILED",.status=="REGRESSION") | (.className + "." + .name)'` TEST_FAILURES_WITH_ISSUES="" @@ -109,7 +101,7 @@ jobs: fi - name: Create Comment Flaky - if: ${{ github.event_name == 'pull_request_target' && success() && env.result != 'SUCCESS' }} + if: ${{ github.event_name == 'pull_request' && success() && env.result != 'SUCCESS' }} uses: peter-evans/create-or-update-comment@v2 with: issue-number: ${{ env.pr_number }} @@ -121,7 +113,7 @@ jobs: Please review all [flaky tests](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#flaky-tests) that succeeded after retry and create an issue if one does not already exist to track the flaky failure. - name: Create Comment Failure - if: ${{ github.event_name == 'pull_request_target' && failure() }} + if: ${{ github.event_name == 'pull_request' && failure() }} uses: peter-evans/create-or-update-comment@v2 with: issue-number: ${{ env.pr_number }} diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml deleted file mode 100644 index ac94f5ef5ec5e..0000000000000 --- a/.github/workflows/links.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Link Checker -on: - schedule: - - cron: '0 0 * * *' -permissions: - contents: read # to fetch code (actions/checkout) -jobs: - linkchecker: - if: github.repository == 'opensearch-project/OpenSearch' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: lychee Link Checker - id: lychee - uses: lycheeverse/lychee-action@v1.2.0 - with: - args: --accept=200,403,429 --exclude-mail **/*.html **/*.md **/*.txt **/*.json --exclude-file .lychee.excludes - fail: true - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/lucene-snapshots.yml b/.github/workflows/lucene-snapshots.yml deleted file mode 100644 index 78e7b7b269cf4..0000000000000 --- a/.github/workflows/lucene-snapshots.yml +++ /dev/null @@ -1,59 +0,0 @@ -# This workflow will check out, build, and publish snapshots of lucene. - -name: OpenSearch Lucene snapshots - -on: - workflow_dispatch: - # Inputs the workflow accepts. - inputs: - ref: - description: - required: false - default: 'main' - -jobs: - publish-snapshots: - runs-on: ubuntu-latest - # These permissions are needed to interact with GitHub's OIDC Token endpoint. - permissions: - id-token: write - contents: read - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'adopt' - - - name: Checkout Lucene - uses: actions/checkout@v2 - with: - repository: 'apache/lucene' - path: lucene - ref: ${{ github.event.inputs.ref }} - - - name: Set hash - working-directory: ./lucene - run: | - echo "::set-output name=REVISION::$(git rev-parse --short HEAD)" - id: version - - - name: Initialize gradle settings - working-directory: ./lucene - run: ./gradlew localSettings - - - name: Publish Lucene to local maven repo. - working-directory: ./lucene - run: ./gradlew publishJarsPublicationToMavenLocal -Pversion.suffix=snapshot-${{ steps.version.outputs.REVISION }} - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ secrets.LUCENE_SNAPSHOTS_ROLE }} - aws-region: us-west-2 - - - name: Copy files to S3 with the aws CLI. - run: | - aws s3 cp ~/.m2/repository/org/apache/lucene/ s3://${{ secrets.LUCENE_SNAPSHOTS_BUCKET }}/snapshots/lucene/org/apache/lucene/ --recursive --no-progress diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml deleted file mode 100644 index e264d65cdf191..0000000000000 --- a/.github/workflows/precommit.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Gradle Precommit -on: [pull_request] - -jobs: - precommit: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: 11 - distribution: adopt - - name: Run Gradle - run: | - ./gradlew javadoc precommit --parallel diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml deleted file mode 100644 index d1b5e90484ec4..0000000000000 --- a/.github/workflows/version.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: Increment Version - -on: - push: - tags: - - '*.*.*' - -permissions: {} -jobs: - build: - runs-on: ubuntu-latest - 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 - - - uses: actions/checkout@v2 - - name: Fetch Tag and Version Information - run: | - TAG=$(echo "${GITHUB_REF#refs/*/}") - CURRENT_VERSION_ARRAY=($(echo "$TAG" | tr . '\n')) - BASE=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:2}") - BASE_X=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:1}.x") - CURRENT_VERSION=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:3}") - CURRENT_VERSION_UNDERSCORE=$(IFS=_ ; echo "V_${CURRENT_VERSION_ARRAY[*]:0:3}") - CURRENT_VERSION_ARRAY[2]=$((CURRENT_VERSION_ARRAY[2]+1)) - NEXT_VERSION=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:3}") - NEXT_VERSION_UNDERSCORE=$(IFS=_ ; echo "V_${CURRENT_VERSION_ARRAY[*]:0:3}") - NEXT_VERSION_ID=$(IFS=0 ; echo "${CURRENT_VERSION_ARRAY[*]:0:3}99") - echo "TAG=$TAG" >> $GITHUB_ENV - echo "BASE=$BASE" >> $GITHUB_ENV - echo "BASE_X=$BASE_X" >> $GITHUB_ENV - echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV - echo "CURRENT_VERSION_UNDERSCORE=$CURRENT_VERSION_UNDERSCORE" >> $GITHUB_ENV - echo "NEXT_VERSION=$NEXT_VERSION" >> $GITHUB_ENV - echo "NEXT_VERSION_UNDERSCORE=$NEXT_VERSION_UNDERSCORE" >> $GITHUB_ENV - echo "NEXT_VERSION_ID=$NEXT_VERSION_ID" >> $GITHUB_ENV - - uses: actions/checkout@v2 - with: - ref: ${{ env.BASE }} - token: ${{ steps.github_app_token.outputs.token }} - - - name: Increment Patch Version - run: | - echo Incrementing $CURRENT_VERSION to $NEXT_VERSION - echo " - \"$CURRENT_VERSION\"" >> .ci/bwcVersions - sed -i "s/opensearch = $CURRENT_VERSION/opensearch = $NEXT_VERSION/g" buildSrc/version.properties - echo Adding $NEXT_VERSION_UNDERSCORE after $CURRENT_VERSION_UNDERSCORE - sed -i "s/public static final Version $CURRENT_VERSION_UNDERSCORE = new Version(\([[:digit:]]\+\)\(.*\));/\0\n public static final Version $NEXT_VERSION_UNDERSCORE = new Version($NEXT_VERSION_ID\2);/g" server/src/main/java/org/opensearch/Version.java - sed -i "s/CURRENT = $CURRENT_VERSION_UNDERSCORE;/CURRENT = $NEXT_VERSION_UNDERSCORE;/g" server/src/main/java/org/opensearch/Version.java - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ steps.github_app_token.outputs.token }} - base: ${{ env.BASE }} - branch: 'create-pull-request/patch-${{ env.BASE }}' - commit-message: Incremented version to ${{ env.NEXT_VERSION }} - signoff: true - delete-branch: true - labels: | - autocut - title: '[AUTO] Incremented version to ${{ env.NEXT_VERSION }}.' - body: | - I've noticed that a new tag ${{ env.TAG }} was pushed, and incremented the version from ${{ env.CURRENT_VERSION }} to ${{ env.NEXT_VERSION }}. - - - uses: actions/checkout@v2 - with: - ref: ${{ env.BASE_X }} - token: ${{ steps.github_app_token.outputs.token }} - - - name: Add bwc version to .X branch - run: | - echo Adding bwc version $NEXT_VERSION after $CURRENT_VERSION - sed -i "s/- \"$CURRENT_VERSION\"/\0\n - \"$NEXT_VERSION\"/g" .ci/bwcVersions - echo Adding $NEXT_VERSION_UNDERSCORE after $CURRENT_VERSION_UNDERSCORE - sed -i "s/public static final Version $CURRENT_VERSION_UNDERSCORE = new Version(\([[:digit:]]\+\)\(.*\));/\0\n public static final Version $NEXT_VERSION_UNDERSCORE = new Version($NEXT_VERSION_ID\2);/g" server/src/main/java/org/opensearch/Version.java - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ steps.github_app_token.outputs.token }} - base: ${{ env.BASE_X }} - branch: 'create-pull-request/patch-${{ env.BASE_X }}' - commit-message: Added bwc version ${{ env.NEXT_VERSION }} - signoff: true - delete-branch: true - labels: | - autocut - title: '[AUTO] [${{ env.BASE_X }}] Added bwc version ${{ env.NEXT_VERSION }}.' - body: | - I've noticed that a new tag ${{ env.TAG }} was pushed, and added a bwc version ${{ env.NEXT_VERSION }}. - - - uses: actions/checkout@v2 - with: - ref: main - token: ${{ steps.github_app_token.outputs.token }} - - - name: Add bwc version to main branch - run: | - echo Adding bwc version $NEXT_VERSION after $CURRENT_VERSION - sed -i "s/- \"$CURRENT_VERSION\"/\0\n - \"$NEXT_VERSION\"/g" .ci/bwcVersions - echo Adding $NEXT_VERSION_UNDERSCORE after $CURRENT_VERSION_UNDERSCORE - sed -i "s/public static final Version $CURRENT_VERSION_UNDERSCORE = new Version(\([[:digit:]]\+\)\(.*\));/\0\n public static final Version $NEXT_VERSION_UNDERSCORE = new Version($NEXT_VERSION_ID\2);/g" server/src/main/java/org/opensearch/Version.java - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ steps.github_app_token.outputs.token }} - base: main - branch: 'create-pull-request/patch-main' - commit-message: Added bwc version ${{ env.NEXT_VERSION }} - signoff: true - delete-branch: true - labels: | - autocut - title: '[AUTO] [main] Added bwc version ${{ env.NEXT_VERSION }}.' - body: | - I've noticed that a new tag ${{ env.TAG }} was pushed, and added a bwc version ${{ env.NEXT_VERSION }}. diff --git a/.github/workflows/wrapper.yml b/.github/workflows/wrapper.yml deleted file mode 100644 index c3e0aae98cde2..0000000000000 --- a/.github/workflows/wrapper.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Validate Gradle Wrapper -on: [pull_request] - -jobs: - validate: - name: Validate - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: gradle/wrapper-validation-action@v1