Skip to content

Commit

Permalink
Import the latest main branch.
Browse files Browse the repository at this point in the history
Signed-off-by: huuyafwww <huuya1234fwww@gmail.com>
  • Loading branch information
huuyafwww committed Apr 15, 2023
1 parent 4c555fd commit 7753ef9
Show file tree
Hide file tree
Showing 200 changed files with 12,703 additions and 5,378 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": "^_.*"
}
]
}
}
}
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# This should match the team set up in https://github.com/orgs/opensearch-project/teams and include any additional contributors
* @opensearch-project/clients
* @ananzh @kavilla @seanneumann @dblock @VachaShah @nhtruong @harshavamsi
33 changes: 0 additions & 33 deletions .github/ISSUE_TEMPLATE/BUG_TEMPLATE.md

This file was deleted.

19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md

This file was deleted.

23 changes: 0 additions & 23 deletions .github/ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md

This file was deleted.

7 changes: 0 additions & 7 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
### Description

[Describe what this change achieves]
_Describe what this change achieves._

### Issues Resolved

[List any issues this PR will resolve]
_List any issues this PR will resolve, e.g. Closes [...]._

### Check List

- [ ] New functionality includes testing.
- [ ] All tests pass
- [ ] New functionality has been documented.
- [ ] New functionality has javadoc added
- [ ] Linter check was successfull - `yarn run lint` doesn't show any errors
- [ ] Commits are signed per the DCO using --signoff
- [ ] Changelog was updated.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).
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: 11 additions & 7 deletions .github/workflows/bundler.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
name: Bundler

on: [push, pull_request]
# trigger on every commit push and PR for all branches
push:
branches: ['**']
paths-ignore:
- '**/*.md'
pull_request:
branches: ['**']
paths-ignore:
- '**/*.md'

jobs:
bundler-support:
name: Bundler support
runs-on: ubuntu-latest

strategy:
matrix:
cluster: ['opendistro', 'opensearch']

steps:
- uses: actions/checkout@v2

Expand All @@ -21,9 +25,9 @@ jobs:
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs ${{ matrix.cluster }} cluster
- name: Runs OpenSearch cluster
run: |
make cluster.clean cluster.${{ matrix.cluster }}.build cluster.${{ matrix.cluster }}.start
make cluster.clean cluster.opensearch.build cluster.opensearch.start
- name: Use Node.js 14.x
uses: actions/setup-node@v1
Expand Down
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"
Loading

0 comments on commit 7753ef9

Please sign in to comment.