Skip to content

Commit

Permalink
Adds newer OpenSearch builds to integration tests and updates unrelea…
Browse files Browse the repository at this point in the history
…sed wait mechanism

Signed-off-by: dblock <[email protected]>
  • Loading branch information
harshavamsi authored and dblock committed Apr 18, 2024
1 parent 8962f02 commit 3a0b223
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 48 deletions.
File renamed without changes.
46 changes: 29 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use PHP 8.1
- name: Use PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
extensions: yaml, zip, curl
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -35,12 +35,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use PHP 8.1
- name: Use PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
extensions: yaml, zip, curl
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -58,7 +58,7 @@ jobs:
runs-on: ubuntu-latest
services:
search-server:
image: opensearchproject/opensearch:2.2.1
image: opensearchproject/opensearch:2.6.0
ports:
- 9200:9200
env:
Expand All @@ -67,12 +67,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use PHP 8.1
- name: Use PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
extensions: yaml, zip, curl, pcov
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -82,7 +82,7 @@ jobs:
composer install --prefer-dist
- name: Wait for Search server
run: php ./.github/wait_for_es.php
run: php ./.github/wait_for_opensearch.php

- name: PHPUnit
run: |
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -142,10 +142,22 @@ jobs:
- docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.0
- opensearchproject/opensearch:1.1.0
- opensearchproject/opensearch:1.2.4
- opensearchproject/opensearch:1.3.6
- opensearchproject/opensearch:1.3.15
- opensearchproject/opensearch:2.0.1
- opensearchproject/opensearch:2.1.0
- opensearchproject/opensearch:2.2.1
- opensearchproject/opensearch:2.5.0
- opensearchproject/opensearch:2.3.0
- opensearchproject/opensearch:2.4.1
- opensearchproject/opensearch:2.5.0
- opensearchproject/opensearch:2.6.0
- opensearchproject/opensearch:2.7.0
- opensearchproject/opensearch:2.8.0
- opensearchproject/opensearch:2.9.0
- opensearchproject/opensearch:2.10.0
- opensearchproject/opensearch:2.11.1
- opensearchproject/opensearch:2.12.0
- opensearchproject/opensearch:2.13.0
services:
search-server:
image: ${{ matrix.search-server-image }}
Expand All @@ -157,12 +169,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use PHP 8.1
- name: Use PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
extensions: yaml, zip, curl
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -172,7 +184,7 @@ jobs:
composer install --prefer-dist
- name: Wait for Search server
run: php ./.github/wait_for_es.php
run: php ./.github/wait_for_opensearch.php

- name: Integration tests
run: |
Expand Down
53 changes: 35 additions & 18 deletions .github/workflows/test_unreleased.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,53 @@ jobs:
strategy:
fail-fast: false
matrix:
entry:
- { opensearch_ref: '1.x' }
- { opensearch_ref: '2.0' }
- { opensearch_ref: '2.x' }
- { opensearch_ref: 'main' }
opensearch_ref: [ '1.x', '2.x', '2.0', 'main' ]
steps:
- name: Checkout OpenSearch
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: opensearch-project/OpenSearch
ref: ${{ matrix.entry.opensearch_ref }}
ref: ${{ matrix.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 &
for attempt in {1..20}; do sleep 5; if curl -s localhost:9200; then echo '=====> ready'; break; fi; echo '=====> waiting...'; done
- name: Checkout PHP Client
uses: actions/checkout@v2

- name: Use PHP 8.1
- name: Use PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
extensions: yaml, zip, curl
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -54,7 +70,8 @@ jobs:
composer install --prefer-dist
- name: Wait for Search server
run: php ./.github/wait_for_es.php
run: php ./.github/wait_for_opensearch.php


- name: Integration tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
with:
fetch-depth: 0

- name: Use PHP 8.1
- name: Use PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
23 changes: 12 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
# CHANGELOG

Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

### Added
- Added PHP 8.2 to the CI
- Github workflow for changelog verification ([#92](https://github.com/opensearch-project/opensearch-php/pull/92))
- Added a GitHub workflow for verifying CHANGELOG ([#92](https://github.com/opensearch-project/opensearch-php/pull/92))
- Added class docs generator ([#96](https://github.com/opensearch-project/opensearch-php/pull/96))
- Added support for Amazon OpenSearch Serverless SigV4 signing ([#119](https://github.com/opensearch-project/opensearch-php/pull/119))
- Added `includePortInHostHeader` option to `ClientBuilder::fromConfig` ([#118](https://github.com/opensearch-project/opensearch-php/pull/118))
- Added the `RefreshSearchAnalyzers` endpoint ([[#152](https://github.com/opensearch-project/opensearch-php/issues/152))
- Added support for `format` parameter to specify the sql response format ([#161](https://github.com/opensearch-project/opensearch-php/pull/161))
- Added ml commons model, model group and connector APIs ([#170](https://github.com/opensearch-project/opensearch-php/pull/170))
- [Feature] Send raw json request ([#171](https://github.com/opensearch-project/opensearch-php/pull/177))
- Added ml-commons model, model group and connector APIs ([#170](https://github.com/opensearch-project/opensearch-php/pull/170))
- Added support for sending raw JSON requests ([#171](https://github.com/opensearch-project/opensearch-php/pull/177))
- Added PHP 8.2 support ([#87](https://github.com/opensearch-project/opensearch-php/issues/87))
- Added Windows and MacOS support ([#100](https://github.com/opensearch-project/opensearch-php/pull/100))
- Added code coverage reporting ([#100](https://github.com/opensearch-project/opensearch-php/pull/100))
- Added support for a custom signing service name for AWS SigV4 ([#117](https://github.com/opensearch-project/opensearch-php/pull/117))

### Changed

- Added Windows and macOS jobs to CI
- Added Coverage reporting to Codecov
- Support a custom signing service name for AWS SigV4 ([#117](https://github.com/opensearch-project/opensearch-php/pull/117))

### Deprecated

### Removed

### Fixed
- Updated backport helper version and add fix to backport workflow when tag is applied before closing PR ([#131](https://github.com/opensearch-project/opensearch-php/pull/131))

- Fixed backport workflow when tag is applied before closing PR ([#131](https://github.com/opensearch-project/opensearch-php/pull/131))
- Fixed host urls with trailing slash in the url ([#130](https://github.com/opensearch-project/opensearch-php/pull/140))
- Fixed point-in-time APIs ([#142](https://github.com/opensearch-project/opensearch-php/pull/142))
- Fixed bug in ClientBuilder where basic authentication is overridden by connection params ([#160](https://github.com/opensearch-project/opensearch-php/pull/160))
- Fixed basic authentication being overridden by connection params in `ClientBuilder` ([#160](https://github.com/opensearch-project/opensearch-php/pull/160))
- Fixed PHP warning in `Connection::tryDeserializeError()` for some error responses ([#167](https://github.com/opensearch-project/opensearch-php/issues/167))

### Security


[Unreleased]: https://github.com/opensearch-project/opensearch-php/compare/2.0...HEAD

0 comments on commit 3a0b223

Please sign in to comment.