Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into googleurl_patch_update
Browse files Browse the repository at this point in the history
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
  • Loading branch information
adisuissa committed May 10, 2024
2 parents 2323497 + a1ce0ee commit b287e4e
Show file tree
Hide file tree
Showing 194 changed files with 1,873 additions and 2,703 deletions.
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ build:macos --action_env=PATH=/opt/homebrew/bin:/opt/local/bin:/usr/local/bin:/u
build:macos --host_action_env=PATH=/opt/homebrew/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin
build:macos --define tcmalloc=disabled

# Workaround issue with pkgconfig, see https://github.com/envoyproxy/envoy/issues/33225
build:macos --host_action_env=CXXFLAGS=-Wno-int-conversion
build:macos --action_env=CXXFLAGS=-Wno-int-conversion
build:macos --host_action_env=CFLAGS=-Wno-int-conversion
build:macos --action_env=CFLAGS=-Wno-int-conversion

# macOS ASAN/UBSAN
build:macos-asan --config=asan
# Workaround, see https://github.com/bazelbuild/bazel/issues/6932
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: results.sarif
results_format: sarif
Expand Down
12 changes: 6 additions & 6 deletions api/bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "bazel-skylib",
project_desc = "Common useful functions and rules for Bazel",
project_url = "https://github.com/bazelbuild/bazel-skylib",
version = "1.5.0",
sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
release_date = "2023-11-06",
version = "1.6.1",
sha256 = "9f38886a40548c6e96c106b752f242130ee11aaa068a56ba7e56f4511f33e4f2",
release_date = "2024-04-25",
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz"],
use_category = ["api"],
license = "Apache-2.0",
Expand Down Expand Up @@ -118,9 +118,9 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "OpenTelemetry Proto",
project_desc = "Language Independent Interface Types For OpenTelemetry",
project_url = "https://github.com/open-telemetry/opentelemetry-proto",
version = "1.3.0",
sha256 = "73a678b0ff7a29b581381566a2230fe2a00b864608786c99c050a4492e2bbafc",
release_date = "2024-04-24",
version = "1.3.1",
sha256 = "bed250ceec8e4a83aa5604d7d5595a61945059dc662edd058a9da082283f7a00",
release_date = "2024-05-07",
strip_prefix = "opentelemetry-proto-{version}",
urls = ["https://github.com/open-telemetry/opentelemetry-proto/archive/v{version}.tar.gz"],
use_category = ["api"],
Expand Down
6 changes: 3 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "Aspect Bazel helpers",
project_desc = "Base Starlark libraries and basic Bazel rules which are useful for constructing rulesets and BUILD files",
project_url = "https://github.com/aspect-build/bazel-lib",
version = "2.7.1",
sha256 = "b554eb7942a5ab44c90077df6a0c76fc67c5874c9446a007e9ba68be82bd4796",
version = "2.7.3",
sha256 = "87ab4ec479ebeb00d286266aca2068caeef1bb0b1765e8f71c7b6cfee6af4226",
strip_prefix = "bazel-lib-{version}",
urls = ["https://github.com/aspect-build/bazel-lib/archive/v{version}.tar.gz"],
use_category = ["build"],
release_date = "2024-04-20",
release_date = "2024-05-08",
cpe = "N/A",
license = "Apache-2.0",
license_url = "https://github.com/aspect-build/bazel-lib/blob/v{version}/LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion contrib/generic_proxy/filters/network/source/router/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ envoy_cc_library(
"//source/common/router:metadatamatchcriteria_lib",
"//source/common/stream_info:stream_info_lib",
"//source/common/tracing:tracer_lib",
"//source/common/upstream:load_balancer_lib",
"//source/common/upstream:load_balancer_context_base_lib",
"@envoy_api//contrib/envoy/extensions/filters/network/generic_proxy/router/v3:pkg_cc_proto",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "source/common/buffer/buffer_impl.h"
#include "source/common/common/linked_object.h"
#include "source/common/stream_info/stream_info_impl.h"
#include "source/common/upstream/load_balancer_impl.h"
#include "source/common/upstream/load_balancer_context_base.h"

#include "contrib/envoy/extensions/filters/network/generic_proxy/router/v3/router.pb.h"
#include "contrib/envoy/extensions/filters/network/generic_proxy/router/v3/router.pb.validate.h"
Expand Down
4 changes: 2 additions & 2 deletions contrib/golang/filters/network/source/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ envoy_cc_library(
"//source/common/network:utility_lib",
"//source/common/stream_info:stream_info_lib",
"//source/common/tcp:conn_pool_lib",
"//source/common/upstream:load_balancer_lib",
"//source/common/upstream:load_balancer_context_base_lib",
"//source/extensions/filters/network/common:factory_base_lib",
"@envoy_api//contrib/envoy/extensions/filters/network/golang/v3alpha:pkg_cc_proto",
],
Expand Down Expand Up @@ -97,7 +97,7 @@ envoy_cc_contrib_extension(
"//source/common/common:minimal_logger_lib",
"//source/common/memory:utils_lib",
"//source/common/network:connection_lib",
"//source/common/upstream:load_balancer_lib",
"//source/common/upstream:load_balancer_context_base_lib",
"//source/extensions/filters/network:well_known_names",
"//source/extensions/filters/network/common:factory_base_lib",
"@envoy_api//contrib/envoy/extensions/filters/network/golang/v3alpha:pkg_cc_proto",
Expand Down
2 changes: 1 addition & 1 deletion contrib/golang/filters/network/source/golang.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "source/common/buffer/buffer_impl.h"
#include "source/common/common/logger.h"
#include "source/common/network/connection_impl.h"
#include "source/common/upstream/load_balancer_impl.h"
#include "source/common/upstream/load_balancer_context_base.h"
#include "source/extensions/filters/network/common/factory_base.h"

#include "contrib/envoy/extensions/filters/network/golang/v3alpha/golang.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion contrib/golang/filters/network/source/upstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "source/common/memory/utils.h"
#include "source/common/network/connection_impl.h"
#include "source/common/stream_info/stream_info_impl.h"
#include "source/common/upstream/load_balancer_impl.h"
#include "source/common/upstream/load_balancer_context_base.h"
#include "source/extensions/filters/network/common/factory_base.h"

#include "contrib/envoy/extensions/filters/network/golang/v3alpha/golang.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion contrib/rocketmq_proxy/filters/network/source/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ envoy_cc_library(
"//source/common/common:linked_object",
"//source/common/protobuf:utility_lib",
"//source/common/stats:timespan_lib",
"//source/common/upstream:load_balancer_lib",
"//source/common/upstream:load_balancer_context_base_lib",
"//source/extensions/filters/network:well_known_names",
"@envoy_api//contrib/envoy/extensions/filters/network/rocketmq_proxy/v3:pkg_cc_proto",
],
Expand Down
2 changes: 1 addition & 1 deletion contrib/rocketmq_proxy/filters/network/source/router/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ envoy_cc_library(
deps = [
"//envoy/tcp:conn_pool_interface",
"//envoy/upstream:load_balancer_interface",
"//source/common/upstream:load_balancer_lib",
"//source/common/upstream:load_balancer_context_base_lib",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "envoy/tcp/conn_pool.h"

#include "source/common/upstream/load_balancer_impl.h"
#include "source/common/upstream/load_balancer_context_base.h"

namespace Envoy {
namespace Extensions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "envoy/upstream/thread_local_cluster.h"

#include "source/common/common/logger.h"
#include "source/common/upstream/load_balancer_impl.h"
#include "source/common/upstream/load_balancer_context_base.h"

#include "contrib/rocketmq_proxy/filters/network/source/router/router.h"

Expand Down
2 changes: 1 addition & 1 deletion contrib/sip_proxy/filters/network/source/router/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ envoy_cc_library(
"//source/common/common:logger_lib",
"//source/common/http:header_utility_lib",
"//source/common/router:metadatamatchcriteria_lib",
"//source/common/upstream:load_balancer_lib",
"//source/common/upstream:load_balancer_context_base_lib",
"@envoy_api//contrib/envoy/extensions/filters/network/sip_proxy/tra/v3alpha:pkg_cc_proto",
"@envoy_api//contrib/envoy/extensions/filters/network/sip_proxy/v3alpha:pkg_cc_proto",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "source/common/common/macros.h"
#include "source/common/http/header_utility.h"
#include "source/common/tracing/http_tracer_impl.h"
#include "source/common/upstream/load_balancer_impl.h"
#include "source/common/upstream/load_balancer_context_base.h"

#include "contrib/envoy/extensions/filters/network/sip_proxy/tra/v3alpha/tra.pb.h"
#include "contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/route.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion envoy/upstream/load_balancer.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class ThreadAwareLoadBalancer {
* instantiate any needed structured and prepare for further updates. The cluster manager
* will do this at the appropriate time.
*/
virtual void initialize() PURE;
virtual absl::Status initialize() PURE;
};

using ThreadAwareLoadBalancerPtr = std::unique_ptr<ThreadAwareLoadBalancer>;
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql/Dockerfile-mysql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM mysql:8.4.0@sha256:e4054c2973be8766370769312786404fbb4557fb591d9ad37beb2d00a2c574a6
FROM mysql:8.4.0@sha256:4a4e5e2a19aab7a67870588952e8f401e17a330466ecfc55c9acf51196da5bd0
2 changes: 1 addition & 1 deletion examples/shared/postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM postgres:latest@sha256:4aea012537edfad80f98d870a36e6b90b4c09b27be7f4b4759d72db863baeebb
FROM postgres:latest@sha256:ba727f758a75cdd503c6b63db66a5fbc22ded0a228952e9d88e601621ad4de64
COPY docker-healthcheck.sh /usr/local/bin/
HEALTHCHECK CMD ["docker-healthcheck.sh"]
2 changes: 1 addition & 1 deletion examples/single-page-app/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.6",
"eslint-plugin-react-refresh": "^0.4.7",
"typescript": "*",
"vite": "^5.2.11"
}
Expand Down
8 changes: 4 additions & 4 deletions examples/single-page-app/ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2445,10 +2445,10 @@ eslint-plugin-react-hooks@^4.6.2:
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz#c829eb06c0e6f484b3fbb85a97e57784f328c596"
integrity sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==

eslint-plugin-react-refresh@^0.4.6:
version "0.4.6"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.6.tgz#e8e8accab681861baed00c5c12da70267db0936f"
integrity sha512-NjGXdm7zgcKRkKMua34qVO9doI7VOxZ6ancSvBELJSSoX97jyndXcSoa8XBh69JoB31dNz3EEzlMcizZl7LaMA==
eslint-plugin-react-refresh@^0.4.7:
version "0.4.7"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.7.tgz#1f597f9093b254f10ee0961c139a749acb19af7d"
integrity sha512-yrj+KInFmwuQS2UQcg1SF83ha1tuHC1jMQbRNyuWtlEzzKRDgAl7L4Yp4NlDUZTZNlWvHEzOtJhMi40R7JxcSw==

eslint-plugin-react@^7.34.1:
version "7.34.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/skywalking/Dockerfile-elasticsearch
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM elasticsearch:8.13.3@sha256:9ab33024ebd4a478c4d71dfed52cb06a30b04cd97fdc7a74ad7ed16cc91ab647
FROM elasticsearch:8.13.4@sha256:11e1717dd78f46fbecf64f7f27a358d331abb5e95b5451c00730243ee44fb665
73 changes: 36 additions & 37 deletions mobile/examples/cc/fetch_client/fetch_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
#include "source/common/stats/thread_local_store.h"
#include "source/exe/platform_impl.h"

#include "library/cc/engine_builder.h"
#include "library/cc/stream.h"
#include "library/common/data/utility.h"
#include "library/common/http/header_utility.h"
#include "library/common/types/c_types.h"

namespace Envoy {

Expand Down Expand Up @@ -41,8 +44,8 @@ void Fetch::fetch(const std::vector<absl::string_view>& urls) {
}
}

void Fetch::sendRequest(const absl::string_view url_string) {
Envoy::Http::Utility::Url url;
void Fetch::sendRequest(absl::string_view url_string) {
Http::Utility::Url url;
if (!url.initialize(url_string, /*is_connect_request=*/false)) {
std::cerr << "Unable to parse url: '" << url_string << "'\n";
return;
Expand All @@ -55,45 +58,41 @@ void Fetch::sendRequest(const absl::string_view url_string) {
absl::MutexLock lock(&engine_mutex_);
stream_prototype = engine_->streamClient()->newStreamPrototype();
}
stream_prototype->setOnHeaders(
[](Platform::ResponseHeadersSharedPtr headers, bool, envoy_stream_intel intel) {
std::cerr << "Received headers on connection: " << intel.connection_id << "\n";

const Platform::RawHeaderMap raw_headers = headers->allHeaders();
for (const auto& [key, header] : raw_headers) {
for (const auto& val : header) {
std::cout << key << ": " << val << "\n";
}
}
});
stream_prototype->setOnData([](envoy_data c_data, bool fin) {
std::cout << Data::Utility::copyToString(c_data);
if (fin) {
std::cout << "Received final data\n";
EnvoyStreamCallbacks stream_callbacks;
stream_callbacks.on_headers_ = [](const Http::ResponseHeaderMap& headers, bool /* end_stream */,
envoy_stream_intel intel) {
std::cerr << "Received headers on connection: " << intel.connection_id << "with headers:\n"
<< headers << "\n";
};
stream_callbacks.on_data_ = [](const Buffer::Instance& buffer, uint64_t length, bool end_stream,
envoy_stream_intel) {
std::string response_body(length, ' ');
buffer.copyOut(0, length, response_body.data());
std::cerr << response_body << "\n";
if (end_stream) {
std::cerr << "Received final data\n";
}
release_envoy_data(c_data);
});
stream_prototype->setOnComplete(
[&request_finished](envoy_stream_intel, envoy_final_stream_intel final_intel) {
std::cerr << "Request finished after "
<< final_intel.stream_end_ms - final_intel.stream_start_ms << "ms\n";
request_finished.Notify();
});
stream_prototype->setOnError([&request_finished](Platform::EnvoyErrorSharedPtr,
envoy_stream_intel,
};
stream_callbacks.on_complete_ = [&request_finished](envoy_stream_intel,
envoy_final_stream_intel final_intel) {
std::cerr << "Request finished after "
<< final_intel.stream_end_ms - final_intel.stream_start_ms << "ms\n";
request_finished.Notify();
};
stream_callbacks.on_error_ = [&request_finished](EnvoyError error, envoy_stream_intel,
envoy_final_stream_intel final_intel) {
std::cerr << "Request failed after " << final_intel.stream_end_ms - final_intel.stream_start_ms
<< "ms\n";
<< "ms with error message: " << error.message << "\n";
request_finished.Notify();
});
stream_prototype->setOnCancel(
[&request_finished](envoy_stream_intel, envoy_final_stream_intel final_intel) {
std::cerr << "Request cancelled after "
<< final_intel.stream_end_ms - final_intel.stream_start_ms << "ms\n";
request_finished.Notify();
});

Platform::StreamSharedPtr stream = stream_prototype->start(/*explicit_flow_control=*/false);
};
stream_callbacks.on_cancel_ = [&request_finished](envoy_stream_intel,
envoy_final_stream_intel final_intel) {
std::cerr << "Request cancelled after "
<< final_intel.stream_end_ms - final_intel.stream_start_ms << "ms\n";
request_finished.Notify();
};
Platform::StreamSharedPtr stream =
stream_prototype->start(std::move(stream_callbacks), /*explicit_flow_control=*/false);

auto headers = Http::Utility::createRequestHeaderMapPtr();
headers->addCopy(Http::LowerCaseString(":method"), "GET");
Expand Down
24 changes: 10 additions & 14 deletions mobile/examples/cc/fetch_client/fetch_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@
#include "source/common/stats/allocator_impl.h"
#include "source/common/stats/thread_local_store.h"
#include "source/exe/platform_impl.h"
#include "source/exe/process_wide.h"

#include "absl/base/thread_annotations.h"
#include "absl/synchronization/mutex.h"
#include "absl/synchronization/notification.h"
#include "library/cc/engine_builder.h"
#include "library/cc/stream.h"
#include "library/cc/stream_prototype.h"
#include "library/common/http/client.h"
#include "library/common/types/c_types.h"

namespace Envoy {

Expand All @@ -34,16 +30,16 @@ class Fetch {

private:
void runEngine(absl::Notification& engine_running);
void sendRequest(const absl::string_view url);

Envoy::Thread::MutexBasicLockable lock_;
Envoy::Logger::Context logging_context_;
Envoy::PlatformImpl platform_impl_;
Envoy::Stats::SymbolTableImpl symbol_table_;
Envoy::Event::RealTimeSystem time_system_; // NO_CHECK_FORMAT(real_time)
Envoy::Stats::AllocatorImpl stats_allocator_;
Envoy::Stats::ThreadLocalStoreImpl store_root_;
Envoy::Random::RandomGeneratorImpl random_generator_;
void sendRequest(absl::string_view url);

Thread::MutexBasicLockable lock_;
Logger::Context logging_context_;
PlatformImpl platform_impl_;
Stats::SymbolTableImpl symbol_table_;
Event::RealTimeSystem time_system_; // NO_CHECK_FORMAT(real_time)
Stats::AllocatorImpl stats_allocator_;
Stats::ThreadLocalStoreImpl store_root_;
Random::RandomGeneratorImpl random_generator_;
envoy::config::bootstrap::v3::Bootstrap bootstrap_;
Api::ApiPtr api_;

Expand Down
Loading

0 comments on commit b287e4e

Please sign in to comment.