fix(hands): хвост логов 2000 строк по замеру, образец чистит общий redact

This commit is contained in:
hh committed 2026-09-20 18:30:49 +00:00
1 parent 47df446462
commit 69e427469a
2 files changed
+33 -25

No files matched your search

+15 -11
View File
@@ -289,7 +289,7 @@ def test_the_scope_says_how_much_was_looked_at(tmp_path):
"Область: dell-home, personal-main - прочитано 1 стеков из 2"
)
assert "во флоте 53" in head
assert "хвост 500 строк на стек: строки с 20.09 17:40 по 20.09 17:40" in head
assert "хвост 2000 строк на стек: строки с 20.09 17:40 по 20.09 17:40" in head
assert "самый короткий хвост у beaver-agent - только с 20.09 17:40" in head
@@ -448,18 +448,22 @@ def test_a_first_pass_into_a_dead_komodo_does_not_burn_the_baseline(tmp_path):
assert later.cold and later.new == ()
def test_a_secret_in_the_line_does_not_ride_into_the_chat():
def test_a_named_secret_in_the_line_does_not_ride_into_the_chat():
scan = read_stack(
"gitea",
log(
line(
"svc",
"2026-09-20T17:40:00.0",
"ERROR auth failed token=ghp_ZZ123 for kJ8sdfLKJ23kjhsdf98234hkjsdf7823x",
)
),
log(line("svc", "2026-09-20T17:40:00.0", "ERROR auth failed token=ghp_ZZ123")),
)
(hit,) = scan.hits
assert "ghp_ZZ123" not in hit.sample
assert "kJ8sdfLKJ23kjhsdf98234hkjsdf7823x" not in hit.sample
assert hit.sample.startswith("ERROR auth failed")
assert hit.sample.startswith("ERROR auth failed token=")
def test_a_bare_blob_stays_readable():
# Размен с открытыми глазами: id задач, сессий и коммитов - это сигнал,
# и замазывать их ради редкого безымянного ключа дороже, чем оставить.
scan = read_stack(
"komodo",
log(line("svc", "2026-09-20T17:40:00.0", "ERROR task kJ8sdfLKJ23kjhsdf98234x")),
)
(hit,) = scan.hits
assert "kJ8sdfLKJ23kjhsdf98234x" in hit.sample