fix(qa): require Telegram proof report before publish · openclaw/openclaw@720e295
vincentkoc
·
2026-06-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1997,13 +1997,18 @@ const FULL_ARTIFACT_JSON_NAMES = new Set([
|
1997 | 1997 | "telegram-user-crabbox-session-summary.json", |
1998 | 1998 | ]); |
1999 | 1999 | const FULL_ARTIFACT_FILE_EXTENSIONS = new Set([".gif", ".log", ".md", ".mp4", ".png"]); |
| 2000 | +const FULL_ARTIFACT_PROOF_REPORT = "telegram-user-crabbox-proof.md"; |
2000 | 2001 | const TIMESTAMPED_PROBE_ARTIFACT_JSON = /^probe-\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-\d{3}Z\.json$/u; |
2001 | 2002 | |
2002 | 2003 | function isFullArtifactJsonName(name: string) { |
2003 | 2004 | return FULL_ARTIFACT_JSON_NAMES.has(name) || TIMESTAMPED_PROBE_ARTIFACT_JSON.test(name); |
2004 | 2005 | } |
2005 | 2006 | |
2006 | 2007 | export function stageFullSessionArtifacts(outputDir: string) { |
| 2008 | +if (!fs.existsSync(path.join(outputDir, FULL_ARTIFACT_PROOF_REPORT))) { |
| 2009 | +throw new Error(`Missing proof report. Run finish first: ${FULL_ARTIFACT_PROOF_REPORT}`); |
| 2010 | +} |
| 2011 | + |
2007 | 2012 | const publishDir = path.join(outputDir, "publish-full-artifacts"); |
2008 | 2013 | fs.rmSync(publishDir, { force: true, recursive: true }); |
2009 | 2014 | fs.mkdirSync(publishDir, { recursive: true }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -291,6 +291,21 @@ describe("telegram user Crabbox proof log polling", () => {
|
291 | 291 | expect(fs.existsSync(path.join(stagedDir, "stale.txt"))).toBe(false); |
292 | 292 | }); |
293 | 293 | |
| 294 | +it("requires finish to write the proof report before full artifact publishing", () => { |
| 295 | +const outputDir = makeTempDir(); |
| 296 | +fs.writeFileSync( |
| 297 | +path.join(outputDir, "session.json"), |
| 298 | +'{"sshKey":"/private/tmp/openclaw/key"}', |
| 299 | +); |
| 300 | +fs.writeFileSync(path.join(outputDir, "status.json"), '{"ok":true}'); |
| 301 | +fs.writeFileSync(path.join(outputDir, "telegram-desktop.log"), "log"); |
| 302 | + |
| 303 | +expect(() => stageFullSessionArtifacts(outputDir)).toThrow( |
| 304 | +"Missing proof report. Run finish first: telegram-user-crabbox-proof.md", |
| 305 | +); |
| 306 | +expect(fs.existsSync(path.join(outputDir, "publish-full-artifacts"))).toBe(false); |
| 307 | +}); |
| 308 | + |
294 | 309 | posixIt("does not expand generated remote probe arguments in the shell", () => { |
295 | 310 | const root = makeTempDir(); |
296 | 311 | const fakePython = path.join(root, "python3"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。