lab5: закрытие второго ревью

Validate the PNG raster itself: exact Adam7/non-interlaced row layout, scanline filter bytes, palette/PLTE rules, bounded streaming without keeping the raster. Settle an attachment as failed when a newer pipeline fails before any version was published, while keeping a ready serving version intact. Reject unsupported pipeline versions in jobctl before changing state.
This commit is contained in:
Vladislav Kunetskiy
2026-10-31 01:06:43 +03:00
parent b965350cc9
commit 8c0a455aa5
14 changed files with 478 additions and 112 deletions
+5 -2
View File
@@ -1,9 +1,12 @@
# async 2026-10-30T21:41:04Z
# make test-queue 2026-10-30T22:06:09Z
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 python3 student-tests/lab5_async.py --base-url "http://localhost:8080"
worker down: 202 queued, content 409, queued attachment linked, API restarted
worker restarted: ready, thumbnail and original downloadable, staging cleared
broker down: upload accepted into outbox
broker + relay recovered: queued job reached ready
stack restart: ready attachment and original preserved
worker down: reprocess pipel 2 accepted, upload still queued
worker down: reprocess pipeline 2 accepted, upload still queued
worker up: reprocessed upload reached ready at pipeline 2, v1 superseded
worker down: reprocess pipeline 3 refused, v1 job untouched
worker up: preserved upload reached ready at pipeline 1
PASS: lab5 async worker/broker durability
+4 -1
View File
@@ -1,9 +1,12 @@
# attachments-negative 2026-10-30T21:41:23Z
# make test-attachments 2026-10-30T22:06:08Z
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 python3 student-tests/attachments_negative.py --base-url "http://localhost:8080"
10 MiB + 1 body: 413
empty body: 415
corrupt PNG (IDAT CRC): 415
MIME spoof (PNG declared as JPEG): 415
structurally valid PNG with non-zlib IDAT: 415
valid zlib, empty PNG raster: 415
valid zlib, invalid PNG scanline filter: 415
dangerous filenames: 400
foreign attachment metadata/content: 404
empty text without attachments: 400
+2 -2
View File
@@ -1,2 +1,2 @@
ok mtusi-messenger/internal/storage/postgres 9.969s
ok mtusi-messenger/internal/storage/redis 1.214s
ok mtusi-messenger/internal/storage/postgres 8.719s
ok mtusi-messenger/internal/storage/redis 1.153s
+11 -11
View File
@@ -3,18 +3,18 @@ level=info msg="golangci-lint has version 2.13.2 built with go1.27.1 from (unkno
level=info msg="[config_reader] Config search paths: [./ /Users/vladislav/Projects/mtusi2026lab5 /Users/vladislav/Projects /Users/vladislav /Users /]"
level=info msg="[config_reader] Used config file .golangci.yml"
level=info msg="[config_reader] Module name \"mtusi-messenger\""
level=info msg="[goenv] Read go env for 5.895333ms: map[string]string{\"GOCACHE\":\"/Users/vladislav/Library/Caches/go-build\", \"GOROOT\":\"/opt/homebrew/Cellar/go/1.27.1/libexec\"}"
level=info msg="[goenv] Read go env for 5.412375ms: map[string]string{\"GOCACHE\":\"/Users/vladislav/Library/Caches/go-build\", \"GOROOT\":\"/opt/homebrew/Cellar/go/1.27.1/libexec\"}"
level=info msg="[lintersdb] Active 50 linters: [asasalint bodyclose canonicalheader containedctx contextcheck copyloopvar depguard durationcheck errcheck errname errorlint exhaustive exptostd fatcontext forbidigo forcetypeassert gocheckcompilerdirectives gocritic gofumpt goimports gomoddirectives gosec govet ineffassign intrange makezero misspell musttag nilerr nilnil noctx nolintlint perfsprint prealloc reassign recvcheck revive rowserrcheck sloglint sqlclosecheck staticcheck testifylint thelper tparallel unconvert unparam unused usestdlibvars usetesting wastedassign]"
level=info msg="[loader] Using build tags: [integration]"
level=info msg="[loader] Go packages loading at mode 8767 (deps|exports_file|files|compiled_files|imports|name|types_sizes) took 373.996667ms"
level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 10.67575ms"
level=info msg="[linters_context/goanalysis] analyzers took 22.17725772s with top 10 stages: goimports: 5.594564459s, revive: 3.573092538s, gosec: 1.883430624s, unparam: 1.121477541s, wastedassign: 697.2435ms, gofumpt: 404.984666ms, buildir: 380.350244ms, buildssa: 301.575415ms, gocritic: 286.099209ms, errorlint: 252.740461ms"
level=info msg="[runner/exclusion_rules] Skipped 9 issues by rules: [Path: \"_test\\\\.go\", Linters: \"gosec, prealloc, forcetypeassert, unparam\"]"
level=info msg="[runner] Issues before processing: 882, after processing: 0"
level=info msg="[runner] Processors filtering stat (in/out): filename_unadjuster: 882/882, generated_file_filter: 882/293, exclusion_rules: 293/6, invalid_issue: 882/882, path_relativity: 882/882, path_absoluter: 882/882, cgo: 882/882, exclusion_paths: 882/882, nolint_filter: 6/0"
level=info msg="[runner] processing took 3.132833ms with stages: generated_file_filter: 1.925416ms, nolint_filter: 617.626µs, exclusion_rules: 278.75µs, path_relativity: 272.167µs, invalid_issue: 13.042µs, cgo: 11.75µs, path_absoluter: 6.958µs, filename_unadjuster: 3.667µs, sort_results: 875ns, max_same_issues: 792ns, fixer: 334ns, exclusion_paths: 291ns, source_code: 250ns, diff: 249ns, path_prettifier: 167ns, uniq_by_line: 167ns, max_from_linter: 166ns, path_shortener: 125ns, max_per_file_from_linter: 41ns, severity-rules: 0s"
level=info msg="[runner] linters took 2.843002292s with stages: goanalysis_metalinter: 2.839817416s"
level=info msg="[loader] Go packages loading at mode 8767 (compiled_files|deps|exports_file|files|name|types_sizes|imports) took 201.838125ms"
level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 9.454875ms"
level=info msg="[linters_context/goanalysis] analyzers took 459.537383ms with top 10 stages: revive: 313.452167ms, goimports: 34.1165ms, gosec: 14.898584ms, wastedassign: 14.345375ms, gomoddirectives: 12.584584ms, unparam: 9.832959ms, buildir: 8.875714ms, gocritic: 8.4825ms, buildssa: 3.619034ms, nilness: 2.914125ms"
level=info msg="[runner/exclusion_rules] Skipped 14 issues by rules: [Path: \"_test\\\\.go\", Linters: \"gosec, prealloc, forcetypeassert, unparam\"]"
level=info msg="[runner] Issues before processing: 887, after processing: 0"
level=info msg="[runner] Processors filtering stat (in/out): exclusion_paths: 887/887, generated_file_filter: 887/298, exclusion_rules: 298/6, nolint_filter: 6/0, invalid_issue: 887/887, path_absoluter: 887/887, filename_unadjuster: 887/887, path_relativity: 887/887, cgo: 887/887"
level=info msg="[runner] processing took 3.208459ms with stages: generated_file_filter: 2.020333ms, nolint_filter: 610.416µs, path_relativity: 272.751µs, exclusion_rules: 265.791µs, invalid_issue: 14.541µs, cgo: 13.167µs, path_absoluter: 4.667µs, filename_unadjuster: 4.25µs, sort_results: 708ns, max_same_issues: 500ns, fixer: 292ns, path_prettifier: 209ns, exclusion_paths: 209ns, source_code: 167ns, diff: 125ns, path_shortener: 84ns, uniq_by_line: 83ns, max_per_file_from_linter: 83ns, severity-rules: 42ns, max_from_linter: 41ns"
level=info msg="[runner] linters took 848.949083ms with stages: goanalysis_metalinter: 845.707708ms"
0 issues.
level=info msg="File cache stats: 0 entries of total size 0B"
level=info msg="Memory: 34 samples, avg is 394.2MB, max is 716.6MB"
level=info msg="Execution took 3.234388375s"
level=info msg="Memory: 12 samples, avg is 104.3MB, max is 151.3MB"
level=info msg="Execution took 1.066180875s"
+1 -1
View File
@@ -1,3 +1,3 @@
# make test 2026-10-30T21:41:33Z
# make test 2026-10-30T22:06:01Z
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 python3 tests/smoke.py --base-url "http://localhost:8080"
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
+17 -17
View File
@@ -6,35 +6,35 @@ env -u APP_ENV -u SERVER_HOST -u SERVER_PORT -u SERVER_READ_HEADER_TIMEOUT -u SE
? mtusi-messenger/cmd/s3init [no test files]
? mtusi-messenger/cmd/worker [no test files]
? mtusi-messenger/internal/broker [no test files]
ok mtusi-messenger/internal/config 1.948s
ok mtusi-messenger/internal/domain 1.309s
ok mtusi-messenger/internal/config 1.789s
ok mtusi-messenger/internal/domain 1.219s
? mtusi-messenger/internal/failpoint [no test files]
ok mtusi-messenger/internal/health 1.572s
ok mtusi-messenger/internal/imagecheck 2.518s
ok mtusi-messenger/internal/imageproc 3.215s
ok mtusi-messenger/internal/logger 2.222s
ok mtusi-messenger/internal/health 2.129s
ok mtusi-messenger/internal/imagecheck 1.564s
ok mtusi-messenger/internal/imageproc 2.376s
ok mtusi-messenger/internal/logger 2.342s
? mtusi-messenger/internal/outbox [no test files]
ok mtusi-messenger/internal/platform/cache 3.331s
ok mtusi-messenger/internal/platform/cache 2.769s
? mtusi-messenger/internal/platform/cache/mocks [no test files]
ok mtusi-messenger/internal/platform/objectstore 3.854s
ok mtusi-messenger/internal/platform/password 3.647s
ok mtusi-messenger/internal/platform/token 4.137s
ok mtusi-messenger/internal/service/attachment 4.415s
ok mtusi-messenger/internal/platform/objectstore 3.754s
ok mtusi-messenger/internal/platform/password 3.408s
ok mtusi-messenger/internal/platform/token 2.640s
ok mtusi-messenger/internal/service/attachment 3.341s
? mtusi-messenger/internal/service/attachment/mocks [no test files]
ok mtusi-messenger/internal/service/chat 4.715s
ok mtusi-messenger/internal/service/chat 3.958s
? mtusi-messenger/internal/service/chat/mocks [no test files]
ok mtusi-messenger/internal/service/message 5.321s
ok mtusi-messenger/internal/service/message 3.549s
? mtusi-messenger/internal/service/message/mocks [no test files]
ok mtusi-messenger/internal/service/session 5.938s
ok mtusi-messenger/internal/service/session 3.168s
? mtusi-messenger/internal/service/session/mocks [no test files]
ok mtusi-messenger/internal/service/user 5.169s
ok mtusi-messenger/internal/service/user 4.651s
? mtusi-messenger/internal/service/user/mocks [no test files]
ok mtusi-messenger/internal/storage/postgres 5.635s
ok mtusi-messenger/internal/storage/postgres 4.711s
? mtusi-messenger/internal/storage/postgres/internal/sqlcgen [no test files]
? mtusi-messenger/internal/storage/postgres/migrations [no test files]
? mtusi-messenger/internal/storage/redis [no test files]
? mtusi-messenger/internal/storage/redis/mocks [no test files]
ok mtusi-messenger/internal/transport/rest 5.926s
ok mtusi-messenger/internal/transport/rest 4.363s
? mtusi-messenger/internal/transport/rest/internal/oas [no test files]
? mtusi-messenger/internal/transport/rest/mocks [no test files]
? mtusi-messenger/internal/worker [no test files]