Skip to content

Fix/1176 #1177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 103 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
68b4d17
Use ES 8.0.0-SNAPSHOT
ezimuel Mar 27, 2020
a343cce
Use ES 8.0.0-SNAPSHOT in travis
ezimuel Mar 27, 2020
f9833d1
Merged from 7.7
ezimuel Apr 3, 2020
db205f9
Merge branch '7.x'
ezimuel Apr 8, 2020
4fb6820
Merge remote-tracking branch 'elasticsearch-php/7.x'
ezimuel Apr 14, 2020
451dbfc
Updated to 8.0.0-SNAPSHOT
ezimuel Apr 14, 2020
cd09c03
Added junit log for phpunit
ezimuel Apr 17, 2020
6c9c0a7
Better exception message for Could not parse URI
alexander-schranz Apr 9, 2020
8e19f48
Using static instead of self
snoob May 25, 2020
909911e
Removed 7.7 .ci job in favor of 7.8
ezimuel Jun 4, 2020
85f3dca
Removed false information about composer install --no-dev
LANGERGabrielle May 29, 2020
874875a
Skipped nodes.reload_secure_settings/10_basic.yml test due to malform…
ezimuel Jun 8, 2020
ce03840
Removed hirak/prestissimo plugin for composer
ezimuel Jun 8, 2020
21efcd9
Fixed doc example generator with null value
ezimuel Jul 14, 2020
db9ed51
Generated the doc examples to 2020-07-21
ezimuel Jul 14, 2020
f430383
Added the backport github action
ezimuel Jul 16, 2020
b673dcf
Merge pull request #1036 from snoob/patch-1
ezimuel Jul 16, 2020
96dd642
Fixed version matrix + added Contributing section
ezimuel Jul 16, 2020
e2b4e30
Output json_last_error_msg instead of json_last_error (#1045)
jkrzefski Jul 16, 2020
2dca02f
Removed 7.8 CI job
ezimuel Jul 16, 2020
da40f29
Added CI jobs 7.8 and 7.9
ezimuel Jul 16, 2020
f989195
Merge branch 'update/ci-elasticsearch-run'
ezimuel Aug 11, 2020
7eea3ab
Run CI tests twice daily
ezimuel Aug 12, 2020
4e0e8ea
Changed the default email recipient for CI notifications
ezimuel Aug 13, 2020
7025040
Split LICENSE into APACHE and LGPL files
ezimuel Aug 14, 2020
1639449
Added header license
ezimuel Aug 14, 2020
0ff5fb9
Added utility for license header
ezimuel Aug 14, 2020
fb4cac7
Fixed CS issue
ezimuel Aug 14, 2020
f729b18
Removed 7.8 CI job
ezimuel Aug 19, 2020
7dee03c
Removed Travis CI in favor of Github action
ezimuel Aug 20, 2020
8f8cdfb
Use of ES 8.0.0-SNAPSHOT for github action
ezimuel Aug 20, 2020
d8a280d
[DOCS] Reorganizes Overview and Installation chapters.
szabosteve Oct 1, 2020
c03a02c
Merge pull request #1067 from szabosteve/drs.overview
szabosteve Oct 5, 2020
dfd2b62
Added 7.10 job in CI
ezimuel Oct 14, 2020
c60f704
[DOCS] Adds Connecting section to PHP docs (#1077)
szabosteve Dec 9, 2020
2215c18
Remove unnecessary InvalidArgumentExceptions (#1069)
timoschinkel Dec 16, 2020
0d80e53
Removed 7.9 job and added 7.11 job in CI
ezimuel Dec 17, 2020
35eab26
[DOCS] Adds Configuration section to PHP docs. (#1100)
szabosteve Feb 16, 2021
e1ce1ee
Refactored TEST_SUITE with free, platinum + removed old YamlRunnerTest
ezimuel Feb 18, 2021
02d4590
Updated phpunit, CI, github configurations
ezimuel Feb 19, 2021
f4b1d20
Fixed tests + updated README
ezimuel Feb 19, 2021
6ad129d
Updated master with 7.x
ezimuel Dec 16, 2020
eb73074
Fixed CS issues
ezimuel Feb 19, 2021
331a578
Fixed warning header as array in YAML tests generator
ezimuel Feb 25, 2021
e0df11d
Added 6.8.x branch in CI
ezimuel Feb 25, 2021
fed5f6a
Added 7.12 job in CI + removed PHP 7.1, 7.2 in composer and tests
ezimuel Mar 2, 2021
2636824
Added yaml, zip, curl PHP extensions in test github action
ezimuel Mar 2, 2021
0d5a514
[DOCS] Adds Operations section to PHP book (#1110)
szabosteve Mar 5, 2021
b82ad45
[DOCS] Adds API reference section to PHP book.
szabosteve Mar 17, 2021
6d77eb5
Merge pull request #1115 from szabosteve/drs.api.ref
szabosteve Mar 22, 2021
73363bc
fix .gitattributes (#1039)
Tobion Apr 15, 2021
da7dc1a
Add make.sh Skeleton (#1122)
philkra Apr 19, 2021
f72dcb3
Merge branch '7.x'
ezimuel Apr 21, 2021
31f4bff
Removed BackwardCompatibleTest
ezimuel Apr 21, 2021
3493a7c
Updated .ci/run-elasticsearch to 1.3.0
ezimuel Apr 21, 2021
772b831
Fixed issue on wipeSnapshots + removed TEST_SUITE in getHost()
ezimuel Apr 23, 2021
f952624
Running elasticsearch only with platinum settings
ezimuel Apr 23, 2021
479f263
Updated endpoints to 8.0.0-SNAPSHOT
ezimuel Apr 23, 2021
1f98266
Updated skip tests for free suite
ezimuel Apr 23, 2021
aa64170
Updated util/run_es_docker
ezimuel Apr 23, 2021
708c2dd
Fixed CS issue
ezimuel Apr 23, 2021
356b85a
Usage of PHPUnit 9 only + migrated xml configurations
ezimuel Apr 26, 2021
c93339f
Removed wait for completion in deleteAllTasks
ezimuel Apr 26, 2021
b1a3f39
Added skip on classname + updated skip YAML set
ezimuel Apr 26, 2021
94a540e
Specified ELASTICSEARCH_URL in integration test
ezimuel Apr 26, 2021
5b3297d
Added 7.13 job
ezimuel Apr 28, 2021
031679b
Fix typo (#1133)
AlexNodex Apr 28, 2021
874ac06
Add check license header github job
ezimuel Apr 28, 2021
0c708a6
Merge branch 'master' of github.com:elastic/elasticsearch-php
ezimuel May 3, 2021
9bfcb1a
[DOCS] Adds section about PSR 7.
szabosteve May 5, 2021
ed047d1
Removed git submodule update
ezimuel May 6, 2021
8ca8b62
[DOCS] Adds Helpers section to PHP book (#1129)
szabosteve May 12, 2021
a997b3a
[DOCS] Adds Release notes section to PHP book (#1132)
szabosteve May 12, 2021
5169094
Merge branch 'master' into php.standard
szabosteve May 12, 2021
ad5f81e
Merge pull request #1137 from szabosteve/php.standard
szabosteve May 13, 2021
661eae9
Fixed empty doc for API references
ezimuel May 13, 2021
5413143
Added the description in endpoints
ezimuel May 13, 2021
1e9397b
Removed CR in description
ezimuel May 13, 2021
d549453
Add support for API Compatibility Header (#1142)
ezimuel May 18, 2021
663ab2a
[7.x] [DOCS] Added the HTTP meta data section (#1143)
ezimuel May 19, 2021
289c7ed
Removed symfony/yaml e doctrine/inflector
ezimuel May 19, 2021
757b4ea
Assemble command in .ci/make.sh
ezimuel Jun 28, 2021
10710de
Removed 7.12 job
ezimuel Jul 6, 2021
76d042d
Added 7.14 job
ezimuel Jul 6, 2021
af19683
Allow psr/log 2
ezimuel Aug 3, 2021
5a54391
Compatibility info for Elastic language clients
ezimuel Aug 18, 2021
24c2e51
Added compatibility in table contents
ezimuel Aug 18, 2021
36d7f86
github action to verify assemble task
philkra Aug 25, 2021
6e762ce
improved make assemble script
philkra Aug 25, 2021
54cc552
Merge pull request #1158 from elastic/validate-make-assemble-action
philkra Sep 2, 2021
2f9a3ed
[DOCS] Added compatibility section in doc + updated release notes (#1…
ezimuel Sep 14, 2021
46f3827
Added 7.15 job in CI
ezimuel Sep 21, 2021
40abc92
Added compatibility mode section in docs
ezimuel Sep 22, 2021
0dcb5c6
Updated release notes in docs
ezimuel Sep 23, 2021
f92c69e
[DOCS] Retitle Elasticsearch PHP Client doc book
jrodewig Oct 12, 2021
aef4379
[DOCS] Retitle Elasticsearch PHP Client doc book
jrodewig Oct 13, 2021
30e8a54
Updated Endpoints for 8.0.0-SNAPSHOT
ezimuel Oct 21, 2021
0334e5b
Updated cleanUpCluster() for YAML tests
ezimuel Oct 21, 2021
98e0cc7
Updated cleanup YAML test
ezimuel Nov 3, 2021
cab5a46
Disabled security for ES free configuration
ezimuel Nov 3, 2021
a370009
Updated endpoints for 8.0.0-SNAPSHOT
ezimuel Nov 3, 2021
3df6517
Renamed 7.x branch in 7.16 and removed 7.14 job
ezimuel Nov 16, 2021
7c149a6
fix(client-from-config): renamed the includePortInHostHeader to start…
Nov 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,4 @@ RUN composer install

COPY . .

# Updating elasticsearch submodule
RUN git submodule update --init --recursive

CMD ["bash", ".ci/yaml-tests.sh"]
5 changes: 3 additions & 2 deletions .ci/functions/imports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ if [[ -z $es_node_name ]]; then
export es_node_name=instance
export elastic_password=changeme
export elasticsearch_image=elasticsearch
export elasticsearch_url=https://elastic:${elastic_password}@${es_node_name}:9200
export elasticsearch_scheme="https"
if [[ $TEST_SUITE != "platinum" ]]; then
export elasticsearch_url=http://${es_node_name}:9200
export elasticsearch_scheme="http"
fi
export elasticsearch_url=${elasticsearch_scheme}://elastic:${elastic_password}@${es_node_name}:9200
export external_elasticsearch_url=${elasticsearch_url/$es_node_name/localhost}
export elasticsearch_container="${elasticsearch_image}:${STACK_VERSION}"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
- job:
name: elastic+elasticsearch-php+7.x
display-name: 'elastic / elasticsearch-php # 7.x'
description: Testing the elasticsearch-php 7.x branch.
name: elastic+elasticsearch-php+6.8.x
display-name: 'elastic / elasticsearch-php # 6.8.x'
description: Testing the elasticsearch-php 6.8.x branch.
parameters:
- string:
name: branch_specifier
default: refs/heads/7.x
default: refs/heads/6.8.x
description: the Git branch specifier to build (<branchName>, <tagName>,
<commitId>, etc.)
triggers:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
- job:
name: elastic+elasticsearch-php+7.10
display-name: 'elastic / elasticsearch-php # 7.10'
description: Testing the elasticsearch-php 7.10 branch.
name: elastic+elasticsearch-php+7.15
display-name: 'elastic / elasticsearch-php # 7.15'
description: Testing the elasticsearch-php 7.15 branch.
parameters:
- string:
name: branch_specifier
default: refs/heads/7.10
default: refs/heads/7.15
description: the Git branch specifier to build (<branchName>, <tagName>,
<commitId>, etc.)
triggers:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
- job:
name: elastic+elasticsearch-php+7.9
display-name: 'elastic / elasticsearch-php # 7.9'
description: Testing the elasticsearch-php 7.9 branch.
name: elastic+elasticsearch-php+7.16
display-name: 'elastic / elasticsearch-php # 7.16'
description: Testing the elasticsearch-php 7.16 branch.
parameters:
- string:
name: branch_specifier
default: refs/heads/7.9
default: refs/heads/7.16
description: the Git branch specifier to build (<branchName>, <tagName>,
<commitId>, etc.)
triggers:
Expand Down
1 change: 1 addition & 0 deletions .ci/jobs/elastic+elasticsearch-php+pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
github-hooks: true
status-context: clients-ci
cancel-builds-on-update: true
publishers: []
169 changes: 169 additions & 0 deletions .ci/make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
#!/usr/bin/env bash

# ------------------------------------------------------- #
#
# Skeleton for common build entry script for all elastic
# clients. Needs to be adapted to individual client usage.
#
# Must be called: ./.ci/make.sh <target> <params>
#
# Version: 1.1.0
#
# Targets:
# ---------------------------
# assemble <VERSION> : build client artefacts with version
# bump <VERSION> : bump client internals to version
# codegen <VERSION> : generate endpoints
# docsgen <VERSION> : generate documentation
# examplegen : generate the doc examples
# clean : clean workspace
#
# ------------------------------------------------------- #

# ------------------------------------------------------- #
# Bootstrap
# ------------------------------------------------------- #

script_path=$(dirname "$(realpath -s "$0")")
repo=$(realpath "$script_path/../")

# shellcheck disable=SC1090
CMD=$1
TASK=$1
TASK_ARGS=()
VERSION=$2
STACK_VERSION=$VERSION
set -euo pipefail

product="elastic/elasticsearch-php"
output_folder=".ci/output"
codegen_folder=".ci/output"
OUTPUT_DIR="$repo/${output_folder}"
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
mkdir -p "$OUTPUT_DIR"

echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
echo -e "\033[34;1mINFO:\033[0m OUTPUT_DIR ${OUTPUT_DIR}\033[0m"

# ------------------------------------------------------- #
# Parse Command
# ------------------------------------------------------- #

case $CMD in
clean)
echo -e "\033[36;1mTARGET: clean workspace $output_folder\033[0m"
rm -rfv "$output_folder"
echo -e "\033[32;1mTARGET: clean - done.\033[0m"
exit 0
;;
assemble)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: assemble -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: assemble artefact $VERSION\033[0m"
TASK=release
TASK_ARGS=("$VERSION" "$output_folder")
;;
codegen)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: codegen -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
TASK=codegen
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION" "$codegen_folder")
;;
docsgen)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: docsgen -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: generate docs for $VERSION\033[0m"
TASK=codegen
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION" "$codegen_folder")
;;
examplesgen)
echo -e "\033[36;1mTARGET: generate examples\033[0m"
TASK=codegen
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION" "$codegen_folder")
;;
bump)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: bump -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: bump to version $VERSION\033[0m"
TASK=bump
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION")
;;
*)
echo -e "\nUsage:\n\t $CMD is not supported right now\n"
exit 1
esac


# ------------------------------------------------------- #
# Build Container
# ------------------------------------------------------- #

#echo -e "\033[34;1mINFO: building $product container\033[0m"

#docker build --file .ci/Dockerfile --tag ${product} \
# --build-arg USER_ID="$(id -u)" \
# --build-arg GROUP_ID="$(id -g)" .


# ------------------------------------------------------- #
# Run the Container
# ------------------------------------------------------- #

#echo -e "\033[34;1mINFO: running $product container\033[0m"

#docker run \
# --env "DOTNET_VERSION" \
# --name test-runner \
# --volume $REPO_BINDING \
# --rm \
# $product \
# /bin/bash -c "./build.sh $TASK ${TASK_ARGS[*]} && chown -R $(id -u):$(id -g) ."

# ------------------------------------------------------- #
# Post Command tasks & checks
# ------------------------------------------------------- #

if [[ "$CMD" == "assemble" ]]; then
echo -e "\033[34;1mINFO: copy artefacts\033[0m"
rsync -ar --exclude=.ci --exclude=.git --filter=':- .gitignore' "$PWD" "${output_folder}/."

if compgen -G ".ci/output/*" > /dev/null; then
cd $repo/.ci/output && tar -czf elasticsearch-php-$VERSION.tar.gz * && cd -
rm -Rf "${repo}/.ci/output/elasticsearch-php"
echo -e "\033[32;1mTARGET: successfully assembled client v$VERSION\033[0m"
exit 0
else
echo -e "\033[31;1mTARGET: assemble failed, empty workspace!\033[0m"
exit 1
fi
fi

if [[ "$CMD" == "bump" ]]; then
echo "TODO"
fi

if [[ "$CMD" == "codegen" ]]; then
echo "TODO"
fi

if [[ "$CMD" == "docsgen" ]]; then
echo "TODO"
fi

if [[ "$CMD" == "examplesgen" ]]; then
echo "TODO"
fi
17 changes: 14 additions & 3 deletions .ci/run-elasticsearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Export the TEST_SUITE variable, eg. 'free' or 'platinum' defaults to 'free'.
# Export the NUMBER_OF_NODES variable to start more than 1 node

# Version 1.3.0
# Version 1.6.0
# - Initial version of the run-elasticsearch.sh script
# - Deleting the volume should not dependent on the container still running
# - Fixed `ES_JAVA_OPTS` config
Expand All @@ -17,6 +17,9 @@
# - Added 5 retries on docker pull for fixing transient network errors
# - Added flags to make local CCR configurations work
# - Added action.destructive_requires_name=false as the default will be true in v8
# - Added ingest.geoip.downloader.enabled=false as it causes false positives in testing
# - Moved ELASTIC_PASSWORD and xpack.security.enabled to the base arguments for "Security On by default"
# - Use https only when TEST_SUITE is "platinum", when "free" use http

script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
Expand All @@ -30,6 +33,8 @@ cluster_name=${moniker}${suffix}

declare -a volumes
environment=($(cat <<-END
--env ELASTIC_PASSWORD=$elastic_password
--env xpack.security.enabled=false
--env node.name=$es_node_name
--env cluster.name=$cluster_name
--env cluster.initial_master_nodes=$master_node_name
Expand All @@ -40,13 +45,14 @@ environment=($(cat <<-END
--env path.repo=/tmp
--env repositories.url.allowed_urls=http://snapshot.test*
--env action.destructive_requires_name=false
--env ingest.geoip.downloader.enabled=false
--env cluster.deprecation_indexing.enabled=false
END
))
if [[ "$TEST_SUITE" == "platinum" ]]; then
environment+=($(cat <<-END
--env ELASTIC_PASSWORD=$elastic_password
--env xpack.license.self_generated.type=trial
--env xpack.security.enabled=true
--env xpack.license.self_generated.type=trial
--env xpack.security.http.ssl.enabled=true
--env xpack.security.http.ssl.verification_mode=certificate
--env xpack.security.http.ssl.key=certs/testnode.key
Expand All @@ -65,6 +71,11 @@ END
--volume $ssl_ca:/usr/share/elasticsearch/config/certs/ca.crt
END
))
else
environment+=($(cat <<-END
--env xpack.security.http.ssl.enabled=false
END
))
fi

cert_validation_flags=""
Expand Down
4 changes: 2 additions & 2 deletions .ci/test-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
STACK_VERSION:
- 7.x-SNAPSHOT
- 8.0.0-SNAPSHOT

PHP_VERSION:
- 8.0-cli
- 7.4-cli
Expand Down
2 changes: 1 addition & 1 deletion .ci/yaml-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Download the YAML test from Elasticsearch artifacts
# Checkout the YAML test from Elasticsearch tag
php util/RestSpecRunner.php

# Generate the YAML tests for PHPUnit
Expand Down
20 changes: 10 additions & 10 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Files to exclude when creating archive
/tests export-ignore
/.ci export-ignore
/.github export-ignore
/.gitmodules export-ignore
/tests export-ignore
/util export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitmodules export-ignore
/.php_cs export-ignore
/.travis.yml export-ignore
/.phpstan-src.neon export-ignore
/.phpstan-src-71.neon export-ignore
/.phpstan-tests.neon export-ignore
/phpunit-integration.xml export-ignore
/phpunit.xml export-ignore
/phpstan.neon export-ignore
/phpunit-integration-tests.xml export-ignore
/phpunit-yaml-free-tests.xml export-ignore
/phpunit-yaml-platinum-tests.xml export-ignore
/phpunit.xml.dist export-ignore
/ruleset.xml export-ignore
/travis export-ignore
/util export-ignore
43 changes: 43 additions & 0 deletions .github/check-license-headers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash

# 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)

NLINES1=$(($(wc -l .github/license-header.txt | awk '{print $1}')+1))
NLINES2=$((NLINES1 + 1))

function check_license_header {
local f
f=$1

if ! diff -w .github/license-header.txt <(head -$NLINES2 "$f" | tail -$NLINES1) >/dev/null; then
echo "check-license-headers: error: '$f' does not have required license header, see 'diff -w .github/license-header.txt <(head -$NLINES2 $f | tail -$NLINES1)'"
return 1
else
return 0
fi
}


cd "$TOP"
nErrors=0
for f in $(git ls-files | grep '\.php$'); do
if ! check_license_header $f; then
nErrors=$((nErrors+1))
fi
done

if [[ $nErrors -eq 0 ]]; then
exit 0
else
exit 1
fi
Loading