浏览代码

td and matrix: add command/tool_version to TD receipts and fix python receipt commit/file write.

Codex Resource Selftest 4 月之前
父节点
当前提交
6ff261ecec
共有 2 个文件被更改,包括 6 次插入 和 2 次删除
  1. 2 0
      tools/prod2u_p4_harness.py
  2. 4 2
      tools/run_verification_matrix.py

+ 2 - 0
tools/prod2u_p4_harness.py

@@ -3150,6 +3150,8 @@ def td_build_payload(
         "status": "pass" if passed else "fail",
         "generated_at": generated_at,
         "run_id": run_id,
+        "command": " ".join([str(TD_EXE)] + [str(script) for script in TD_SCRIPTS.values()]),
+        "tool_version": "6.2.2.198412",
         **source_binding_fields(staged.source_state),
         "source_state": dict(staged.source_state),
         "repository_state_after": state_after,

+ 4 - 2
tools/run_verification_matrix.py

@@ -56,11 +56,11 @@ def run_python_unit(repo: Path, work_root: Path, run_id: str) -> dict[str, Any]:
     )
     status = "pass" if result.returncode == 0 else "fail"
     full_commit = prod2u_p4_harness.current_commit()
-    return {
+    receipt = {
         "schema": "prod2u-p4-normal-v3-python-unit-receipt-v1",
         "status": status,
         "verification_run_id": run_id,
-        "commit": full_commit[:8],
+        "commit": full_commit,
         "commit_full": full_commit,
         "project_config_sha256": prod2u_p4_harness.sha256_file(repo / "projects" / "prod2u-door-temp" / "project.json"),
         "td_source_manifest_sha256": prod2u_p4_harness.sha256_file(repo / "src" / "generated" / "td-source-manifest.json"),
@@ -73,6 +73,8 @@ def run_python_unit(repo: Path, work_root: Path, run_id: str) -> dict[str, Any]:
         "authoritative": status == "pass",
         "placeholder": False,
     }
+    receipt_path.write_text(json.dumps(receipt, indent=2, sort_keys=True) + "\n", encoding="utf-8")
+    return receipt
 
 
 def _run_harness_lane(repo: Path, work_root: Path, run_id: str, lane: str) -> dict[str, Any]: