Skip to content

Commit 0ed8261

Browse files
authored
Merge branch 'main' into fix/cache-clear-method-add
2 parents 8171516 + 83b3a34 commit 0ed8261

File tree

96 files changed

+6518
-1540
lines changed

Some content is hidden

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

96 files changed

+6518
-1540
lines changed

.buildkite/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ steps:
77
env:
88
PHP_VERSION: "{{ matrix.php }}"
99
TEST_SUITE: "{{ matrix.suite }}"
10-
STACK_VERSION: 9.0.0-SNAPSHOT
11-
BRANCH_CLIENT_TESTS: 9.0
10+
STACK_VERSION: 9.3.0-SNAPSHOT
11+
BRANCH_CLIENT_TESTS: 9.2
1212
matrix:
1313
setup:
1414
suite:

.github/CODEOWNERS

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/make.sh

100644100755
Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@
1111
#
1212
# Targets:
1313
# ---------------------------
14-
# assemble <VERSION> : build client artefacts with version
15-
# bump <VERSION> : bump client internals to version
16-
# codegen <VERSION> : generate endpoints
17-
# docsgen <VERSION> : generate documentation
18-
# examplegen : generate the doc examples
19-
# clean : clean workspace
14+
# assemble <VERSION> : build client artefacts with version
15+
# bump <VERSION> : bump client internals to version
16+
# bumpmatrix <VERSION> : bump stack version in test matrix to version
17+
# codegen <VERSION> : generate endpoints
18+
# docsgen <VERSION> : generate documentation
19+
# examplegen : generate the doc examples
20+
# clean : clean workspace
2021
#
2122
# ------------------------------------------------------- #
2223

2324
# ------------------------------------------------------- #
2425
# Bootstrap
2526
# ------------------------------------------------------- #
2627

27-
script_path=$(dirname "$(realpath -s "$0")")
28+
script_path=$(dirname "$(realpath "$0")")
2829
repo=$(realpath "$script_path/../")
2930

3031
# shellcheck disable=SC1090
@@ -68,11 +69,8 @@ case $CMD in
6869
TASK_ARGS=("$VERSION" "$output_folder")
6970
;;
7071
codegen)
71-
if [ -v $VERSION ]; then
72-
echo -e "\033[31;1mTARGET: codegen -> missing version parameter\033[0m"
73-
exit 1
74-
fi
75-
echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
72+
VERSION=$(git rev-parse --abbrev-ref HEAD)
73+
echo -e "\033[36;1mTARGET: codegen API $VERSION\033[0m"
7674
TASK=codegen
7775
# VERSION is BRANCH here for now
7876
TASK_ARGS=("$VERSION" "$codegen_folder")
@@ -103,7 +101,16 @@ case $CMD in
103101
# VERSION is BRANCH here for now
104102
TASK_ARGS=("$VERSION")
105103
;;
106-
*)
104+
bumpmatrix)
105+
if [ -v $VERSION ]; then
106+
echo -e "\033[31;1mTARGET: bumpmatrix -> missing version parameter\033[0m"
107+
exit 1
108+
fi
109+
echo -e "\033[36;1mTARGET: bump stack in test matrix to version $VERSION\033[0m"
110+
TASK=bumpmatrix
111+
TASK_ARGS=("$VERSION")
112+
;;
113+
*)
107114
echo -e "\nUsage:\n\t $CMD is not supported right now\n"
108115
exit 1
109116
esac
@@ -113,12 +120,13 @@ esac
113120
# Build Container
114121
# ------------------------------------------------------- #
115122

116-
#echo -e "\033[34;1mINFO: building $product container\033[0m"
117-
118-
#docker build --file .github/Dockerfile --tag ${product} \
119-
# --build-arg USER_ID="$(id -u)" \
120-
# --build-arg GROUP_ID="$(id -g)" .
123+
build_container() {
124+
echo -e "\033[34;1mINFO: building $product container\033[0m"
121125

126+
docker build --file $repo/.buildkite/Dockerfile --tag ${product} \
127+
--build-arg USER_ID="$(id -u)" \
128+
--build-arg GROUP_ID="$(id -g)" .
129+
}
122130

123131
# ------------------------------------------------------- #
124132
# Run the Container
@@ -173,8 +181,32 @@ if [[ "$CMD" == "bump" ]]; then
173181
sed -i "s/es-version: \[[0-9]\+\.[0-9]\+\.\?[0-9]\?-SNAPSHOT\]/es-version: \[$MINOR_VERSION-SNAPSHOT\]/" $repo/.github/workflows/test.yml
174182
fi
175183

