From a9e48283ffe3c49ef68c2e2ceb891e7b4abc722c Mon Sep 17 00:00:00 2001 From: Miki Date: Wed, 12 Jul 2023 10:51:11 -0700 Subject: [PATCH] Sync workflows with `main` (#549) Signed-off-by: Miki --- .github/CODEOWNERS | 3 +- .github/ISSUE_TEMPLATE/BUG_TEMPLATE.md | 33 -------- .../FEATURE_REQUEST_TEMPLATE.md | 19 ----- .github/ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md | 23 ------ .github/ISSUE_TEMPLATE/config.yml | 7 -- .github/PULL_REQUEST_TEMPLATE.md | 8 +- .github/workflows/bundler.yml | 32 ++++++-- .github/workflows/compatibility.yml | 18 +++- .github/workflows/coverage.yml | 25 +++++- .github/workflows/integration-unreleased.yml | 82 +++++++++++++++---- .github/workflows/integration.yml | 52 +++++++++--- .github/workflows/license.yml | 13 ++- .github/workflows/nodejs.yml | 31 +++++-- 13 files changed, 210 insertions(+), 136 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/BUG_TEMPLATE.md delete mode 100644 .github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md delete mode 100644 .github/ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md delete mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7df943260..996471045 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -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 \ No newline at end of file +* @ananzh @kavilla @seanneumann @dblock @VachaShah @nhtruong @harshavamsi @timursaurus diff --git a/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md b/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md deleted file mode 100644 index fbe1239e5..000000000 --- a/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -name: 🐛 Bug report -about: Create a report to help us improve -title: '[BUG]' -labels: 'bug, untriaged' -assignees: '' ---- - -**What is the bug?** -A clear and concise description of the bug. - -**How can one reproduce the bug?** -Steps to reproduce the behavior: - -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**What is the expected behavior?** -A clear and concise description of what you expected to happen. - -**What is your host/environment?** - -- OS: [e.g. iOS] -- Version [e.g. 22] -- Plugins - -**Do you have any screenshots?** -If applicable, add screenshots to help explain your problem. - -**Do you have any additional context?** -Add any other context about the problem. diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md deleted file mode 100644 index 1a07227b3..000000000 --- a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: 🎆 Feature request -about: Request a feature in this project -title: '[FEATURE]' -labels: enhancement -assignees: '' ---- - -**Is your feature request related to a problem?** -A clear and concise description of what the problem is, e.g. _I'm always frustrated when [...]_ - -**What solution would you like?** -A clear and concise description of what you want to happen. - -**What alternatives have you considered?** -A clear and concise description of any alternative solutions or features you've considered. - -**Do you have any additional context?** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md b/.github/ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md deleted file mode 100644 index 23a03e106..000000000 --- a/.github/ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: 💭 Proposal -about: Suggest an idea for a specific feature you wish to propose to the community for comment -title: '[PROPOSAL]' -labels: proposal -assignees: '' ---- - -## What kind of business use case are you trying to solve? What are your requirements? - -A clear and concise description of the business problem, e.g. _My customers are asking for [...]_ - -**What is the problem? What is preventing you from meeting the requirements?** -Describe what impact this problem has for lack of a solution. - -**What are you proposing? What do you suggest we do to solve the problem or improve the existing situation?** -Describe your proposed solution. It's OK if you don't have one. - -**What are your assumptions or prerequisites?** -Describe any assumptions you may be making that would limit the scope of this proposal. - -**What are remaining open questions?** -List questions that may need to be answered before proceeding with an implementation. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 67f6e2a32..000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,7 +0,0 @@ -contact_links: - - name: OpenSearch Community Support - url: https://discuss.opendistrocommunity.dev/ - about: Please ask and answer questions here. - - name: AWS/Amazon Security - url: https://aws.amazon.com/security/vulnerability-reporting/ - about: Please report security vulnerabilities here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index dbcf4101d..e42edeaf7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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). diff --git a/.github/workflows/bundler.yml b/.github/workflows/bundler.yml index 7c0e3787b..fee280303 100644 --- a/.github/workflows/bundler.yml +++ b/.github/workflows/bundler.yml @@ -1,16 +1,21 @@ name: Bundler -on: [push, pull_request] +# trigger on every commit push and PR for all branches +on: + 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 @@ -21,15 +26,26 @@ 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 + uses: actions/setup-node@v3 with: node-version: 14.x + # NPM started understanding yarn.lock file starting from v7 + - name: Update NPM + shell: bash + run: | + export NPM_VERSION=$(npm -v) + export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7") + if [ "$IS_NPM_SUITABLE" == "false" ]; then + echo "NPM needs upgrading!" + npm i npm@7 -g + fi + - name: Install run: | npm install diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index de59e097d..b711236a2 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -1,6 +1,15 @@ name: Integration for Compatibility -on: [push, pull_request] +# trigger on every commit push and PR for all branches +on: + push: + branches: ['**'] + paths-ignore: + - '**/*.md' + pull_request: + branches: ['**'] + paths-ignore: + - '**/*.md' jobs: integration-test-compatibility: @@ -18,7 +27,10 @@ jobs: - { opensearch_version: 1.2.4 } - { opensearch_version: 1.3.0 } - { opensearch_version: 1.3.1 } + - { opensearch_version: 1.3.2 } + - { opensearch_version: 1.3.3 } - { opensearch_version: 2.0.0 } + - { opensearch_version: 2.0.1 } steps: - uses: actions/checkout@v2 @@ -31,13 +43,14 @@ jobs: sudo sysctl -w vm.max_map_count=262144 - name: Runs OpenSearch cluster + id: start_opensearch_cluster run: | export OPENSEARCH_VERSION=${{ matrix.entry.opensearch_version }} export SECURE_INTEGRATION=${{ matrix.secured }} make cluster.clean cluster.opensearch.build cluster.opensearch.start - name: Use Node.js 16.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 16.x @@ -56,5 +69,6 @@ jobs: npm run test:integration:helpers-secure - name: Stop the OpenSearch cluster + if: ${{ steps.start_opensearch_cluster.outcome == 'success'}} run: | make cluster.opensearch.stop diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 6d1221c17..7de962d9b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,7 +1,15 @@ name: Coverage -on: [push, pull_request] - +# trigger on every commit push and PR for all branches +on: + push: + branches: ['**'] + paths-ignore: + - '**/*.md' + pull_request: + branches: ['**'] + paths-ignore: + - '**/*.md' jobs: code-coverage: name: Code coverage @@ -15,10 +23,21 @@ jobs: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + # NPM started understanding yarn.lock file starting from v7 + - name: Update NPM + shell: bash + run: | + export NPM_VERSION=$(npm -v) + export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7") + if [ "$IS_NPM_SUITABLE" == "false" ]; then + echo "NPM needs upgrading!" + npm i npm@7 -g + fi + - name: Install run: | npm install diff --git a/.github/workflows/integration-unreleased.yml b/.github/workflows/integration-unreleased.yml index 0d3c76d57..b06f7d576 100644 --- a/.github/workflows/integration-unreleased.yml +++ b/.github/workflows/integration-unreleased.yml @@ -4,9 +4,13 @@ on: push: branches: - 'main' + paths-ignore: + - '**/*.md' pull_request: branches: - 'main' + paths-ignore: + - '**/*.md' jobs: test: @@ -15,41 +19,85 @@ jobs: fail-fast: false matrix: entry: - - { opensearch_ref: '1.x' } - - { opensearch_ref: '2.0' } - - { opensearch_ref: '2.x' } - - { opensearch_ref: 'main' } + - { node_version: '16.x', opensearch_ref: '1.x' } + - { node_version: '16.x', opensearch_ref: '2.0' } + - { node_version: '16.x', opensearch_ref: '2.x' } + - { node_version: '16.x', opensearch_ref: 'main' } steps: - name: Checkout OpenSearch - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: opensearch-project/OpenSearch ref: ${{ matrix.entry.opensearch_ref }} path: opensearch + - name: Get OpenSearch branch top + id: get-key + working-directory: opensearch + run: echo key=`git log -1 --format='%H'` >> $GITHUB_OUTPUT + + - name: Restore cached build + id: cache-restore + uses: actions/cache/restore@v3 + with: + path: opensearch/distribution/archives/linux-tar/build/distributions + key: ${{ steps.get-key.outputs.key }} + - name: Assemble OpenSearch + if: steps.cache-restore.outputs.cache-hit != 'true' + working-directory: opensearch + run: ./gradlew :distribution:archives:linux-tar:assemble + + - name: Save cached build + if: steps.cache-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: opensearch/distribution/archives/linux-tar/build/distributions + key: ${{ steps.get-key.outputs.key }} + + - name: Run OpenSearch + working-directory: opensearch/distribution/archives/linux-tar/build/distributions run: | - cd opensearch - ./gradlew assemble - # This step runs the docker image generated during gradle assemble in OpenSearch. It is tagged as opensearch:test. - # Reference: https://github.com/opensearch-project/OpenSearch/blob/2.0/distribution/docker/build.gradle#L190 - - name: Run Docker Image - run: | - docker run -p 9200:9200 -p 9600:9600 -d -e "discovery.type=single-node" -e "bootstrap.memory_lock=true" opensearch:test - sleep 90 + tar xf opensearch-min-* + ./opensearch-*/bin/opensearch \ + -Enode.attr.testattr=test \ + -Epath.repo=/tmp \ + -Erepositories.url.allowed_urls='http://snapshot.*' \ + -d + for attempt in {1..20}; do + sleep 5 + if curl -s localhost:9200; then + echo '=====> ready' + exit 0 + fi + echo '=====> waiting...' + done + exit 1 - name: Checkout Javascript Client - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + path: js-client - - name: Use Node.js 16.x - uses: actions/setup-node@v1 + - name: Setup Node + uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: ${{ matrix.entry.node_version }} - name: Install + working-directory: js-client run: | npm install - name: Integration test + working-directory: js-client run: | npm run test:integration:helpers + + - name: Save server logs + if: failure() + uses: actions/upload-artifact@v3 + with: + name: opensearch-logs-${{ matrix.entry.opensearch_ref }}-js-${{ matrix.entry.node_version }} + path: | + opensearch/distribution/archives/linux-tar/build/distributions/**/logs/* diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 59f4761d3..a99674a15 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,6 +1,14 @@ name: Integration - -on: [push, pull_request] +# trigger on every commit push and PR for all branches +on: + push: + branches: ['**'] + paths-ignore: + - '**/*.md' + pull_request: + branches: ['**'] + paths-ignore: + - '**/*.md' jobs: helpers-integration-test: @@ -9,8 +17,7 @@ jobs: strategy: matrix: - cluster: ['opendistro', 'opensearch'] - node-version: [10.x, 12.x, 14.x, 16.x] + node-version: [10.x, 12.x, 14.x, 16.x, 18.x] steps: - uses: actions/checkout@v2 @@ -22,15 +29,26 @@ 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 ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + # NPM started understanding yarn.lock file starting from v7 + - name: Update NPM + shell: bash + run: | + export NPM_VERSION=$(npm -v) + export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7") + if [ "$IS_NPM_SUITABLE" == "false" ]; then + echo "NPM needs upgrading!" + npm i npm@7 -g + fi + - name: Install run: | npm install @@ -45,8 +63,7 @@ jobs: strategy: matrix: - cluster: ['opendistro', 'opensearch'] - node-version: [10.x, 12.x, 14.x, 16.x] + node-version: [10.x, 12.x, 14.x, 16.x, 18.x] steps: - uses: actions/checkout@v2 @@ -58,16 +75,27 @@ jobs: sudo sysctl -w fs.file-max=262144 sudo sysctl -w vm.max_map_count=262144 - - name: Runs ${{ matrix.cluster }} secure cluster + - name: Runs OpenSearch secure cluster run: | export SECURE_INTEGRATION=true - make cluster.clean cluster.${{ matrix.cluster }}.build cluster.${{ matrix.cluster }}.start + make cluster.clean cluster.opensearch.build cluster.opensearch.start - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + # NPM started understanding yarn.lock file starting from v7 + - name: Update NPM + shell: bash + run: | + export NPM_VERSION=$(npm -v) + export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7") + if [ "$IS_NPM_SUITABLE" == "false" ]; then + echo "NPM needs upgrading!" + npm i npm@7 -g + fi + - name: Install run: | npm install diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml index 19b04b3c0..c9774ad67 100644 --- a/.github/workflows/license.yml +++ b/.github/workflows/license.yml @@ -15,10 +15,21 @@ jobs: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + # NPM started understanding yarn.lock file starting from v7 + - name: Update NPM + shell: bash + run: | + export NPM_VERSION=$(npm -v) + export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7") + if [ "$IS_NPM_SUITABLE" == "false" ]; then + echo "NPM needs upgrading!" + npm i npm@7 -g + fi + - name: Install run: | npm install diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 1fc8789e1..931c90d87 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,6 +1,15 @@ name: Node CI -on: [push, pull_request] +# trigger on every commit push and PR for all branches +on: + push: + branches: ['**'] + paths-ignore: + - '**/*.md' + pull_request: + branches: ['**'] + paths-ignore: + - '**/*.md' jobs: test: @@ -9,17 +18,28 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x, 16.x] + node-version: [10.x, 12.x, 14.x, 16.x, 18.x] os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + # NPM started understanding yarn.lock file starting from v7 + - name: Update NPM + shell: bash + run: | + export NPM_VERSION=$(npm -v) + export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7") + if [ "$IS_NPM_SUITABLE" == "false" ]; then + echo "NPM needs upgrading!" + npm i npm@7 -g + fi + - name: Install run: | npm install @@ -27,9 +47,10 @@ jobs: - name: Setup Yarn run: | npm uninstall -g yarn - npm i -g yarn@1.22.10 - + npm i -g yarn@1.22.10 + - name: Lint + if: matrix.node-version == '16.x' run: | yarn lint