-
Notifications
You must be signed in to change notification settings - Fork 17
chore(workflow): 移除docker.yaml工作流并更新发布流程 #602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
移除原有的docker.yaml工作流文件,该文件负责构建amd64和arm64架构的 Docker镜像并推送到DockerHub和GHCR。 更新release.yml工作流,在发布流程中调用KarinJS/karin-docker仓库 的docker.yaml工作流来处理Docker镜像构建。 更新core包的@karinjs/node-pty依赖版本从1.1.0到1.1.3。 移除packages/docker目录下的Dockerfile、docker.sh和start.sh文件, 这些文件的维护已迁移到独立的karin-docker仓库
审阅者指南(在小型 PR 上折叠)审阅者指南此 PR 移除了仓库内的 Docker 构建工作流和 Docker 资源,将 Docker 镜像构建委托给通过发布工作流触发的外部 KarinJS/karin-docker 仓库,并在 core 包中提升了 @karinjs/node-pty 依赖版本。 触发外部 Docker 构建的发布工作流时序图sequenceDiagram
actor Maintainer
participant GitHub as GitHub_Repo
participant ReleaseWF as release_yml_workflow
participant Dispatch as workflow_dispatch_action
participant DockerRepo as karin_docker_repo
participant DockerWF as docker_yaml_workflow
participant DockerHub as DockerHub
participant GHCR as GHCR
Maintainer->>GitHub: push tag or create release
GitHub-->>ReleaseWF: trigger release.yml
ReleaseWF->>ReleaseWF: run release-please and publish packages
ReleaseWF->>ReleaseWF: check core component released
alt core release is true
ReleaseWF->>Dispatch: call benc-uk/workflow-dispatch
Dispatch->>DockerRepo: dispatch docker.yaml workflow
DockerRepo-->>DockerWF: start docker.yaml
DockerWF->>DockerWF: build amd64 and arm64 images
DockerWF->>DockerHub: push images
DockerWF->>GHCR: push images
else core release is false
ReleaseWF-->>Maintainer: skip external docker build
end
文件级变更
技巧与命令与 Sourcery 交互
自定义你的使用体验访问你的 dashboard 以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR removes the in-repo Docker build workflow and Docker assets, delegates Docker image builds to the external KarinJS/karin-docker repository via the release workflow, and bumps the @karinjs/node-pty dependency version in the core package. Sequence diagram for release workflow triggering external docker buildsequenceDiagram
actor Maintainer
participant GitHub as GitHub_Repo
participant ReleaseWF as release_yml_workflow
participant Dispatch as workflow_dispatch_action
participant DockerRepo as karin_docker_repo
participant DockerWF as docker_yaml_workflow
participant DockerHub as DockerHub
participant GHCR as GHCR
Maintainer->>GitHub: push tag or create release
GitHub-->>ReleaseWF: trigger release.yml
ReleaseWF->>ReleaseWF: run release-please and publish packages
ReleaseWF->>ReleaseWF: check core component released
alt core release is true
ReleaseWF->>Dispatch: call benc-uk/workflow-dispatch
Dispatch->>DockerRepo: dispatch docker.yaml workflow
DockerRepo-->>DockerWF: start docker.yaml
DockerWF->>DockerWF: build amd64 and arm64 images
DockerWF->>DockerHub: push images
DockerWF->>GHCR: push images
else core release is false
ReleaseWF-->>Maintainer: skip external docker build
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughThe PR removes the Docker CI/CD workflow pipeline, Dockerfile, and associated shell scripts (installer and startup), while adjusting the release workflow to dispatch to an external docker workflow repository and bumping a dev dependency. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
💤 Files with no reviewable changes (4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @shiwuliya, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求旨在优化项目的持续集成和发布流程,通过将 Docker 镜像的构建和管理职责转移到一个专门的外部仓库,显著简化了主仓库的工作流。同时,它还更新了一个核心依赖,并对锁定文件进行了细致的调整,以确保构建环境的稳定性和兼容性。 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - 我在这里给出了一些总体反馈:
- 建议将
benc-uk/workflow-dispatch固定到某个特定的提交 SHA(或者至少是一个主版本+次版本标签),而不是使用@v1,以降低上游改动带来的意外行为风险。 - 当通过
workflow-dispatch将 Docker 构建委托给KarinJS/karin-docker时,你可能需要配置类似ref/分支以及wait-for-completion(如果适用)这样的选项,这样发布工作流就能更明确地控制使用哪一个修订版本,以及如何暴露失败信息。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- Consider pinning `benc-uk/workflow-dispatch` to a specific commit SHA (or at least a major+minor tag) instead of `@v1` to reduce the risk of unexpected behavior from upstream changes.
- When delegating the Docker build to `KarinJS/karin-docker` via `workflow-dispatch`, you may want to configure options like `ref`/branch and `wait-for-completion` (if applicable) so that the release workflow has clear control over which revision is used and how failures are surfaced.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've left some high level feedback:
- Consider pinning
benc-uk/workflow-dispatchto a specific commit SHA (or at least a major+minor tag) instead of@v1to reduce the risk of unexpected behavior from upstream changes. - When delegating the Docker build to
KarinJS/karin-dockerviaworkflow-dispatch, you may want to configure options likeref/branch andwait-for-completion(if applicable) so that the release workflow has clear control over which revision is used and how failures are surfaced.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider pinning `benc-uk/workflow-dispatch` to a specific commit SHA (or at least a major+minor tag) instead of `@v1` to reduce the risk of unexpected behavior from upstream changes.
- When delegating the Docker build to `KarinJS/karin-docker` via `workflow-dispatch`, you may want to configure options like `ref`/branch and `wait-for-completion` (if applicable) so that the release workflow has clear control over which revision is used and how failures are surfaced.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
你可以通过以下命令安装该版本: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
本次 PR 主要重构了 Docker 镜像的构建流程,移除了旧的 docker.yaml 工作流和相关的 Dockerfile 及脚本,改为在发布流程中调用外部共享的工作流。同时,更新了 @karinjs/node-pty 依赖。
整体来看,将 Docker 相关逻辑抽离到独立的仓库是一个很好的实践,有助于解耦和统一管理。
在代码审查中,我主要关注了被移除的文件,并针对其中一些实现方式提出了建议。这些建议旨在为新的 karin-docker 仓库中的实现提供参考,以提高安全性、健壮性和用户体验。具体评论请见文件中的详细说明。
I am having trouble creating individual review comments. Click here to see my feedback.
packages/docker/docker.sh (42)
虽然此文件将被移除,但注意到这里通过 curl | bash 的方式安装 Docker。这存在安全风险,因为无法在执行前审查脚本内容。在新的 karin-docker 仓库中,建议考虑更安全的安装方式,例如先下载脚本,校验后再执行,或者引导用户遵循 Docker 官方文档进行安装。这可以防止潜在的恶意脚本攻击。
packages/docker/Dockerfile (10-13)
这个 RUN 指令在构建镜像时动态初始化和安装依赖,这可能会导致构建过程变慢且结果不确定(因为 node-karin 没有指定版本)。虽然此文件将被删除,但在新的 Dockerfile 实现中,建议将项目文件(如 package.json, pnpm-lock.yaml)COPY 到镜像中,然后运行 pnpm install。这样可以利用 Docker 的层缓存机制,并确保依赖版本的确定性,从而构建更快、更可靠的镜像。
packages/docker/docker.sh (58-63)
此脚本直接修改了用户的 ~/.bashrc 文件来添加别名。这种做法可能对用户的环境有侵入性。此外,它只考虑了 bash,而用户可能使用 zsh (.zshrc)、fish (config.fish) 等其他 shell。在新的实现中,建议在脚本末尾向用户显示需要添加的别名信息,并指导他们根据自己使用的 shell 手动添加到对应的配置文件中,这样更安全也更灵活。
packages/docker/docker.sh (64)
注意到这里使用了 source ~/.bashrc。这个命令只会对当前脚本的 shell 会话生效,当脚本执行完毕后,新添加的别名 karin 和 kr 在用户的当前终端中并不会立即可用,用户需要手动执行 source ~/.bashrc 或开启新的终端会话。为了改善用户体验,可以在脚本末尾提示用户需要执行的操作。
移除原有的docker.yaml工作流文件,该文件负责构建amd64和arm64架构的
Docker镜像并推送到DockerHub和GHCR。
更新release.yml工作流,在发布流程中调用KarinJS/karin-docker仓库
的docker.yaml工作流来处理Docker镜像构建。
更新core包的@karinjs/node-pty依赖版本从1.1.0到1.1.3。
移除packages/docker目录下的Dockerfile、docker.sh和start.sh文件, 这些文件的维护已迁移到独立的karin-docker仓库
Summary by Sourcery
在发布过程中将 Docker 镜像构建路由到外部的 karin-docker 仓库,并清理仓库内的 Docker 相关资源。
Enhancements:
docker.yaml工作流,以处理 Docker 镜像构建。@karinjs/node-pty从 1.1.0 升级到 1.1.3。Build:
CI:
.github/workflows/docker.yaml工作流,改用共享的 karin-docker 工作流。Original summary in English
Summary by Sourcery
Route Docker image builds to the external karin-docker repository during release and clean up in-repo Docker assets.
Enhancements:
Build:
CI:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.