Skip to content

测试使用新方式生成的ci文件 #28

Closed

Description

@liwenka1
No description provided.

Activity

  1. liwenka1 commented on Aug 7, 2026

    @liwenka1
    OwnerAuthor

    /deepcode 分享一下0.4.1这个版本新提交的commit都做了什么

  2. deepcode-agent commented on Aug 7, 2026

    @deepcode-agent
    Contributor

    🤖 Deep Code

    🤔 思考过程(点击展开)

    The user wants me to look at the commit history to understand what was done in version 0.4.1. Let me check the git log to see the commits.The tag isn't showing with git tag -l '0.4*'. Let me check all tags and also look at the commits between 0.4.0 and 0.4.1 more carefully.Let me look at the commits between v0.4.0 and v0.4.1.Now let me get more detail on each commit to summarize what v0.4.1 did.Now I have a comprehensive view of the v0.4.1 commits. Let me also check what the "new CI file generation" is about - the issue title mentions "测试使用新方式生成的ci文件". Let me look at the current CI-related files.

    根据 git 历史,v0.4.0 → v0.4.1 共有 9 个 commit,这里按功能分组说明:


    v0.4.1 新增提交一览

    1. CI Bot 管线从「专属脚本」重构为「可复用库」

    bbdfbd2 feat(github): 一条命令给任意仓库装上 CI bot

    这是本版本最大的改动。之前的 CI bot 是 deep-code 仓库专属的 272 行硬编码 workflow,现在变成了:

    • .github/workflows/deepcode-bot.yml —— 可复用管线(on: workflow_call),参数化:触发前缀、允许的 association、语言、模型、权限档、超时等。GitHub App 变成可选,没配就用 GITHUB_TOKEN。
    • deepcode-bot.yml → deepcode.yml —— 本仓库调用方从 272 行压到 38 行,和外部用户要写的那份一模一样,不留私有副本。
    • 新增 deepcode github install / status 命令 —— 一条命令给任意仓库装上 CI bot:写 workflow + 设 secret(stdin 不走 argv),--with-app 引导配 App,--print 预览。默认 pin 自己的版本号。

    2. CI 驱动从 serve+curl 切换为 -p 单发模式

    81338fd ci(bot): serve+curl 换成 -p 单发——退出码接管失败感知,超时进程内收尸

    • 删掉整个 Start server 步骤:不再有端口、bearer token、健康轮询,攻击面与启动竞态一并消失。
    • 驱动变为:printf | deepcode -p --output-format json,jq 直读结果。
    • 失败感知从「猜答案文件是否为空」变成退出码:-p 非零即失败,--timeout 840 进程内优雅取消。
    • npm 安装加 @>=0.4.0 版本下限。

    3. Bot 身份从 github-actions[bot] 改为 deepcode-agent[bot]

    6d12aa2 ci(bot): 提交/PR/评论全部换成 deepcode-agent[bot] 身份

    • 新增 create-github-app-token + Resolve bot identity 两步:运行时解析 slug 与数字 ID 拼出 noreply 作者邮箱,App 改名 CI 零改动。
    • App token 的 push 正常触发 CI(GITHUB_TOKEN 不触发其他 workflow,bot 分支此前从来不跑 CI)。
    • GITHUB_TOKEN 收紧到全 read。

    4. 触发判定与参数兜底

    8ceb3e9 fix(bot): 触发判定与版本参数写死兜底,不赌 inputs 的解析时机

    • job 级 if 在 reusable workflow 取 inputs 有已知毛边(actions/runner#1602),把 trigger、allowed-associations、version、permission-mode、agent-timeout 的默认值全写死在表达式里。
    • 空 version 会拼出悬空 @ 让 npm 失败,写死兜底。

    5. 发版后重新生成 CI

    c390f2b chore(bot): 本仓库暂时摘掉触发器,发版后用 install 命令重新生成

    • 删掉手写的调用方,发版后跑 deepcode github install --with-app 重新生成——验证 install 命令 + 生成产物 + 按 tag 引用管线的完整链路。

    6. 去掉 npm 版本约束,管线引用改跟 main

    782993c fix(bot): 去掉 npm 版本约束,管线引用改跟 main

    • 删掉 version input 和 npm i -g "…@>=0.4.0":装最新版就是。
    • install 生成的 ref 从 v{版本号} 改成 main,避免改一行 YAML 就要走完整发版。
    • 补测试锁住默认值。

    7. 发版 commit

    a4a695e chore(release): 0.4.1 — 版本号升到 0.4.1。

    8. 合入 PR + README 优化

    4b84a01 / b0deddd — 合入 deep-code 自己对 README 的优化建议。

    9. 最新:重新装上 bot 触发器

    b83fe2a ci(bot): 重新装上 bot 触发器,由 deepcode github install 生成 — 这是 v0.4.1 之后的 commit,用 deepcode github install 重新生成了 CI 调用方。


    总结:v0.4.1 的核心主题是 「CI bot 产品化」——把原来只在本仓库能跑的 bot 管线变成一条命令就能装到任意仓库的可复用基础设施,同时把驱动方式从 serve 模式切换为更可靠的 -p 单发模式。

    ✅ 分析完毕,当前代码无需修改。

  3. liwenka1 commented on Aug 7, 2026

    @liwenka1
    OwnerAuthor

    测试完成,关闭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions