Skip to content

Commit f3ac19d

Browse files
committed
Merge remote-tracking branch 'origin/main' into 9.0
2 parents 9c83e2d + 62d4bb5 commit f3ac19d

File tree

99 files changed

+8878
-6343
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+8878
-6343
lines changed

.buildkite/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PHP_VERSION=8.0-cli
1+
ARG PHP_VERSION=8.4-cli
22
FROM php:${PHP_VERSION}
33

44
WORKDIR /usr/src/app
@@ -39,4 +39,4 @@ RUN composer install --no-progress > /dev/null
3939

4040
COPY . .
4141

42-
CMD ["bash", ".buildkite/yaml-tests.sh"]
42+
CMD ["bash", ".buildkite/yaml-tests.sh"]

.buildkite/pipeline.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ steps:
77
env:
88
PHP_VERSION: "{{ matrix.php }}"
99
TEST_SUITE: "{{ matrix.suite }}"
10-
STACK_VERSION: 8.16.0-SNAPSHOT
10+
STACK_VERSION: 9.0.0-SNAPSHOT
11+
BRANCH_CLIENT_TESTS: 9.0
1112
matrix:
1213
setup:
1314
suite:
14-
- "free"
1515
- "platinum"
1616
php:
17+
- "8.4-cli"
1718
- "8.3-cli"
1819
- "8.2-cli"
1920
- "8.1-cli"
20-
- "8.0-cli"
21-
- "7.4-cli"
2221
command: ./.buildkite/run-tests
2322
artifact_paths: "*.xml"

.buildkite/run-repository.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ script_path=$(dirname $(realpath -s $0))
99
source $script_path/functions/imports.sh
1010
set -euo pipefail
1111

12-
PHP_VERSION=${PHP_VERSION-8.2-cli}
12+
PHP_VERSION=${PHP_VERSION-8.4-cli}
1313
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
1414
elasticsearch_container=${elasticsearch_container-}
1515

@@ -18,6 +18,7 @@ echo -e "\033[34;1mINFO:\033[0m TEST_SUITE ${TEST_SUITE}\033[0m"
1818
echo -e "\033[34;1mINFO:\033[0m URL ${ELASTICSEARCH_URL}\033[0m"
1919
echo -e "\033[34;1mINFO:\033[0m CONTAINER ${elasticsearch_container}\033[0m"
2020
echo -e "\033[34;1mINFO:\033[0m PHP_VERSION ${PHP_VERSION}\033[0m"
21+
echo -e "\033[34;1mINFO:\033[0m BRANCH_CLIENT_TESTS ${BRANCH_CLIENT_TESTS}\033[0m"
2122

2223
echo -e "\033[1m>>>>> Build docker container >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
2324

@@ -40,7 +41,8 @@ docker run \
4041
--env TEST_SUITE=${TEST_SUITE} \
4142
--env PHP_VERSION=${PHP_VERSION} \
4243
--env ELASTICSEARCH_URL=${ELASTICSEARCH_URL} \
44+
--env BRANCH_CLIENT_TESTS=${BRANCH_CLIENT_TESTS} \
4345
--ulimit nofile=65535:65535 \
4446
--name elasticsearch-php \
4547
--rm \
46-
elastic/elasticsearch-php
48+
elastic/elasticsearch-php

.buildkite/yaml-tests.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
#!/usr/bin/env bash
22

3-
# Checkout the YAML test from Elasticsearch tag
4-
php util/RestSpecRunner.php
3+
# Clone the elasticsearch-clients-tests repository
4+
git clone -b ${BRANCH_CLIENT_TESTS} https://github.com/elastic/elasticsearch-clients-tests.git tests/elasticsearch-clients-tests
55

6-
# Generate the YAML tests for PHPUnit
7-
php util/build_tests.php
6+
# Build the YAML tests
7+
php tests/build_es_tests.php tests/elasticsearch-clients-tests/tests stack tests/Yaml
88

99
# Run YAML tests
10-
vendor/bin/phpunit -c "phpunit-yaml-${TEST_SUITE}-tests.xml"
10+
vendor/bin/phpunit -c "phpunit-yaml-stack-tests.xml"
11+
12+
# Remove Yaml tests
13+
rm -rf tests/Yaml
14+
15+
# Remove elasticsearch-clients-tests folder
16+
rm -rf tests/elasticsearch-clients-tests
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: PHP integration tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: Test
8+
runs-on: ${{ matrix.os }}
9+
10+
strategy:
11+
matrix:
12+
php-version: [8.1, 8.2, 8.3, 8.4]
13+
os: [ubuntu-latest]
14+
es-version: [9.0.0-SNAPSHOT]
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Use PHP ${{ matrix.php-version }}
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-version }}
24+
extensions: yaml, zip, curl
25+
coverage: none
26+
env:
27+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Get composer cache directory
30+
id: composercache
31+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
32+
- name: Cache dependencies
33+
uses: actions/cache@v4
34+
with:
35+
path: ${{ steps.composercache.outputs.dir }}
36+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
37+
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-
38+
39+
- name: Install dependencies
40+
run: |
41+
composer install --prefer-dist
42+
43+
- name: Run Elasticsearch using start-local
44+
run: |
45+
curl -fsSL https://elastic.co/start-local | sh -s -- -v ${{ matrix.es-version }} -esonly
46+
47+
- name: Integration tests
48+
run: |
49+
source elastic-start-local/.env
50+
ELASTICSEARCH_URL="http://elastic:${ES_LOCAL_PASSWORD}@localhost:9200" TEST_SUITE="free" composer run-script integration-test

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PHP test
1+
name: PHP tests
22

33
on: [push, pull_request]
44

@@ -9,9 +9,9 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
php-version: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
12+
php-version: [8.1, 8.2, 8.3, 8.4]
1313
os: [ubuntu-latest]
14-
es-version: [8.16-SNAPSHOT]
14+
es-version: [9.0.0-SNAPSHOT]
1515

1616
steps:
1717
- name: Checkout

.github/workflows/yaml_test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: PHP YAML tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: Test
8+
runs-on: ${{ matrix.os }}
9+
10+
strategy:
11+
matrix:
12+
php-version: [8.1, 8.2, 8.3, 8.4]
13+
os: [ubuntu-latest]
14+
es-version: [9.0.0-SNAPSHOT]
15+
test-suite: [stack]
16+
branch-client-tests: ["9.0"]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Use PHP ${{ matrix.php-version }}
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-version }}
26+
extensions: yaml, zip, curl
27+
coverage: none
28+
env:
29+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Get composer cache directory
32+
id: composercache
33+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
34+
- name: Cache dependencies
35+
uses: actions/cache@v4
36+
with:
37+
path: ${{ steps.composercache.outputs.dir }}
38+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
39+
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-
40+
41+
- name: Install dependencies
42+
run: |
43+
composer install --prefer-dist
44+
45+
- name: Run Elasticsearch using start-local
46+
run: |
47+
curl -fsSL https://elastic.co/start-local | sh -s -- -v ${{ matrix.es-version }} -esonly
48+
49+
- name: Build PHPUnit tests
50+
run: |
51+
git clone -b ${{ matrix.branch-client-tests }} https://github.com/elastic/elasticsearch-clients-tests.git tests/elasticsearch-clients-tests
52+
php tests/build_es_tests.php tests/elasticsearch-clients-tests/tests ${{ matrix.test-suite }} tests/Yaml
53+
54+
- name: YAML tests
55+
run: |
56+
source elastic-start-local/.env
57+
ELASTICSEARCH_URL="http://elastic:${ES_LOCAL_PASSWORD}@localhost:9200" TEST_SUITE="free" vendor/bin/phpunit -c "phpunit-yaml-${{ matrix.test-suite }}-tests.xml"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ util/cache/
2727
util/*.zip
2828
util/output/
2929
util/rest-spec
30+
elastic-start-local/
3031

3132
# Doctum docs generator
3233
/doctum.phar
@@ -35,6 +36,7 @@ util/doctum.phar
3536
# PHPUnit
3637
/phpunit.xml
3738
.phpunit.result.cache
39+
.phpunit.cache/
3840

3941
# Code coverage
4042
build

BREAKING_CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 9.0
2+
3+
- **Use of PHP 8.1+:** Starting from 9.0.0 the `elasticsearch-php` client requires PHP 8.1+.
4+
15
# 8.0
26

37
This major release is a complete new PHP client for Elasticsearch. We build it from scratch!

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## Release 9.0.0
2+
3+
- **Use of PHP 8.1+:** Starting from 9.0.0 the `elasticsearch-php` client requires PHP 8.1+.
4+
- **Compatibility with Elasticsearch 9.0:** All changes and additions to Elasticsearch APIs for its 9.0 release are reflected in this release.
5+
- **Serverless client merged in:** the `elastic/elasticsearch-serverless` client is being deprecated, and its functionality has been merged back into this client. This should have zero impact on the way the client works by default. If an endpoint is available in serverless, the PHP function will contains a `@group serverless` phpdoc attribute.
6+
If you try to use an endpoint that is not available in serverless you will get a `410` HTTP error with a message as follows:
7+
"this endpoint exists but is not available when running in serverless mode".
8+
The 9.0.0 client can recognize that it is communicating with a serverless instance if you are using a URL managed by Elastic (e.g. `*.elastic.cloud`).
9+
If you are using a proxy, the client will be able to recognize that the host is serverless from the first response. Alternatively, you can explicitly indicate that the host is serverless using the `Client::setServerless(true)` function (`false` by default).
10+
- **New transport library with PSR-18 cURL client as default:** we've removed the Guzzle dependency from the client. By default, the built-in cURL-based HTTP client will be used if no other PSR-18 compatible clients are detected. See release [9.0.0](https://github.com/elastic/elastic-transport-php/releases/tag/v9.0.0) of elastic-transport-php.
11+
12+
## Release 8.17.1
13+
14+
- Fix and improvements for PHPStan (rule level 5) #1442 (thanks @AJenbo)
15+
16+
## Release 8.17.0
17+
18+
- Updated the APIs to Elasticsearch [8.17.0](https://www.elastic.co/guide/en/elasticsearch/reference/current/release-notes-8.17.0.html)
19+
20+
## Release 8.16.0
21+
22+
- Updated the APIs to Elasticsearch [8.16.0](https://www.elastic.co/guide/en/elasticsearch/reference/current/release-notes-8.16.0.html)
23+
- Added the support of PHP 8.4 #1415 (thanks @ruudk)
24+
125
## Release 8.15.0
226

327
Updated the APIs to Elasticsearch [8.15.0](https://www.elastic.co/guide/en/elasticsearch/reference/current/release-notes-8.15.0.html) and added the support of OpenTelemetry.

0 commit comments

Comments
 (0)