Skip to content

ci: 增加 CI 测试门禁 + 文档变更跳过部署 - #111

Merged
lishuceo merged 3 commits into
mainfrom
ci/add-test-gate-and-paths-ignore
Mar 4, 2026
Merged

ci: 增加 CI 测试门禁 + 文档变更跳过部署#111
lishuceo merged 3 commits into
mainfrom
ci/add-test-gate-and-paths-ignore

Conversation

@lishuceo

@lishuceo lishuceo commented Mar 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • deploy.yml 加 paths-ignore,文档变更不再触发部署重启
  • deploy.yml 新增 test job 作为部署前门禁(typecheck + 单元测试,排除外部 API 依赖的 quality/integration 测试)
  • 新建 ci.yml PR 级别检查(typecheck + lint + 单元测试),在 merge 前拦截问题

Test plan

  • PR 上 ci.yml 触发并通过
  • 合并后 deploy.yml 的 test job 通过后才执行部署
  • 纯文档变更不触发 deploy workflow

🤖 Generated with Claude Code

- deploy.yml: 加 paths-ignore 跳过 docs/md 等纯文档变更
- deploy.yml: 新增 test job (ubuntu-latest) 作为部署前门禁,typecheck + 单元测试
- 新建 ci.yml: PR 级别测试 (typecheck + lint + unit tests)
- 测试排除 quality.test.ts 和 integration.test.ts (外部 API 依赖)
- 新增 docs/ci-improvements.md 改进方案文档

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Mar 4, 2026

Copy link
Copy Markdown

Claude finished @lishuceo's task in 1m 6s —— View job


PR Review: ci: 增加 CI 测试门禁 + 文档变更跳过部署

  • Check for previous review comments
  • Read PR diff and changed files
  • Review .github/workflows/ci.yml
  • Review .github/workflows/deploy.yml
  • Review docs/ci-improvements.md
  • Post review summary

✅ Approved — solid CI improvement

Overall this is a clean, well-structured PR that adds meaningful CI guardrails.

What's good:

  • ci.yml is well-configured: concurrency group per PR with cancel-in-progress, timeout, and appropriate test exclusions (quality.test.ts, integration.test.ts)
  • deploy.yml correctly gates deploy behind test via needs: test
  • paths-ignore sensibly covers docs/**, *.md, and unrelated workflow files — avoids unnecessary deploy restarts
  • Test exclusions are consistent between both workflows

One issue found:

Severity File Issue Confidence
🟡 Warning deploy.yml:15 Missing timeout-minutes on test job (ci.yml has it, deploy.yml doesn't — hung tests could block deploys for 6 hours) 80

Note on docs/ci-improvements.md: The design doc references npm test in code examples while the actual implementation uses npx vitest run --exclude=.... This is fine since the doc is a design exploration, but worth keeping in mind if it's meant to stay as living documentation.


jobs:
test:
runs-on: ubuntu-latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Warning (confidence: 80): Missing timeout-minutes on test job.

ci.yml sets timeout-minutes: 10 on its test job, but this one doesn't. If tests hang (e.g., unresolved promise, infinite loop), the deploy workflow stays blocked for GitHub's default 360-minute timeout, preventing any subsequent deploys.

Suggested change
runs-on: ubuntu-latest
runs-on: ubuntu-latest
timeout-minutes: 10

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Still not fixed. The test job in deploy.yml (line 15) still has no timeout-minutes. ci.yml has timeout-minutes: 10 — this should match.

lishuceo and others added 2 commits March 4, 2026 14:49
Previously in thread mode, only the last turn's text was shown in the
result card. Intermediate turns' text content was accumulated in memory
but never sent to Feishu, causing users to miss detailed conclusions.

Add a continuously-updated text content card between the progress card
(tool calls) and the result card (status). Also fix pre-existing bug
where the normal completion path dropped the last turn's tool calls
from the progress card.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ESLint v10 要求 eslint.config.js (flat config),项目尚未配置,
本地和 CI 均无法运行 npm run lint。先移除 CI lint 步骤,
待后续 PR 单独修复 ESLint 配置。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Mar 4, 2026

Copy link
Copy Markdown

Claude finished @lishuceo's task in 1m 36s —— View job


PR Review: ci: 增加 CI 测试门禁 + 文档变更跳过部署 (re-review after sync)

  • Check for previous review comments and resolve fixed ones
  • Read PR diff and changed files
  • Review each changed file in full context
  • Post review summary

⚠️ 1 previous issue still open

The timeout-minutes warning on deploy.yml test job from the previous review has not been fixed. See inline comment.


New code changes review (text content card feature)

This sync adds a text content card feature alongside the CI changes. The new code in event-handler.ts and message-builder.ts is well-structured:

What's good:

  • truncateToByteLimit() correctly handles UTF-8 character boundaries when truncating — avoids broken multi-byte characters
  • flushTextCard() has proper error handling with textCardFailed circuit breaker to avoid spamming failed API calls
  • All three completion paths (normal, restart, error) consistently call flushTextCard(pendingTurn?.textContent, true) to finalize the text card
  • Text card is scoped to thread mode only (if (!threadReplyMsgId) return), which is the right call
  • Tests cover truncation, empty text, completion state, and byte-size constraints

No new issues found in the code changes (confidence threshold ≥ 75).


Summary

Severity File Issue Status
🟡 Warning deploy.yml:15 Missing timeout-minutes on test job Still open (from previous review)

The CI workflow changes and the text content card feature both look solid. Only the persisting timeout-minutes gap needs to be addressed.

@lishuceo
lishuceo merged commit 3e66a1c into main Mar 4, 2026
4 checks passed
@lishuceo
lishuceo deleted the ci/add-test-gate-and-paths-ignore branch March 4, 2026 06:57
lishuceo added a commit that referenced this pull request Apr 8, 2026
* ci: 增加 CI 测试门禁 + 文档变更跳过部署

- deploy.yml: 加 paths-ignore 跳过 docs/md 等纯文档变更
- deploy.yml: 新增 test job (ubuntu-latest) 作为部署前门禁,typecheck + 单元测试
- 新建 ci.yml: PR 级别测试 (typecheck + lint + unit tests)
- 测试排除 quality.test.ts 和 integration.test.ts (外部 API 依赖)
- 新增 docs/ci-improvements.md 改进方案文档

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add text content card to display agent output in threads (#110)

Previously in thread mode, only the last turn's text was shown in the
result card. Intermediate turns' text content was accumulated in memory
but never sent to Feishu, causing users to miss detailed conclusions.

Add a continuously-updated text content card between the progress card
(tool calls) and the result card (status). Also fix pre-existing bug
where the normal completion path dropped the last turn's tool calls
from the progress card.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: CI 移除 lint 步骤 — ESLint v10 缺少 flat config

ESLint v10 要求 eslint.config.js (flat config),项目尚未配置,
本地和 CI 均无法运行 npm run lint。先移除 CI lint 步骤,
待后续 PR 单独修复 ESLint 配置。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant