Compare commits

...

9 Commits

8 changed files with 93 additions and 42 deletions

View File

@ -1,15 +1,26 @@
ARG NODE_JS_VERSION=18
FROM node:${NODE_JS_VERSION}
# Create app directory
WORKDIR /usr/src/app
ARG BUILDER_UID=1000
ARG BUILDER_GID=1000
ENV BUILDER_USER elastic
ENV BUILDER_GROUP elastic
RUN apt-get clean -y
RUN apt-get update -y
RUN apt-get install -y zip
# install zip util
RUN apt-get clean -y && \
apt-get update -y && \
apt-get install -y zip
# Set user permissions and directory
RUN groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP} \
&& useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GROUP} -m elastic 1>/dev/null 2>/dev/null \
&& mkdir -p /usr/src/elasticsearch-js \
&& chown -R ${BUILDER_USER}:${BUILDER_GROUP} /usr/src/
WORKDIR /usr/src/elasticsearch-js
USER ${BUILDER_USER}:${BUILDER_GROUP}
# Install app dependencies
COPY package*.json ./
COPY --chown=$BUILDER_USER:$BUILDER_GROUP package*.json ./
RUN npm install
COPY . .
COPY --chown=$BUILDER_USER:$BUILDER_GROUP . .

View File

@ -12,7 +12,7 @@
# assemble <VERSION> : build client artifacts with version
# bump <VERSION> : bump client internals to version
# bumpmatrix <VERSION> : bump stack version in test matrix to version
# codegen : generate endpoints
# codegen <VERSION> : generate endpoints
# docsgen <VERSION> : generate documentation
# examplegen : generate the doc examples
# clean : clean workspace
@ -24,7 +24,6 @@
# ------------------------------------------------------- #
script_path=$(dirname "$(realpath -s "$0")")
repo=$(realpath "$script_path/../")
generator=$(realpath "$script_path/../../elastic-client-generator-js")
# shellcheck disable=SC1090
CMD=$1
@ -38,7 +37,6 @@ product="elastic/elasticsearch-js"
output_folder=".ci/output"
codegen_folder=".ci/output"
OUTPUT_DIR="$repo/${output_folder}"
# REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
NODE_JS_VERSION=18
WORKFLOW=${WORKFLOW-staging}
mkdir -p "$OUTPUT_DIR"
@ -59,18 +57,29 @@ case $CMD in
echo -e "\033[31;1mTARGET: assemble -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: assemble artefact $VERSION\033[0m"
echo -e "\033[36;1mTARGET: assemble artifact $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
if [ -v "$VERSION" ] || [[ -z "$VERSION" ]]; then
# fall back to branch name or `main` if no VERSION is set
branch_name=$(git rev-parse --abbrev-ref HEAD)
if [[ "$branch_name" =~ ^[0-9]+\.[0-9]+ ]]; then
echo -e "\033[36;1mTARGET: codegen -> No VERSION argument found, using branch name: \`$branch_name\`\033[0m"
VERSION="$branch_name"
else
echo -e "\033[36;1mTARGET: codegen -> No VERSION argument found, using \`main\`\033[0m"
VERSION="main"
fi
fi
echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
if [ "$VERSION" = 'main' ]; then
echo -e "\033[36;1mTARGET: codegen API $VERSION\033[0m"
else
echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
fi
TASK=codegen
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION")
;;
docsgen)
@ -80,13 +89,11 @@ case $CMD in
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)
@ -96,7 +103,6 @@ case $CMD in
fi
echo -e "\033[36;1mTARGET: bump to version $VERSION\033[0m"
TASK=bump
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION")
;;
bumpmatrix)
@ -128,6 +134,8 @@ docker build \
--file .ci/Dockerfile \
--tag "$product" \
--build-arg NODE_JS_VERSION="$NODE_JS_VERSION" \
--build-arg "BUILDER_UID=$(id -u)" \
--build-arg "BUILDER_GID=$(id -g)" \
.
# ------------------------------------------------------- #
@ -137,15 +145,18 @@ docker build \
echo -e "\033[34;1mINFO: running $product container\033[0m"
docker run \
--volume "$repo:/usr/src/app" \
--volume "$generator:/usr/src/elastic-client-generator-js" \
--volume /usr/src/app/node_modules \
--volume "$repo:/usr/src/elasticsearch-js" \
--volume /usr/src/elasticsearch-js/node_modules \
-u "$(id -u):$(id -g)" \
--env "WORKFLOW=$WORKFLOW" \
--name make-elasticsearch-js \
--rm \
$product \
node .ci/make.mjs --task $TASK ${TASK_ARGS[*]}
/bin/bash -c "cd /usr/src && \
git clone https://$CLIENTS_GITHUB_TOKEN@github.com/elastic/elastic-client-generator-js.git && \
mkdir -p /usr/src/elastic-client-generator-js/output && \
cd /usr/src/elasticsearch-js && \
node .ci/make.mjs --task $TASK ${TASK_ARGS[*]}"
# ------------------------------------------------------- #
# Post Command tasks & checks

