惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
L
LangChain Blog
B
Blog
博客园 - 三生石上(FineUI控件)
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
P
Proofpoint News Feed
U
Unit 42
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
小众软件
小众软件
I
InfoQ
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
C
Check Point Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(test): reject kova help value bypasses · openclaw/ope...
vincentkoc · 2026-06-22 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -3,8 +3,9 @@

33

import { readFile, writeFile } from "node:fs/promises";

44

import path from "node:path";

55
6+

const knownArgKeys = new Set(["report", "output", "lane", "reporturl", "artifacturl"]);

67

const rawArgs = process.argv.slice(2);

7-

if (rawArgs.includes("--help") || rawArgs.includes("-h")) {

8+

if (shouldPrintHelp(rawArgs)) {

89

usage("", 0);

910

}

1011

@@ -245,18 +246,17 @@ function value(input) {

245246
246247

function parseArgs(argv) {

247248

const parsed = {};

248-

const knownKeys = new Set(["report", "output", "lane", "reporturl", "artifacturl"]);

249249

for (let index = 0; index < argv.length; index += 1) {

250250

const arg = argv[index];

251251

if (!arg.startsWith("--")) {

252252

usage(`unexpected argument: ${arg}`);

253253

}

254254

const key = arg.slice(2).replaceAll("-", "");

255-

if (!knownKeys.has(key)) {

255+

if (!knownArgKeys.has(key)) {

256256

usage(`unknown argument: ${arg}`);

257257

}

258258

const valueLocal = argv[index + 1];

259-

if (!valueLocal || valueLocal.startsWith("--")) {

259+

if (!valueLocal || valueLocal.startsWith("-")) {

260260

usage(`${arg} requires a value`);

261261

}

262262

parsed[key] = valueLocal;

@@ -271,6 +271,28 @@ function parseArgs(argv) {

271271

};

272272

}

273273
274+

function shouldPrintHelp(argv) {

275+

for (let index = 0; index < argv.length; index += 1) {

276+

const arg = argv[index];

277+

if (arg === "--help" || arg === "-h") {

278+

return true;

279+

}

280+

if (!arg.startsWith("--")) {

281+

return false;

282+

}

283+

const key = arg.slice(2).replaceAll("-", "");

284+

if (!knownArgKeys.has(key)) {

285+

return false;

286+

}

287+

const optionValue = argv[index + 1];

288+

if (!optionValue || optionValue.startsWith("-")) {

289+

return false;

290+

}

291+

index += 1;

292+

}

293+

return false;

294+

}

295+
274296

function usage(message, status = 2) {

275297

const text =

276298

"usage: node scripts/kova-ci-summary.mjs --report <report.json> [--output <summary.md>] [--lane <name>] [--report-url <url>] [--artifact-url <url>]\n";

Original file line numberDiff line numberDiff line change

@@ -38,6 +38,20 @@ describe("scripts/kova-ci-summary", () => {

3838

expect(result.stdout).toContain("usage: node scripts/kova-ci-summary.mjs --report");

3939

});

4040
41+

it.each([

42+

["flag-shaped value", ["--report", "-h"]],

43+

["option separator before help", ["--report", "--", "--help"]],

44+

])("rejects %s before help handling", (_name, args) => {

45+

const result = spawnSync(process.execPath, ["scripts/kova-ci-summary.mjs", ...args], {

46+

cwd: process.cwd(),

47+

encoding: "utf8",

48+

});

49+
50+

expect(result.status).toBe(2);

51+

expect(result.stdout).toBe("");

52+

expect(result.stderr).toContain("error: --report requires a value");

53+

});

54+
4155

it("rejects empty Kova reports instead of rendering unknown summaries", () => {

4256

const empty = runSummary({});

4357

expect(empty.result.status).toBe(1);