diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index 2f872f391e6f..b36df76d0dd8 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -53,6 +53,8 @@ jobs: brew update brew tap mongodb/brew brew install clang-format postgresql redis kafka rabbitmq mongodb-community + mkdir -p "$(brew --prefix)/etc/rabbitmq/conf.d" + echo 'deprecated_features.permit.transient_nonexcl_queues = true' > "$(brew --prefix)/etc/rabbitmq/conf.d/10-userver-ci.conf" brew install python@3.11 - name: Checkout diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a714b89113ab..f03532c7806d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -76,6 +76,8 @@ jobs: run: | brew tap mongodb/brew brew install clickhouse redis kafka mongodb-community rabbitmq + mkdir -p "$(brew --prefix)/etc/rabbitmq/conf.d" + echo 'deprecated_features.permit.transient_nonexcl_queues = true' > "$(brew --prefix)/etc/rabbitmq/conf.d/10-userver-ci.conf" - name: Setup ccache run: | diff --git a/.mapping.json b/.mapping.json index 1fd496bffc77..990b65c0b969 100644 --- a/.mapping.json +++ b/.mapping.json @@ -2494,6 +2494,7 @@ "grpc/include/userver/ugrpc/client/impl/codegen_definitions.hpp":"taxi/uservices/userver/grpc/include/userver/ugrpc/client/impl/codegen_definitions.hpp", "grpc/include/userver/ugrpc/client/impl/compat/channel_arguments_builder.hpp":"taxi/uservices/userver/grpc/include/userver/ugrpc/client/impl/compat/channel_arguments_builder.hpp", "grpc/include/userver/ugrpc/client/impl/completion_queue_pool.hpp":"taxi/uservices/userver/grpc/include/userver/ugrpc/client/impl/completion_queue_pool.hpp", + "grpc/include/userver/ugrpc/client/impl/deadline_propagation_detect.hpp":"taxi/uservices/userver/grpc/include/userver/ugrpc/client/impl/deadline_propagation_detect.hpp", "grpc/include/userver/ugrpc/client/impl/fwd.hpp":"taxi/uservices/userver/grpc/include/userver/ugrpc/client/impl/fwd.hpp", "grpc/include/userver/ugrpc/client/impl/graceful_stream_finish.hpp":"taxi/uservices/userver/grpc/include/userver/ugrpc/client/impl/graceful_stream_finish.hpp", "grpc/include/userver/ugrpc/client/impl/method_stubs.hpp":"taxi/uservices/userver/grpc/include/userver/ugrpc/client/impl/method_stubs.hpp", @@ -2765,6 +2766,7 @@ "grpc/tests/channels_test.cpp":"taxi/uservices/userver/grpc/tests/channels_test.cpp", "grpc/tests/client_cancel_test.cpp":"taxi/uservices/userver/grpc/tests/client_cancel_test.cpp", "grpc/tests/client_factory_test.cpp":"taxi/uservices/userver/grpc/tests/client_factory_test.cpp", + "grpc/tests/client_middleware_hooks_dp_test.cpp":"taxi/uservices/userver/grpc/tests/client_middleware_hooks_dp_test.cpp", "grpc/tests/client_middleware_hooks_test.cpp":"taxi/uservices/userver/grpc/tests/client_middleware_hooks_test.cpp", "grpc/tests/client_qos_test.cpp":"taxi/uservices/userver/grpc/tests/client_qos_test.cpp", "grpc/tests/client_qos_validation_test.cpp":"taxi/uservices/userver/grpc/tests/client_qos_validation_test.cpp", @@ -4016,6 +4018,11 @@ "redis/functional_tests/cluster_auto_topology_pubsub/static_config.yaml":"taxi/uservices/userver/redis/functional_tests/cluster_auto_topology_pubsub/static_config.yaml", "redis/functional_tests/cluster_auto_topology_pubsub/tests/conftest.py":"taxi/uservices/userver/redis/functional_tests/cluster_auto_topology_pubsub/tests/conftest.py", "redis/functional_tests/cluster_auto_topology_pubsub/tests/test_redis_pubsub.py":"taxi/uservices/userver/redis/functional_tests/cluster_auto_topology_pubsub/tests/test_redis_pubsub.py", + "redis/functional_tests/cluster_shards_auto_topology/CMakeLists.txt":"taxi/uservices/userver/redis/functional_tests/cluster_shards_auto_topology/CMakeLists.txt", + "redis/functional_tests/cluster_shards_auto_topology/redis_service.cpp":"taxi/uservices/userver/redis/functional_tests/cluster_shards_auto_topology/redis_service.cpp", + "redis/functional_tests/cluster_shards_auto_topology/static_config.yaml":"taxi/uservices/userver/redis/functional_tests/cluster_shards_auto_topology/static_config.yaml", + "redis/functional_tests/cluster_shards_auto_topology/tests/conftest.py":"taxi/uservices/userver/redis/functional_tests/cluster_shards_auto_topology/tests/conftest.py", + "redis/functional_tests/cluster_shards_auto_topology/tests/test_redis_cluster.py":"taxi/uservices/userver/redis/functional_tests/cluster_shards_auto_topology/tests/test_redis_cluster.py", "redis/functional_tests/database_index/CMakeLists.txt":"taxi/uservices/userver/redis/functional_tests/database_index/CMakeLists.txt", "redis/functional_tests/database_index/redis_service.cpp":"taxi/uservices/userver/redis/functional_tests/database_index/redis_service.cpp", "redis/functional_tests/database_index/static_config.yaml":"taxi/uservices/userver/redis/functional_tests/database_index/static_config.yaml", @@ -4078,6 +4085,7 @@ "redis/include/userver/storages/redis/sharding_strategies.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/sharding_strategies.hpp", "redis/include/userver/storages/redis/subscribe_client.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/subscribe_client.hpp", "redis/include/userver/storages/redis/subscription_token.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/subscription_token.hpp", + "redis/include/userver/storages/redis/topology_update_method.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/topology_update_method.hpp", "redis/include/userver/storages/redis/transaction.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/transaction.hpp", "redis/include/userver/storages/redis/ttl_reply.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/ttl_reply.hpp", "redis/include/userver/storages/redis/utest/redis_fixture.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/utest/redis_fixture.hpp", @@ -4107,6 +4115,12 @@ "redis/src/storages/redis/impl/cluster_shard.cpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_shard.cpp", "redis/src/storages/redis/impl/cluster_shard.hpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_shard.hpp", "redis/src/storages/redis/impl/cluster_shard_test.cpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_shard_test.cpp", + "redis/src/storages/redis/impl/cluster_shards_query.cpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_shards_query.cpp", + "redis/src/storages/redis/impl/cluster_shards_query.hpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_shards_query.hpp", + "redis/src/storages/redis/impl/cluster_shards_query_test.cpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_shards_query_test.cpp", + "redis/src/storages/redis/impl/cluster_slots_query.cpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_slots_query.cpp", + "redis/src/storages/redis/impl/cluster_slots_query.hpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_slots_query.hpp", + "redis/src/storages/redis/impl/cluster_slots_query_test.cpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_slots_query_test.cpp", "redis/src/storages/redis/impl/cluster_subscription_storage.cpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_subscription_storage.cpp", "redis/src/storages/redis/impl/cluster_subscription_storage.hpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_subscription_storage.hpp", "redis/src/storages/redis/impl/cluster_subscription_storage_test.cpp":"taxi/uservices/userver/redis/src/storages/redis/impl/cluster_subscription_storage_test.cpp", @@ -4212,6 +4226,7 @@ "redis/src/storages/redis/test/mock_client_google_test.cpp":"taxi/uservices/userver/redis/src/storages/redis/test/mock_client_google_test.cpp", "redis/src/storages/redis/test/mock_publish_waiter_test.cpp":"taxi/uservices/userver/redis/src/storages/redis/test/mock_publish_waiter_test.cpp", "redis/src/storages/redis/test/subscribe_client_mock_test.cpp":"taxi/uservices/userver/redis/src/storages/redis/test/subscribe_client_mock_test.cpp", + "redis/src/storages/redis/topology_update_method.cpp":"taxi/uservices/userver/redis/src/storages/redis/topology_update_method.cpp", "redis/src/storages/redis/transaction_impl.cpp":"taxi/uservices/userver/redis/src/storages/redis/transaction_impl.cpp", "redis/src/storages/redis/transaction_impl.hpp":"taxi/uservices/userver/redis/src/storages/redis/transaction_impl.hpp", "redis/src/storages/redis/transaction_redistest.cpp":"taxi/uservices/userver/redis/src/storages/redis/transaction_redistest.cpp", @@ -6006,6 +6021,7 @@ "universal/src/utils/not_null_test.cpp":"taxi/uservices/userver/universal/src/utils/not_null_test.cpp", "universal/src/utils/numeric_cast_test.cpp":"taxi/uservices/userver/universal/src/utils/numeric_cast_test.cpp", "universal/src/utils/optional_ref_test.cpp":"taxi/uservices/userver/universal/src/utils/optional_ref_test.cpp", + "universal/src/utils/overloaded_address_operator_test.hpp":"taxi/uservices/userver/universal/src/utils/overloaded_address_operator_test.hpp", "universal/src/utils/overloaded_test.cpp":"taxi/uservices/userver/universal/src/utils/overloaded_test.cpp", "universal/src/utils/projected_set_test.cpp":"taxi/uservices/userver/universal/src/utils/projected_set_test.cpp", "universal/src/utils/rand.cpp":"taxi/uservices/userver/universal/src/utils/rand.cpp", diff --git a/chaotic/include/userver/chaotic/io/std/chrono/milliseconds.hpp b/chaotic/include/userver/chaotic/io/std/chrono/milliseconds.hpp index e78ed2fdd31a..de573ee59426 100644 --- a/chaotic/include/userver/chaotic/io/std/chrono/milliseconds.hpp +++ b/chaotic/include/userver/chaotic/io/std/chrono/milliseconds.hpp @@ -14,10 +14,13 @@ USERVER_NAMESPACE_BEGIN namespace chaotic::convert { template +requires std::is_integral_v || std::is_floating_point_v T Convert(std::chrono::milliseconds value, chaotic::convert::To) { return utils::numeric_cast(value.count()); } +std::string Convert(const std::chrono::milliseconds& value, chaotic::convert::To); + std::chrono::milliseconds Convert(const std::string& str, chaotic::convert::To); std::chrono::milliseconds Convert(std::string_view str, chaotic::convert::To); diff --git a/chaotic/integration_tests/schemas/custom_cpp_type.yaml b/chaotic/integration_tests/schemas/custom_cpp_type.yaml index e8545b6498e4..5cf6f5fe34f5 100644 --- a/chaotic/integration_tests/schemas/custom_cpp_type.yaml +++ b/chaotic/integration_tests/schemas/custom_cpp_type.yaml @@ -28,6 +28,9 @@ definitions: integer: type: integer x-usrv-cpp-type: std::chrono::milliseconds + ms: + type: string + x-usrv-cpp-type: std::chrono::milliseconds sizet: type: integer minimum: 0 diff --git a/chaotic/integration_tests/tests/render/custom.cpp b/chaotic/integration_tests/tests/render/custom.cpp index bb7b8fd71dad..f55c8021c187 100644 --- a/chaotic/integration_tests/tests/render/custom.cpp +++ b/chaotic/integration_tests/tests/render/custom.cpp @@ -22,6 +22,18 @@ TEST(Custom, Int) { EXPECT_EQ(custom2, custom); } +TEST(Custom, Ms) { + auto json = formats::json::MakeObject("ms", "12ms"); + auto custom = json.As(); + EXPECT_EQ(custom.ms, std::chrono::milliseconds(12)); + + auto json_back = formats::json::ValueBuilder{custom}.ExtractValue(); + EXPECT_EQ(json_back, json); + + const auto custom2 = FromJsonString(ToString(json), formats::parse::To{}); + EXPECT_EQ(custom2, custom); +} + TEST(Custom, String) { auto json = formats::json::MakeObject("string", "make love"); auto custom = json.As(); diff --git a/chaotic/src/chaotic/io/std/chrono/milliseconds.cpp b/chaotic/src/chaotic/io/std/chrono/milliseconds.cpp index c632f546619b..1b05f5618fe7 100644 --- a/chaotic/src/chaotic/io/std/chrono/milliseconds.cpp +++ b/chaotic/src/chaotic/io/std/chrono/milliseconds.cpp @@ -2,10 +2,16 @@ #include +#include + USERVER_NAMESPACE_BEGIN namespace chaotic::convert { +std::string Convert(const std::chrono::milliseconds& value, chaotic::convert::To) { + return fmt::format("{}ms", value.count()); +} + std::chrono::milliseconds Convert(const std::string& str, chaotic::convert::To) { return std::chrono::milliseconds{utils::StringToDuration(str)}; } diff --git a/core/include/userver/engine/async.hpp b/core/include/userver/engine/async.hpp index f336ab3b1df7..cd6f7cbb1840 100644 --- a/core/include/userver/engine/async.hpp +++ b/core/include/userver/engine/async.hpp @@ -8,34 +8,11 @@ #include #include #include -#include USERVER_NAMESPACE_BEGIN namespace engine { -namespace impl { - -template