View File

@ -11,6 +11,6 @@ jobs:
name: Backport
steps:
- name: Backport
uses: tibdex/backport@v2
uses: tibdex/backport@7005ef85c4562bc23b0e9b4a9940d5922f439750
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,6 +1,17 @@
[[changelog-client]]
== Release notes
[discrete]
=== 8.9.1
[discrete]
==== Fixes
[discrete]
===== Upgrade Transport https://github.com/elastic/elasticsearch-js/pull/1968[#1968]
Upgrades `@elastic/transport` to the latest patch release to fix https://github.com/elastic/elastic-transport-js/pull/69[a bug] that could cause the process to exit when handling malformed `HEAD` requests.
[discrete]
=== 8.9.0

View File

@ -159,7 +159,7 @@
</a>
</div>
<div class="col-md-4 col-12 mb-2">
<a class="no-text-decoration" href="https://www.elastic.co/guide/en/welcome-to-elastic/current/getting-started-observability.html">
<a class="no-text-decoration" href="https://www.elastic.co/guide/en/starting-with-the-elasticsearch-platform-and-its-solutions/current/getting-started-observability.html">
<div class="card h-100">
<h4 class="mt-3">
<span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/bltaa08b370a00bbecc/634d9da14e565f1cdce27f7c/observability-logo-color-32px.png');"></span>

View File

