From 20badebd201c88b895439997d824a3dc2581d81f Mon Sep 17 00:00:00 2001 From: antoshkka Date: Thu, 7 Nov 2024 14:15:07 +0300 Subject: [PATCH] feat docs: minor tweaks and updates for changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests: протестировано CI commit_hash:6b5ba8e4e0d2489999d8b03b06f76331ac04e55f --- samples/chaotic_service/CMakeLists.txt | 1 + samples/chaotic_service/schemas/hello.yaml | 1 + samples/chaotic_service/schemas/types.yaml | 1 + scripts/docs/en/userver/chaotic.md | 30 ++++++++++--------- .../docs/en/userver/roadmap_and_changelog.md | 6 +++- .../en/userver/tutorial/production_service.md | 23 +++++++------- 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/samples/chaotic_service/CMakeLists.txt b/samples/chaotic_service/CMakeLists.txt index c7d68d9f2662..d9cb7c59e7b8 100644 --- a/samples/chaotic_service/CMakeLists.txt +++ b/samples/chaotic_service/CMakeLists.txt @@ -19,6 +19,7 @@ target_include_directories(${PROJECT_NAME}_objs PUBLIC src) # /// [objects] # /// [chaotic] +# cmake file(GLOB_RECURSE SCHEMAS ${CMAKE_CURRENT_SOURCE_DIR}/schemas/*.yaml) userver_target_generate_chaotic(${PROJECT_NAME}-chgen ARGS diff --git a/samples/chaotic_service/schemas/hello.yaml b/samples/chaotic_service/schemas/hello.yaml index 65a74a0f4a2e..1665bdba2b6e 100644 --- a/samples/chaotic_service/schemas/hello.yaml +++ b/samples/chaotic_service/schemas/hello.yaml @@ -1,3 +1,4 @@ +# yaml components: schemas: HelloRequestBody: diff --git a/samples/chaotic_service/schemas/types.yaml b/samples/chaotic_service/schemas/types.yaml index 863a7a44f489..4c7dfb3fb08c 100644 --- a/samples/chaotic_service/schemas/types.yaml +++ b/samples/chaotic_service/schemas/types.yaml @@ -1,3 +1,4 @@ +# yaml components: schemas: DateTime: diff --git a/scripts/docs/en/userver/chaotic.md b/scripts/docs/en/userver/chaotic.md index 74718bc4a073..281de94a34e2 100644 --- a/scripts/docs/en/userver/chaotic.md +++ b/scripts/docs/en/userver/chaotic.md @@ -135,13 +135,13 @@ Number supports the following validators: String type is mapped to different C++ types: -| format | C++ type | -|-----------------------|------------------------------| -| - | `std::string` | -| `uuid` | `boost::uuids::uuid` | -| `date` | `utils::datetime::Date` | -| `date-time` | `utils::TimePointTz` | -| `date-time-iso-basic` | `utils::TimePointTzIsoBasic` | +| format | C++ type | +|-----------------------|----------------------------------------| +| - | `std::string` | +| `uuid` | `boost::uuids::uuid` | +| `date` | `utils::datetime::Date` | +| `date-time` | `utils::datetime::TimePointTz` | +| `date-time-iso-basic` | `utils::datetime::TimePointTzIsoBasic` | String supports the following validators: * `minLength` @@ -172,16 +172,17 @@ Required fields of C++ type `T` produce C++ fields with the same type `T`. Non-required fields of C++ type `T` produce C++ fields with type `std::optional`. E.g. the following JSONSchema: -```yaml +``` +yaml type: object additionalProperties: false properties: - foo: - type: integer - bar: - type: string + foo: + type: integer + bar: + type: string required: -- foo + - foo ``` produces the following C++ structure: @@ -247,7 +248,8 @@ but it can be never `nullptr`. Example: -```yaml +``` +yaml TreeNode: type: object additionalProperties: false diff --git a/scripts/docs/en/userver/roadmap_and_changelog.md b/scripts/docs/en/userver/roadmap_and_changelog.md index 4152ab5f0954..6a83839562c1 100644 --- a/scripts/docs/en/userver/roadmap_and_changelog.md +++ b/scripts/docs/en/userver/roadmap_and_changelog.md @@ -37,6 +37,9 @@ Changelog news also go to the * Added S3 API client s3api::Client. More docs to come soon. Many thanks to [v-for-vandal](https://github.com/v-for-vandal) for the work! +* Added gRPC reflection library. More docs to come soon. Many thanks to + [v-for-vandal](https://github.com/v-for-vandal) for the work! +* @ref scripts/docs/en/userver/congestion_control.md "Congestion Control" turned on by default. * Initial work towards embedding GDB pretty-printers to userver binaries. * Mongo now has the full functionality for diagnostics out-of-the box, without mongo-c library patches. * Simplified contributing by removing the annoying bot that checks for explicit agreement to CLA. Creating an issue or @@ -62,7 +65,8 @@ Optimizations: * Build: * Added `userver_module()` CMake function to simplify configuration of new drivers that are being added to userver. - * Added missing `fmt/ranges.h` includes. Thanks to [Vasilii Kuziakin](https://github.com/Basiliuss) for the PR! + * Added missing `fmt/ranges.h` includes. Thanks to [Vasilii Kuziakin](https://github.com/Basiliuss) and to + [SidorovichPavel](https://github.com/SidorovichPavel) for the PRs! * Proper use of `PROTOBUF_PROTOC` in CMake. Thanks to [Nikita](https://github.com/rtkid-nik) for the PR! * Added support for builds in paths that contain whitespaces and other special symbols. * Added CI build tests for Ubuntu 24.04 and MacOS. diff --git a/scripts/docs/en/userver/tutorial/production_service.md b/scripts/docs/en/userver/tutorial/production_service.md index 153c5d9bde75..e30340b062c3 100644 --- a/scripts/docs/en/userver/tutorial/production_service.md +++ b/scripts/docs/en/userver/tutorial/production_service.md @@ -112,7 +112,8 @@ that would stop sending traffic to the server if it responds with codes other th @snippet samples/production_service/static_config.yaml Production service sample - static config ping -Note that the ping handler lives on the task processor of all the other handlers. Smart balancers may measure response times and send less traffic to the heavy loaded services. +Note that the ping handler lives on the task processor of all the other handlers. Smart balancers may measure response +times and send less traffic to the heavy loaded services. ``` bash @@ -129,16 +130,16 @@ Content-Length: 0 ``` -### Dynamic configs +### Dynamic configs of a sample production service Here's a configuration of a dynamic config related components components::DynamicConfigClient, components::DynamicConfig, components::DynamicConfigClientUpdater. -Service starts with some dynamic config values from `dynamic-config.fs-cache-path` -file and updates dynamic values from a +Service starts with some dynamic config values from defaults and updates dynamic values from a @ref scripts/docs/en/userver/tutorial/config_service.md "configs service" -at startup. +at startup. If the first update fails, the values are retrieved from `dynamic-config.fs-cache-path` +file (if it exists). @snippet samples/production_service/static_config.yaml Production service sample - static config dynamic configs @@ -154,13 +155,15 @@ at startup. See @ref scripts/docs/en/userver/congestion_control.md. -congestion_control::Component limits the active requests count. In case of overload it responds with HTTP 429 codes to some requests, allowing your service to properly process handle the rest. +congestion_control::Component limits the active requests count. In case of overload it responds with HTTP 429 codes to +some requests, allowing your service to properly process handle the rest. -All the significant parts of the component are configured by dynamic config options @ref USERVER_RPS_CCONTROL and @ref USERVER_RPS_CCONTROL_ENABLED +All the significant parts of the component are configured by dynamic config options @ref USERVER_RPS_CCONTROL and +@ref USERVER_RPS_CCONTROL_ENABLED. @snippet samples/production_service/static_config.yaml Production service sample - static config congestion-control -It is a good idea to disable it in unit tests to avoid getting HTTP 429 on an overloaded CI server. +It is a good idea to disable it in unit tests to avoid getting `HTTP 429` on an overloaded CI server. @anchor tutorial_metrics @@ -221,10 +224,6 @@ data. This component is required by many high-level components and it is safe to use this component in production environments. -## Dynamic config - -Dynamic configs are described in details at @ref scripts/docs/en/schemas/dynamic_configs.md . - ### Build This sample requires @ref scripts/docs/en/userver/tutorial/config_service.md "configs service", so we build and start one from our previous tutorials.