From 52963ddf585181fc9e7fe711604b13e03eedc509 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Mon, 20 Jan 2025 08:56:10 +0000 Subject: [PATCH 1/3] [API] Adds hard boolean parameter to connector.delete, updates docs --- .../lib/elasticsearch/api/actions/cluster/get_settings.rb | 2 +- .../lib/elasticsearch/api/actions/connector/delete.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb index 8cff9de9d4..12beaf9acc 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb @@ -25,7 +25,7 @@ module Actions # Returns cluster settings. # # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Boolean] :include_defaults Whether to return all default clusters setting. # @option arguments [Hash] :headers Custom HTTP headers diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/delete.rb index 4e73882b30..a10c9e3058 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/delete.rb @@ -29,6 +29,7 @@ module Actions # support SLA of official GA features. # # @option arguments [String] :connector_id The unique identifier of the connector to be deleted. + # @option arguments [Boolean] :hard If true, the connector doc is deleted. If false, connector doc is marked as deleted (soft-deleted). # @option arguments [Boolean] :delete_sync_jobs Determines whether associated sync jobs are also deleted. # @option arguments [Hash] :headers Custom HTTP headers # From 9eec72d522acfb886c370a34489987f10c820bbc Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Mon, 20 Jan 2025 08:56:23 +0000 Subject: [PATCH 2/3] [API] Removes indices.unfreeze --- .../api/actions/indices/unfreeze.rb | 71 -------------- .../api/actions/indices/unfreeze_spec.rb | 97 ------------------- 2 files changed, 168 deletions(-) delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/indices/unfreeze.rb delete mode 100644 elasticsearch-api/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/unfreeze.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/unfreeze.rb deleted file mode 100644 index 6263d97b2b..0000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/unfreeze.rb +++ /dev/null @@ -1,71 +0,0 @@ -# Licensed to Elasticsearch B.V. under one or more contributor -# license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright -# ownership. Elasticsearch B.V. licenses this file to you under -# the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Indices - module Actions - # Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. - # - # @option arguments [String] :index The name of the index to unfreeze - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [String] :wait_for_active_shards Sets the number of active shards to wait for before the operation returns. - # @option arguments [Hash] :headers Custom HTTP headers - # - # *Deprecation notice*: - # Frozen indices are deprecated because they provide no benefit given improvements in heap memory utilization. They will be removed in a future release. - # Deprecated since version 7.14.0 - # - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/unfreeze-index-api.html - # - def unfreeze(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'indices.unfreeze' } - - defined_params = [:index].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _index = arguments.delete(:index) - - method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_unfreeze" - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb deleted file mode 100644 index b9e48d1c44..0000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb +++ /dev/null @@ -1,97 +0,0 @@ -# Licensed to Elasticsearch B.V. under one or more contributor -# license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright -# ownership. Elasticsearch B.V. licenses this file to you under -# the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -require 'spec_helper' - -describe 'client.indices#unfreeze' do - - let(:expected_args) do - [ - 'POST', - url, - params, - nil, - {}, - { defined_params: { index: 'foo' }, endpoint: 'indices.unfreeze' } - ] - end - - let(:params) do - {} - end - - context 'when there is no index specified' do - - let(:client) do - Class.new { include Elasticsearch::API }.new - end - - it 'raises an exception' do - expect { - client.indices.unfreeze - }.to raise_exception(ArgumentError) - end - end - - context 'when an index is specified' do - - let(:url) do - 'foo/_unfreeze' - end - - it 'performs the request' do - expect(client_double.indices.unfreeze(index: 'foo')).to be_a Elasticsearch::API::Response - end - end - - context 'when params are specified' do - - let(:params) do - { timeout: '1s' } - end - - let(:url) do - 'foo/_unfreeze' - end - - it 'performs the request' do - expect(client_double.indices.unfreeze(index: 'foo', timeout: '1s')).to be_a Elasticsearch::API::Response - end - end - - context 'when the path must be URL-escaped' do - - let(:url) do - 'foo%5Ebar/_unfreeze' - end - - let(:expected_args) do - [ - 'POST', - url, - params, - nil, - {}, - { defined_params: { index: 'foo^bar' }, endpoint: 'indices.unfreeze' } - ] - end - - it 'performs the request' do - expect(client_double.indices.unfreeze(index: 'foo^bar')).to be_a Elasticsearch::API::Response - end - end -end From 933dcc1525b8ce0384da48e6a45c25a3b9eb6adf Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Mon, 20 Jan 2025 09:09:15 +0000 Subject: [PATCH 3/3] [CI] Visual detail in failures - log results --- .buildkite/log-results.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/log-results.sh b/.buildkite/log-results.sh index 2ee3d01b3a..d3fb1c4e43 100755 --- a/.buildkite/log-results.sh +++ b/.buildkite/log-results.sh @@ -17,7 +17,7 @@ for f in $files; do FAILED_TESTS=`grep -A1 "E,.*" $f | sed 's/\#/-/g' | sed 's/^--/\n/g'` if [[ -n "$FAILED_TESTS" ]]; then buildkite-agent annotate --append "
" - buildkite-agent annotate --append "Failures in $f + buildkite-agent annotate --append ":x: Failures in $f $FAILED_TESTS
" fi