Skip to content

Commit

Permalink
Manual master cherrypick into 2.x (#550)
Browse files Browse the repository at this point in the history
* Adding new OpenSearch versions and updating compatibility matrix (#257)

Signed-off-by: Vacha Shah <[email protected]>
  • Loading branch information
AMoo-Miki authored Jul 12, 2023
1 parent a9e4828 commit 423c599
Show file tree
Hide file tree
Showing 186 changed files with 8,090 additions and 2,549 deletions.
56 changes: 56 additions & 0 deletions .ci/license/check-license-headers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
# Copyright OpenSearch Contributors
# 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.

# Check that source code files in this repo have the appropriate license
# header.

if [ "$TRACE" != "" ]; then
export PS4='${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
set -o xtrace
fi
set -o errexit
set -o pipefail

TOP=$(cd "$(dirname "$0")/.." >/dev/null && pwd)
NLINES_SC=$(wc -l ./.ci/license/license-sc.txt | awk '{print $1}')
NLINES_MC=$(wc -l ./.ci/license/license-mc.txt | awk '{print $1}')

echo $NLINES_SC
echo $NLINES_MC

function check_license_header {
local fP
f=$1
if (diff -a --strip-trailing-cr license/license-mc.txt <(head -$NLINES_MC "$f") >/dev/null) || (diff -a --strip-trailing-cr license/license-sc.txt <(head -$NLINES_SC "$f") >/dev/null); then
return 0
else
echo "check-license-headers: error: '$f' does not have required license header, see 'diff -u ./.ci/license/license-mc.txt <(head -$NLINES_MC ../$f)'"
return 1
fi
}

cd "$TOP"
nErrors=0

for f in $(git ls-files --directory ../ | grep '\.ts$' | grep -v '^docs/'); do
if ! check_license_header $f; then
nErrors=$((nErrors+1))
fi
done

for f in $(git ls-files --directory ../ | grep '\.js$' | grep -v '^docs/'); do
if ! check_license_header $f; then
nErrors=$((nErrors+1))
fi
done

if [[ $nErrors -eq 0 ]]; then
exit 0
else
exit 1
fi
9 changes: 9 additions & 0 deletions .ci/license/license-mc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright OpenSearch Contributors
* 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.
*
*/
6 changes: 6 additions & 0 deletions .ci/license/license-sc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright OpenSearch Contributors
// 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.
7 changes: 0 additions & 7 deletions .ci/opendistro/Dockerfile.opendistro

This file was deleted.

16 changes: 0 additions & 16 deletions .ci/opendistro/docker-compose.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .ci/opensearch/Dockerfile.opensearch
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ ARG opensearch_path=/usr/share/opensearch
ARG opensearch_yml=$opensearch_path/config/opensearch.yml

ARG SECURE_INTEGRATION

HEALTHCHECK --start-period=20s --interval=5s --retries=2 --timeout=1s \
CMD if [ "$SECURE_INTEGRATION" != "true" ]; \
then curl --fail localhost:9200/_cat/health; \
else curl --fail -k https:/localhost:9200/_cat/health -u admin:admin; fi

RUN if [ "$SECURE_INTEGRATION" != "true" ] ; then $opensearch_path/bin/opensearch-plugin remove opensearch-security; fi
12 changes: 12 additions & 0 deletions .ci/opensearch/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: '3'

services:
opensearch:
restart: always
build:
context: .
dockerfile: Dockerfile.opensearch
Expand All @@ -11,6 +12,17 @@ services:
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- SECURE_INTEGRATION=${SECURE_INTEGRATION:-false}
ports:
- '9200:9200'
user: opensearch
autoheal:
restart: always
image: willfarrell/autoheal
environment:
- AUTOHEAL_CONTAINER_LABEL=all
- AUTOHEAL_START_PERIOD=30
- AUTOHEAL_INTERVAL=5
- AUTOHEAL_DEFAULT_STOP_TIMEOUT=30
volumes:
- /var/run/docker.sock:/var/run/docker.sock
18 changes: 13 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"eslint:recommended",
"prettier"
],
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false
},
"plugins": [
"prettier"
],
Expand All @@ -18,9 +21,14 @@
"endOfLine": "auto"
}
],
/*temporarily turn off no-unused-vars, open an issue to track https://github.com/opensearch-project/opensearch-js/issues/241*/
"no-unused-vars": "off",
/*temporarily turn off no-dupe-else-if, open an issue to track https://github.com/opensearch-project/opensearch-js/issues/240*/
"no-dupe-else-if": "off"
"no-dupe-else-if": "off",
"no-unused-vars": [
"error",
{
"varsIgnorePattern": "^_.*",
"argsIgnorePattern": "^_.*"
}
]
}
}
}
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
updates:
- directory: /
open-pull-requests-limit: 3
package-ecosystem: npm
schedule:
interval: weekly
labels:
- "dependabot"
- "dependencies"
version: 2
19 changes: 19 additions & 0 deletions .github/workflows/add-untriaged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Apply 'untriaged' label during issue lifecycle

on:
issues:
types: [opened, reopened, transferred]

jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['untriaged']
})
18 changes: 18 additions & 0 deletions .github/workflows/changelog_verifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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"
44 changes: 44 additions & 0 deletions .github/workflows/dependabot_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Dependabot PR actions
on:
pull_request:
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

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/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780

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

- name: Update the changelog
uses: dangoslen/dependabot-changelog-helper@v2
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: [email protected]
commit_options: '--signoff'
33 changes: 33 additions & 0 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Docs to Github Pages
on:
workflow_dispatch:
push:
branches: [main]
jobs:
update-docs:
runs-on: ubuntu-latest
name: Update gh-pages with docs
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
ruby-version: 16.x
- name: Install Tools
run: |
sudo apt install -y jq
npm install -g jsdoc
- name: Generate Docs
run: |
export PACKAGE_VERSION=$(jq .version package.json -r | awk -F. '{print $1"."$2}')
export DOC_FOLDER=docs/$PACKAGE_VERSION
jsdoc api lib -d $DOC_FOLDER -r --readme README.md
cp *.md $DOC_FOLDER
cp *.txt $DOC_FOLDER
cp OpenSearch.svg $DOC_FOLDER
- name: Deploy Docs to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
keep_files: true
enable_jekyll: true
14 changes: 14 additions & 0 deletions .github/workflows/license-header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: License headers

on: [push, pull_request]

jobs:
licenseheader:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Check license headers
run: "./.ci/license/check-license-headers.sh"
24 changes: 24 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Link Checker
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
linkchecker:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: lychee Link Checker
id: lychee
uses: lycheeverse/[email protected]
with:
args: --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" --exclude "file:///github/workspace/*" --exclude-mail
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: true
generate_release_notes: true
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ opensearch*
!opensearch_dashboards*
!opensearchDashboards*

# documentation
docs/

# temporary
tmp/

test/benchmarks/macro/fixtures/*

*-junit.xml
Expand Down
Loading

0 comments on commit 423c599

Please sign in to comment.