Skip to content

Commit 2e9d176

Browse files
authored
Sync main with rightlib (#18558)
1 parent 9ffb002 commit 2e9d176

File tree

8 files changed

+20
-116
lines changed

8 files changed

+20
-116
lines changed

contrib/libs/curl/ya.make

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,9 @@ PEERDIR(
2828
contrib/libs/zstd
2929
)
3030

31-
IF (NOT EXPORT_CMAKE)
32-
ADDINCL(
33-
contrib/libs/c-ares/include
34-
)
35-
ENDIF()
36-
3731
ADDINCL(
3832
GLOBAL contrib/libs/curl/include
33+
contrib/libs/c-ares/include
3934
contrib/libs/curl/lib
4035
contrib/libs/libssh2/include
4136
contrib/libs/ngtcp2/crypto/includes
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
file(GLOB filter_files ${CMAKE_CURRENT_SOURCE_DIR}/*.txt)
2+
foreach(filter_file ${filter_files})
3+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filter_file})
4+
endforeach()
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
file(GLOB filter_files ${CMAKE_CURRENT_SOURCE_DIR}/*.txt)
2+
foreach(filter_file ${filter_files})
3+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filter_file})
4+
endforeach()

contrib/tools/cython/.yandex_meta/override.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
pkgs: attrs: with pkgs; with pkgs.python311.pkgs; with attrs; rec {
2-
version = "0.29.36";
2+
version = "0.29.37";
33

44
src = fetchPypi {
55
pname = "Cython";
66
inherit version;
7-
hash = "sha256-QcDP0tdU44PJ7rle/8mqSrhH0Ml0cHfd18Dctow7wB8=";
7+
hash = "sha256-+BPUpt2Ure5dT/JmGR0dlb9tQWSk+sxTVCLAIbJQTPs=";
88
};
99

1010
patches = [];

library/cpp/bucket_quoter/bucket_quoter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ class TBucketQuoter {
172172

173173
i64 UseAndFill(ui64 tokens) {
174174
TGuard<Lock> g(BucketMutex);
175-
FillBucket();
176175
UseNoLock(tokens);
176+
FillBucket();
177177
return Bucket;
178178
}
179179

library/cpp/lwtrace/mon/mon_lwtrace.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ struct TLogQuery {
301301
}
302302
} catch (...) {
303303
ythrow yexception()
304-
<< EncodeHtmlPcdata(CurrentExceptionMessage())
304+
<< CurrentExceptionMessage()
305305
<< " while parsing track log query: "
306306
<< Text;
307307
}
@@ -1853,7 +1853,7 @@ class TTracesHtmlPrinter {
18531853
try {
18541854
Os << src->GetStartTime().ToStringUpToSeconds();
18551855
} catch (...) {
1856-
Os << "error: " << EncodeHtmlPcdata(CurrentExceptionMessage());
1856+
Os << "error: " << CurrentExceptionMessage();
18571857
}
18581858
Os << "</td>"
18591859
<< "<td><div class=\"dropdown\">"
@@ -3827,11 +3827,11 @@ class TLWTraceMonPage : public NMonitoring::IMonPage {
38273827
if (request.GetParams().Get("error") == "text") {
38283828
// Text error reply is helpful for ajax requests
38293829
out << NMonitoring::HTTPOKTEXT;
3830-
out << EncodeHtmlPcdata(CurrentExceptionMessage());
3830+
out << CurrentExceptionMessage();
38313831
} else {
38323832
WWW_HTML(out) {
38333833
out << "<h2>Error</h2><pre>"
3834-
<< EncodeHtmlPcdata(CurrentExceptionMessage())
3834+
<< CurrentExceptionMessage()
38353835
<< Endl;
38363836
}
38373837
}

library/cpp/monlib/encode/prometheus/prometheus_encoder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@ namespace NMonitoring {
109109
Y_ENSURE(!name.empty(), "trying to write metric with empty name");
110110

111111
char ch = name[0];
112-
if (!NPrometheus::IsValidMetricNameStart(ch)) {
112+
if (NPrometheus::IsValidMetricNameStart(ch)) {
113+
Out_->Write(ch);
114+
} else {
113115
Out_->Write('_');
114116
}
115117

116-
for (size_t i = 0, len = name.length(); i < len; i++) {
118+
for (size_t i = 1, len = name.length(); i < len; i++) {
117119
ch = name[i];
118120
if (NPrometheus::IsValidMetricNameContinuation(ch)) {
119121
Out_->Write(ch);

library/cpp/monlib/encode/prometheus/prometheus_encoder_ut.cpp

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -411,105 +411,4 @@ two{labels="l2", project="solomon", } 42 1500000000000
411411
412412
)");
413413
}
414-
415-
Y_UNIT_TEST(FirstCharacterShouldNotBeReplaced) {
416-
auto result = EncodeToString([](IMetricEncoder* e) {
417-
e->OnStreamBegin();
418-
const TVector<std::pair<TString, double>> sensors = {
419-
{"0", 0.0},
420-
{"50", 50.0},
421-
{"90", 90.0},
422-
{"99", 99.0},
423-
{"100", 100},
424-
{"012345", 123.45},
425-
{"abc0123", 123.0},
426-
{"0123abc", 123.0},
427-
};
428-
429-
for (const auto& [name, value]: sensors) {
430-
e->OnMetricBegin(EMetricType::COUNTER);
431-
{
432-
e->OnLabelsBegin();
433-
e->OnLabel("sensor", name);
434-
e->OnLabelsEnd();
435-
}
436-
e->OnDouble(TInstant::Zero(), value);
437-
e->OnMetricEnd();
438-
}
439-
e->OnStreamEnd();
440-
});
441-
442-
UNIT_ASSERT_STRINGS_EQUAL(result,
443-
R"(# TYPE _0 counter
444-
_0 0
445-
# TYPE _50 counter
446-
_50 50
447-
# TYPE _90 counter
448-
_90 90
449-
# TYPE _99 counter
450-
_99 99
451-
# TYPE _100 counter
452-
_100 100
453-
# TYPE _012345 counter
454-
_012345 123.45
455-
# TYPE abc0123 counter
456-
abc0123 123
457-
# TYPE _0123abc counter
458-
_0123abc 123
459-
460-
)");
461-
}
462-
463-
Y_UNIT_TEST(InvalidCharactersShouldBeReplaced) {
464-
auto result = EncodeToString([](IMetricEncoder* e) {
465-
e->OnStreamBegin();
466-
const TVector<std::pair<TString, double>> sensors = {
467-
{"abc/def", 1.0},
468-
{"a+-*/=&{}()|bc", 0.1},
469-
{"0.0", 0.0},
470-
{"99.9", 99.9}};
471-
472-
for (const auto& [name, value]: sensors) {
473-
e->OnMetricBegin(EMetricType::COUNTER);
474-
{
475-
e->OnLabelsBegin();
476-
e->OnLabel("sensor", name);
477-
e->OnLabelsEnd();
478-
}
479-
e->OnDouble(TInstant::Zero(), value);
480-
e->OnMetricEnd();
481-
}
482-
e->OnStreamEnd();
483-
});
484-
485-
UNIT_ASSERT_STRINGS_EQUAL(result,
486-
R"(# TYPE abc_def counter
487-
abc_def 1
488-
# TYPE a___________bc counter
489-
a___________bc 0.1
490-
# TYPE _0_0 counter
491-
_0_0 0
492-
# TYPE _99_9 counter
493-
_99_9 99.9
494-
495-
)");
496-
}
497-
498-
Y_UNIT_TEST(ShouldNotFailOnMetricWithoutSensorLabel) {
499-
auto result = EncodeToString([](IMetricEncoder* e) {
500-
e->OnStreamBegin();
501-
e->OnStreamEnd();
502-
{
503-
e->OnMetricBegin(EMetricType::GAUGE);
504-
{
505-
e->OnLabelsBegin();
506-
e->OnLabel("name", "cpuUsage");
507-
e->OnLabelsEnd();
508-
}
509-
e->OnInt64(TInstant::Zero(), 0);
510-
e->OnMetricEnd();
511-
}
512-
});
513-
UNIT_ASSERT_STRINGS_EQUAL(result, "\n");
514-
}
515414
}

0 commit comments

Comments
 (0)