Skip to content

feat(cli): 补齐 job ls 服务端筛选参数 / expose server-side job filters - #483

Open
Jinghao-coding wants to merge 2 commits into
raids-lab:mainfrom
Jinghao-coding:codex/issue-477-job-filters
Open

feat(cli): 补齐 job ls 服务端筛选参数 / expose server-side job filters#483
Jinghao-coding wants to merge 2 commits into
raids-lab:mainfrom
Jinghao-coding:codex/issue-477-job-filters

Conversation

@Jinghao-coding

@Jinghao-coding Jinghao-coding commented Jul 25, 2026

Copy link
Copy Markdown
Member

中文

变更内容

  • crater job ls 增加 --search--schedule
  • --status--type 改为可重复或逗号分隔的多值参数,并保持原单值用法兼容。
  • 按后端契约使用重复 query 参数传递 statusjob_typeschedule_type
  • 本地校验 128 字符搜索上限、20 项筛选上限和所有枚举值。
  • 增加逗号感知的静态补全,并同步中英文文案、COMMANDS、Skills 和双语快照。

原因与影响

后端已经支持这些服务端筛选,但 CLI 只能表达单状态、单类型,且无法按搜索词或调度类型筛选。现在脚本可以只请求目标作业,无需抓取全部页面后再筛选;现有单值命令保持兼容。

测试

  • cd cli && make pre-commit-check:unit 与全部快照均通过。
  • cd cli && go vet ./...
  • cd cli && go build
  • API 合约测试覆盖默认分页、重复 query 参数及 schedule 数值映射。
  • 命令测试覆盖枚举校验、Unicode 长度、数量上限、去重和逗号补全。
  • 人工核对中英文 golden diff。

#477 CLI 验证截图

本地联调说明

本机 127.0.0.1:8088 对真实 job ls 请求在 60 秒内未返回,因此中止该请求;本 PR 没有将该环境联调记为成功。参数解析、HTTP 合约和错误输出已由确定性的本地测试覆盖。

Closes #477


English

Changes

  • Add --search and --schedule to crater job ls.
  • Make --status and --type repeatable or comma-separated while preserving single-value usage.
  • Encode status, job_type, and schedule_type as repeated query parameters.
  • Validate the 128-character search limit, 20-value filter limit, and all enum values locally.
  • Add comma-aware static completion and update bilingual text, command docs, Skills, and snapshots.

Why and impact

The backend already supports these server-side filters, but the CLI could only express one status/type and could not filter by search text or schedule type. Scripts can now request only the relevant jobs without fetching every page first, while existing single-value invocations remain compatible.

Validation

  • cd cli && make pre-commit-check: unit tests and every snapshot suite pass.
  • cd cli && go vet ./...
  • cd cli && go build
  • API contract tests cover default pagination, repeated query parameters, and schedule mappings.
  • Command tests cover enum validation, Unicode length, count limits, deduplication, and comma-aware completion.
  • Bilingual golden diffs were reviewed manually.

Issue #477 CLI validation

Local integration note

The local service at 127.0.0.1:8088 did not return a real job ls response within 60 seconds, so the request was aborted and is not reported as a successful integration test. Parameter parsing, HTTP contracts, and error rendering are covered by deterministic local tests.

Closes #477

Copilot AI review requested due to automatic review settings July 25, 2026 17:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Jinghao-coding Jinghao-coding changed the title feat(cli): expose server-side job filters feat(cli): 补齐 job ls 服务端筛选参数 / expose server-side job filters Jul 25, 2026
@Jinghao-coding
Jinghao-coding force-pushed the codex/issue-477-job-filters branch from 09641f7 to 992cea6 Compare July 28, 2026 14:43
@Jinghao-coding
Jinghao-coding force-pushed the codex/issue-477-job-filters branch from 992cea6 to 0664fd1 Compare July 30, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): 补齐 job ls 服务端筛选参数 / expose server-side job filters

2 participants