From 24a51744f521aa585e50a931d0a0219d2e960197 Mon Sep 17 00:00:00 2001 From: Artyom Date: Fri, 6 Nov 2026 09:16:57 +0300 Subject: [PATCH] Record source revisions and stopped containers in pipeline evidence --- openspec/changes/verify-lab5-grade3-sqlalchemy/tasks.md | 2 +- scripts/pipeline_evidence.py | 5 +++++ scripts/pipeline_suite.py | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/openspec/changes/verify-lab5-grade3-sqlalchemy/tasks.md b/openspec/changes/verify-lab5-grade3-sqlalchemy/tasks.md index 294cafc0..5a59aec2 100644 --- a/openspec/changes/verify-lab5-grade3-sqlalchemy/tasks.md +++ b/openspec/changes/verify-lab5-grade3-sqlalchemy/tasks.md @@ -1,6 +1,6 @@ ## 1. Квалификация уровня 3 -- [ ] 1.1 Добавить SHA и фактическое состояние контейнеров в результаты suite. +- [x] 1.1 Добавить SHA и фактическое состояние контейнеров в результаты suite. - [ ] 1.2 Выполнить make check/validate/lint/student-test и собрать стенд. - [ ] 1.3 Выполнить smoke, persistence, failover и restore с реальными выводами. - [ ] 1.4 Выполнить level3 suite и проверки унаследованного минимума lab4. diff --git a/scripts/pipeline_evidence.py b/scripts/pipeline_evidence.py index 5ed7b9c3..edff2ce4 100644 --- a/scripts/pipeline_evidence.py +++ b/scripts/pipeline_evidence.py @@ -53,6 +53,11 @@ def stop(service): check=True, ).stdout.strip() say(f"$ docker compose stop -t 10 {service} -> {seconds:.1f} s, exit code {code}") + say( + compose( + "ps", "-a", "--format", "{{.Name}} {{.ID}} {{.State}} {{.Status}}", service + ).rstrip() + ) check(seconds <= 10 and code == "0", f"{service} did not stop cleanly on SIGTERM") diff --git a/scripts/pipeline_suite.py b/scripts/pipeline_suite.py index 1388f7fe..95b43893 100644 --- a/scripts/pipeline_suite.py +++ b/scripts/pipeline_suite.py @@ -424,7 +424,12 @@ class Suite: steps.append({"at": now(), "step": step, **extra}) self.stack.stop(self.args.worker) - mark("worker stopped") + mark( + "worker stopped", + containers=self.stack.dc( + "ps", "-a", "--format", "{{.Name}} {{.ID}} {{.State}} {{.Status}}", self.args.worker + ).splitlines(), + ) att = self.api.fixture() mark("upload 202 queued", attachment_id=att["id"]) self.api.content(att["id"], expected=409) @@ -904,6 +909,7 @@ class Suite: report = { "suite": "lab5-pipeline-idempotency", "started_at": now(), + "source_sha": run(["git", "rev-parse", "HEAD"]).strip(), "config": self.config(), } if self.args.preflight: