Skip to content

Commit

Permalink
feat docs: Changelog for v2.7
Browse files Browse the repository at this point in the history
Tests: протестировано CI
commit_hash:78d6a6abc2fe9ad8543582b0038cd6619ad9381e
  • Loading branch information
apolukhin committed Jan 30, 2025
1 parent af6ea1c commit 991c62a
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 31 deletions.
2 changes: 1 addition & 1 deletion core/include/userver/tracing/span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SpanBuilder;
/// @brief Measures the execution time of the current code block, links it with
/// the parent tracing::Spans and stores that info in the log.
///
/// Logging of spans can be controled at runtime via @ref USERVER_NO_LOG_SPANS.
/// Logging of spans can be controlled at runtime via @ref USERVER_NO_LOG_SPANS.
///
/// See @ref scripts/docs/en/userver/logging.md for usage examples and more
/// descriptions.
Expand Down
2 changes: 1 addition & 1 deletion core/include/userver/utils/statistics/labels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LabelView final {
LabelView(Label&& label) = delete;
explicit LabelView(const Label& label);
constexpr LabelView(std::string_view name, std::string_view value) : name_(name), value_(value) {
UINVARIANT(!name_.empty(), "The lable name must not be empty.");
UINVARIANT(!name_.empty(), "The label name must not be empty.");
}

template <class T, std::enable_if_t<std::is_arithmetic_v<T>>* = nullptr>
Expand Down
2 changes: 1 addition & 1 deletion core/src/clients/http/client_crl_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ struct TlsServer {

auto tls_server = engine::io::TlsWrapper::StartTlsServer(
std::move(socket),
crypto::LoadCertficatesChainFromString(kServerCertificate),
crypto::LoadCertificatesChainFromString(kServerCertificate),
crypto::PrivateKey::LoadFromString(kRevokedServerPrivateKey),
deadline,
cas
Expand Down
4 changes: 2 additions & 2 deletions core/src/engine/io/tls_wrapper_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ constexpr auto kDeadlineMaxTime = std::chrono::seconds{60};
[&reading, deadline](auto&& server) {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
deadline
);
Expand Down Expand Up @@ -141,7 +141,7 @@ BENCHMARK(tls_write_all_buffered)->RangeMultiplier(2)->Range(1 << 6, 1 << 12)->U
[&reading, deadline](auto&& server) {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
deadline
);
Expand Down
32 changes: 16 additions & 16 deletions core/src/engine/io/tls_wrapper_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ UTEST(TlsWrapper, InitListSmall) {
[deadline, kDataA, kDataB, kDataC, kDataD](auto&& server) {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert_chain),
crypto::LoadCertificatesChainFromString(cert_chain),
crypto::PrivateKey::LoadFromString(chain_private_key),
deadline
);
Expand Down Expand Up @@ -274,7 +274,7 @@ UTEST(TlsWrapper, InitListLarge) {
[deadline, kDataA, kDataB, kDataC, kDataD](auto&& server) {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
deadline
);
Expand Down Expand Up @@ -310,7 +310,7 @@ UTEST(TlsWrapper, InitListSmallThenLarge) {
[deadline, kDataSmall, kDataLarge](auto&& server) {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
deadline
);
Expand Down Expand Up @@ -342,7 +342,7 @@ UTEST_MT(TlsWrapper, Smoke, 2) {
try {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
test_deadline
);
Expand Down Expand Up @@ -389,7 +389,7 @@ UTEST_MT(TlsWrapper, DocTest, 2) {
[deadline](auto&& server) {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
deadline
);
Expand Down Expand Up @@ -421,7 +421,7 @@ UTEST(TlsWrapper, Move) {
try {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
test_deadline
);
Expand Down Expand Up @@ -471,7 +471,7 @@ UTEST(TlsWrapper, ConnectTimeout) {
EXPECT_THROW(
static_cast<void>(io::TlsWrapper::StartTlsServer(
std::move(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
Deadline::FromDuration(kShortTimeout)
)),
Expand All @@ -490,7 +490,7 @@ UTEST_MT(TlsWrapper, IoTimeout, 2) {
[test_deadline, &timeout_happened](auto&& server) {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
test_deadline
);
Expand Down Expand Up @@ -527,7 +527,7 @@ UTEST(TlsWrapper, Cancel) {
[test_deadline](auto&& server) {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
test_deadline
);
Expand All @@ -554,7 +554,7 @@ UTEST_MT(TlsWrapper, CertKeyMismatch, 2) {
UEXPECT_THROW(
static_cast<void>(io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(other_key),
test_deadline
)),
Expand All @@ -581,7 +581,7 @@ UTEST_MT(TlsWrapper, NonTlsClient, 2) {
UEXPECT_THROW(
static_cast<void>(io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(other_key),
test_deadline
)),
Expand Down Expand Up @@ -622,7 +622,7 @@ UTEST_MT(TlsWrapper, DoubleSmoke, 4) {
[test_deadline](auto&& server) {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
test_deadline
);
Expand All @@ -643,7 +643,7 @@ UTEST_MT(TlsWrapper, DoubleSmoke, 4) {
[test_deadline](auto&& server) {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(other_cert),
crypto::LoadCertificatesChainFromString(other_cert),
crypto::PrivateKey::LoadFromString(other_key),
test_deadline
);
Expand Down Expand Up @@ -696,7 +696,7 @@ UTEST(TlsWrapper, InvalidSocket) {
UEXPECT_THROW(static_cast<void>(io::TlsWrapper::StartTlsClient({}, {}, test_deadline)), io::TlsException);
UEXPECT_THROW(
static_cast<void>(io::TlsWrapper::StartTlsServer(
{}, crypto::LoadCertficatesChainFromString(cert), crypto::PrivateKey::LoadFromString(key), test_deadline
{}, crypto::LoadCertificatesChainFromString(cert), crypto::PrivateKey::LoadFromString(key), test_deadline
)),
io::TlsException
);
Expand All @@ -713,7 +713,7 @@ UTEST(TlsWrapper, PeerShutdown) {
try {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
test_deadline
);
Expand Down Expand Up @@ -755,7 +755,7 @@ UTEST(TlsWrapper, PeerDisconnect) {
try {
auto tls_server = io::TlsWrapper::StartTlsServer(
std::forward<decltype(server)>(server),
crypto::LoadCertficatesChainFromString(cert),
crypto::LoadCertificatesChainFromString(cert),
crypto::PrivateKey::LoadFromString(key),
test_deadline
);
Expand Down
2 changes: 1 addition & 1 deletion core/src/server/net/listener_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ PortConfig Parse(const yaml_config::YamlConfig& value, formats::parse::To<PortCo
}
if (!cert_path.empty()) {
auto contents = fs::blocking::ReadFileContents(cert_path);
config.tls_cert_chain = crypto::LoadCertficatesChainFromString(contents);
config.tls_cert_chain = crypto::LoadCertificatesChainFromString(contents);
config.tls = true;
}
if (!pkey_path.empty()) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/docs/en/userver/build/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ The exact format of setting cmake options varies depending on the method of buil

It is possible to build userver based services with libraries statically linked in.

@warning The support is platform dependant, as a result some libraies on some platforms may linked dynamically. Feel free to provide a PR to support your favourite platform.
@warning The support is platform dependant, as a result some libraries on some platforms may linked dynamically. Feel free to provide a PR to support your favourite platform.

Userver does not build dynamic libraries itself, but most of its dependencies do. CMake (by default) prefers dynamic libraries on Unix-like operating systems.

Expand All @@ -190,7 +190,7 @@ With the option, CMake tries to find all dependencies as static libraries (and d
- To link statically with `libstdc++` or `libc++`, use `CMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -static-libgcc"`.
- To force fully static binary (with statically linked `libc`), use `CMAKE_EXE_LINKER_FLAGS="-static"`. In such case, all dependencies must be provided as static libraries. Also `userver` must be build with `USERVER_DISABLE_PHDR_CACHE=ON` (without this flag, it can lead to endless memory allocation).

Some dependecies usually should be build from source for statically linked executable:
Some dependencies usually should be build from source for statically linked executable:
1. `Curl`. Use `USERVER_FORCE_DOWNLOAD_CURL=ON` to download and build Curl from source.
2. `cctz`, `yaml-cpp`, `fmt` often have no static libraries in their packages, so they should be build from source and installed in your host system (for instance, in `/usr/local`).

Expand Down
59 changes: 54 additions & 5 deletions scripts/docs/en/userver/roadmap_and_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,68 @@ Changelog news also go to the
* ✔️ HTTP 2.0 server support
* ✔️ Improve OpenTelemetry Protocol (OTLP) support.
* ✔️ Improve Kafka driver.
* ✔️ Logging format customization, including JSON logging.
* ✔️ Secdist simplification and functionality improvement.
* ✔️ Improved MacOS build support.
* ✔️ Improved Conan support.
* 👨‍💻 gRPC simplification and functionality improvement.
* 👨‍💻 Logging format customization, including JSON logging.
* 👨‍💻 Secdist simplification and functionality improvement.
* 👨‍💻 Add retry budget or retry circuit breaker for clients.
* Improved MacOS build support.
* Add web interface to the [uservice-dynconf](https://github.com/userver-framework/uservice-dynconf)
* Generate full-blown accessories for OpenAPI:
* 👨‍💻 Generate full-blown accessories for OpenAPI:
* clients
* handlers
* Add web interface to the [uservice-dynconf](https://github.com/userver-framework/uservice-dynconf)


## Changelog

### Release v2.7

* Logging in JSON format was implemented. See static option `format` at components::Logging.
* utils::regex now uses `Re2` under the hood, leading to at least x2 faster regular expression matching and guaranteed
absence of backtracking. Updating is highly recommended.
* Mongo connection state checking algorithms was adjusted to work well on small RPS.
* Conan packages now support all the userver features. Conan package build now reuses the CMake install targets and
CMake config files.
* Full feature support for MacOS, including testing and Conan package build and usage on that platform.
* Added support for TLS certificate chains. See `tls.cert` static option at components::Server. Many thanks to
[aklyuchev](https://github.com/aklyuchev) for the PR!
* Chaotic exceptions now do not depend on JSON. Thanks to [Artyom](https://github.com/Lookingforcommit) for the PR!

* gRPC
* Retries are now supported and controlled via dynamic config. See ugrpc::client::Qos for more info.
* Out-the-box cache dump support for Protobuf messages. See
@ref dump_serialization_guide "Implementing serialization (Write / Read)" for more info.
* Removed deprecated `*Sync` methods.

* Optimizations
* Speed up configuration reads on creating new PostgreSQL connections.
* utils::PeriodicTask now calls RCU Read two times less on each iteration.

* Build
* Fixed build with `USERVER_FEATURE_JEMALLOC=ON`. Many thanks to [Aleksey Ignatiev](https://github.com/ae-ignatiev)
for the PR!
* Service templates [service_template](https://github.com/userver-framework/service_template),
[pg_service_template](https://github.com/userver-framework/pg_service_template),
[pg_grpc_service_template](https://github.com/userver-framework/pg_grpc_service_template),
[mongo_grpc_service_template](https://github.com/userver-framework/mongo_grpc_service_template) now use
@ref service_templates_presets "cmake presets" and @ref devcontainers "devcontainers" for out-of-the-box support
of VSCode and Clion IDEs.
* Started the work on Ubuntu 24.04 images.
* Added `ubuntu-22.04-userver-pg-dev` image with all the tools for development. Planning to switch to Ubuntu-24.04 and
leave only 2 containers: with build dependencies to build userver, and with prebuild userver.
* Added missing fmt11 headers. Thanks to [Pavel Sidorovich](https://github.com/RayeS2070) for the PR!
* Added `USERVER_USE_STATIC_LIBS` to link third-party libraries statically.

* Documentation
* Significant update of the @ref scripts/docs/en/userver/build/build.md
* More docs for tracing::Span::SetLogLevel() and tracing::Span::SetLocalLogLevel()
* Fixed secdist example at components::Mongo. Thank to [Nikita Puteev](https://github.com/Malfak) for the PR!
* Highlight the functionality of formats::common::Item in each supported format.
* Add info about full static linkage. Thanks to [Nikita](https://github.com/root-kidik) for the PR!
* Better `runtests` documentation at @ref scripts/docs/en/userver/functional_testing.md
* Documentation and samples for storages::postgres::io::Codegen{}.


### Release v2.6

* storages::secdist::Secdist is now automatically reloaded for Mongo, Redis and PostgreSQL databases if the secdist file
Expand Down
2 changes: 1 addition & 1 deletion universal/include/userver/crypto/certificate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ using CertificatesChain = std::list<Certificate>;
/// list of 'Certificate's.
///
/// @throw crypto::KeyParseError if failed to load the certificate.
CertificatesChain LoadCertficatesChainFromString(std::string_view chain);
CertificatesChain LoadCertificatesChainFromString(std::string_view chain);

} // namespace crypto

Expand Down
2 changes: 1 addition & 1 deletion universal/src/crypto/certificate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Certificate Certificate::LoadFromString(std::string_view certificate) {
return Certificate{std::move(cert)};
}

CertificatesChain LoadCertficatesChainFromString(std::string_view chain) {
CertificatesChain LoadCertificatesChainFromString(std::string_view chain) {
CertificatesChain certificates;
constexpr std::string_view kBeginMarker = "-----BEGIN CERTIFICATE-----";
constexpr std::string_view kEndMarker = "-----END CERTIFICATE-----";
Expand Down

0 comments on commit 991c62a

Please sign in to comment.