184+
if [[ "$CMD" == "bumpmatrix" ]]; then
185+
TEST_FILES=".buildkite/pipeline.yml .github/workflows/test.yml .github/workflows/integration_test.yml .github/workflows/yaml_test.yml"
186+
for TEST_FILE in $TEST_FILES; do
187+
sed -E -i.bak 's/[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT/'$VERSION'/g' ${TEST_FILE}
188+
rm ${TEST_FILE}.bak
189+
done
190+
exit 0
191+
fi
192+
176193
if [[ "$CMD" == "codegen" ]]; then
177-
echo "TODO"
194+
BRANCH=$VERSION
195+
if [[ "$BRANCH" == "main" ]]; then
196+
ES_VERSION="main"
197+
else
198+
ES_VERSION=$(curl -L -s https://artifacts-snapshot.elastic.co/elasticsearch/latest/$BRANCH.json | jq -r ".version")
199+
fi
200+
build_container
201+
docker run \
202+
--rm -v $repo:/code/elasticsearch-php \
203+
$product \
204+
/bin/bash -x -c "cd /code && mkdir codegen && \
205+
git clone https://$CLIENTS_GITHUB_TOKEN@github.com/elastic/elastic-client-generator-php.git && \
206+
cd /code/elastic-client-generator-php && composer install && \
207+
bin/elasticsearch9.php $ES_VERSION $BRANCH /code/codegen config/elasticsearch9.json && \
208+
cp /code/codegen/Elastic/Elasticsearch/Endpoints/* /code/elasticsearch-php/src/Endpoints/ && \
209+
cp /code/codegen/Elastic/Elasticsearch/Traits/* /code/elasticsearch-php/src/Traits/"
178210
fi
179211

180212
if [[ "$CMD" == "docsgen" ]]; then
@@ -183,4 +215,4 @@ fi
183215

184216
if [[ "$CMD" == "examplesgen" ]]; then
185217
echo "TODO"
186-
fi
218+
fi

.github/workflows/docs-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
deployments: write
1717
id-token: write
1818
contents: read
19-
pull-requests: read
19+
pull-requests: write

.github/workflows/integration_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
php-version: [8.1, 8.2, 8.3, 8.4]
1313
os: [ubuntu-latest]
14-
es-version: [9.0.0-SNAPSHOT]
14+
es-version: [9.3.0-SNAPSHOT]
1515

1616
steps:
1717
- name: Checkout
@@ -42,7 +42,7 @@ jobs:
4242
4343
- name: Run Elasticsearch using start-local
4444
run: |
45-
curl -fsSL https://elastic.co/start-local | sh -s -- -v ${{ matrix.es-version }} -esonly
45+
curl -fsSL https://elastic.co/start-local | sh -s -- -v ${{ matrix.es-version }} --esonly
4646
4747
- name: Integration tests
4848
run: |

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
php-version: [8.1, 8.2, 8.3, 8.4]
1313
os: [ubuntu-latest]
14-
es-version: [9.0.0-SNAPSHOT]
14+
es-version: [9.3.0-SNAPSHOT]
1515

1616
steps:
1717
- name: Checkout

.github/workflows/yaml_test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
matrix:
1212
php-version: [8.1, 8.2, 8.3, 8.4]
1313
os: [ubuntu-latest]
14-
es-version: [9.0.0-SNAPSHOT]
14+
es-version: [9.3.0-SNAPSHOT]
1515
test-suite: [stack]
16-
branch-client-tests: ["9.0"]
16+
branch-client-tests: ["main"]
1717

1818
steps:
1919
- name: Checkout
@@ -27,7 +27,7 @@ jobs:
2727
coverage: none
2828
env:
2929
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
30+
3131
- name: Get composer cache directory
3232
id: composercache
3333
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: Run Elasticsearch using start-local
4646
run: |
47-
curl -fsSL https://elastic.co/start-local | sh -s -- -v ${{ matrix.es-version }} -esonly
47+
curl -fsSL https://elastic.co/start-local | sh -s -- -v ${{ matrix.es-version }} --esonly
4848
4949
- name: Build PHPUnit tests
5050
run: |

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## Release 9.2.0
2+
3+
- Updated the APIs to Elasticsearch [9.2.0](https://www.elastic.co/docs/release-notes/elasticsearch#elasticsearch-9.2.0-release-notes)
4+
- Added the ES|QL query builder [#1462](https://github.com/elastic/elasticsearch-php/pull/1462)
5+
6+
## Release 9.1.0
7+
8+
- Updated the APIs to Elasticsearch [9.1.0](https://www.elastic.co/docs/release-notes/elasticsearch#elasticsearch-9.1.0-release-notes)
9+
110
## Release 9.0.0
211

312
- **Use of PHP 8.1+:** Starting from 9.0.0 the `elasticsearch-php` client requires PHP 8.1+.

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See: https://www.elastic.co/community/codeofconduct

NOTICE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Elasticsearch PHP Client
2+
Copyright 2021 Elasticsearch B.V.

0 commit comments

Comments
 (0)