@ -1,7 +1,7 @@
{
"name": "@elastic/elasticsearch",
"version": "8.9.0",
"versionCanary": "8.9.0-canary.2",
"version": "8.9.1",
"versionCanary": "8.9.1-canary.1",
"description": "The official Elasticsearch client for Node.js",
"main": "index.js",
"types": "index.d.ts",
@ -86,7 +86,7 @@
"zx": "^7.2.2"
},
"dependencies": {
"@elastic/transport": "^8.3.2",
"@elastic/transport": "^8.3.4",
"tslib": "^2.4.0"
},
"tap": {

View File

@ -3179,8 +3179,8 @@ export type AggregationsFrequentItemSetsBucket = AggregationsFrequentItemSetsBuc
export interface AggregationsFrequentItemSetsField {
field: Field
exclude?: string | string[]
include?: string | string[]
exclude?: AggregationsTermsExclude
include?: AggregationsTermsInclude
}
export type AggregationsGapPolicy = 'skip' | 'insert_zeros' | 'keep_values'
@ -3795,7 +3795,7 @@ export interface AggregationsSignificantTextAggregation extends AggregationsBuck
field?: Field
filter_duplicate_text?: boolean
gnd?: AggregationsGoogleNormalizedDistanceHeuristic
include?: string | string[]
include?: AggregationsTermsInclude
jlh?: EmptyObject
min_doc_count?: long
mutual_information?: AggregationsMutualInformationHeuristic
@ -5712,7 +5712,7 @@ export interface QueryDslQueryContainer {
term?: Partial<Record<Field, QueryDslTermQuery | FieldValue>>
terms?: QueryDslTermsQuery
terms_set?: Partial<Record<Field, QueryDslTermsSetQuery>>
text_expansion?: QueryDslTextExpansionQuery | Field
text_expansion?: Partial<Record<Field, QueryDslTextExpansionQuery>>
wildcard?: Partial<Record<Field, QueryDslWildcardQuery | string>>
wrapper?: QueryDslWrapperQuery
type?: QueryDslTypeQuery
@ -5927,7 +5927,6 @@ export interface QueryDslTermsSetQuery extends QueryDslQueryBase {
}
export interface QueryDslTextExpansionQuery extends QueryDslQueryBase {
value: Field
model_id: string
model_text: string
}
@ -9609,7 +9608,7 @@ export interface IndicesIndexSettingsKeys {
queries?: IndicesQueries
similarity?: IndicesSettingsSimilarity
mapping?: IndicesMappingLimitSettings
'indexing.slowlog'?: IndicesSlowlogSettings
'indexing.slowlog'?: IndicesIndexingSlowlogSettings
indexing_pressure?: IndicesIndexingPressure
store?: IndicesStorage
}
@ -9687,6 +9686,17 @@ export interface IndicesIndexingPressureMemory {
limit?: integer
}
export interface IndicesIndexingSlowlogSettings {
level?: string
source?: integer
reformat?: boolean
threshold?: IndicesIndexingSlowlogTresholds
}
export interface IndicesIndexingSlowlogTresholds {
index?: IndicesSlowlogTresholdLevels
}
export interface IndicesMappingLimitSettings {
coerce?: boolean
total_fields?: IndicesMappingLimitSettingsTotalFields
@ -9840,7 +9850,6 @@ export interface IndicesSlowlogTresholdLevels {
export interface IndicesSlowlogTresholds {
query?: IndicesSlowlogTresholdLevels
fetch?: IndicesSlowlogTresholdLevels
index?: IndicesSlowlogTresholdLevels
}
export interface IndicesSoftDeletes {

View File

@ -3252,8 +3252,8 @@ export type AggregationsFrequentItemSetsBucket = AggregationsFrequentItemSetsBuc
export interface AggregationsFrequentItemSetsField {
field: Field
exclude?: string | string[]
include?: string | string[]
exclude?: AggregationsTermsExclude
include?: AggregationsTermsInclude
}
export type AggregationsGapPolicy = 'skip' | 'insert_zeros' | 'keep_values'
@ -3868,7 +3868,7 @@ export interface AggregationsSignificantTextAggregation extends AggregationsBuck
field?: Field
filter_duplicate_text?: boolean
gnd?: AggregationsGoogleNormalizedDistanceHeuristic
include?: string | string[]
include?: AggregationsTermsInclude
jlh?: EmptyObject
min_doc_count?: long
mutual_information?: AggregationsMutualInformationHeuristic
@ -5785,7 +5785,7 @@ export interface QueryDslQueryContainer {
term?: Partial<Record<Field, QueryDslTermQuery | FieldValue>>
terms?: QueryDslTermsQuery
terms_set?: Partial<Record<Field, QueryDslTermsSetQuery>>
text_expansion?: QueryDslTextExpansionQuery | Field
text_expansion?: Partial<Record<Field, QueryDslTextExpansionQuery>>
wildcard?: Partial<Record<Field, QueryDslWildcardQuery | string>>
wrapper?: QueryDslWrapperQuery
type?: QueryDslTypeQuery
@ -6000,7 +6000,6 @@ export interface QueryDslTermsSetQuery extends QueryDslQueryBase {
}
export interface QueryDslTextExpansionQuery extends QueryDslQueryBase {
value: Field
model_id: string
model_text: string
}
@ -9732,7 +9731,7 @@ export interface IndicesIndexSettingsKeys {
queries?: IndicesQueries
similarity?: IndicesSettingsSimilarity
mapping?: IndicesMappingLimitSettings
'indexing.slowlog'?: IndicesSlowlogSettings
'indexing.slowlog'?: IndicesIndexingSlowlogSettings
indexing_pressure?: IndicesIndexingPressure
store?: IndicesStorage
}
@ -9810,6 +9809,17 @@ export interface IndicesIndexingPressureMemory {
limit?: integer
}
export interface IndicesIndexingSlowlogSettings {
level?: string
source?: integer
reformat?: boolean
threshold?: IndicesIndexingSlowlogTresholds
}
export interface IndicesIndexingSlowlogTresholds {
index?: IndicesSlowlogTresholdLevels
}
export interface IndicesMappingLimitSettings {
coerce?: boolean
total_fields?: IndicesMappingLimitSettingsTotalFields
@ -9963,7 +9973,6 @@ export interface IndicesSlowlogTresholdLevels {
export interface IndicesSlowlogTresholds {
query?: IndicesSlowlogTresholdLevels
fetch?: IndicesSlowlogTresholdLevels
index?: IndicesSlowlogTresholdLevels
}
export interface IndicesSoftDeletes {