Skip to content

feat(helm): 添加获取release安装日志功能 #271

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

Merged
merged 1 commit into from
Jul 25, 2025
Merged

Conversation

weibaohui
Copy link
Owner

在helm命令中添加--debug参数以输出调试日志
添加获取release安装日志的API接口和前端展示页面

在helm命令中添加--debug参数以输出调试日志
添加获取release安装日志的API接口和前端展示页面
Copy link
Contributor

coderabbitai bot commented Jul 25, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • 新功能

    • 在 Helm 发布详情页新增“安装log”按钮,可通过抽屉方式查看安装日志,支持一键关闭与快捷键 ESC 关闭。
    • 安装日志内容实时从后端接口获取,便于用户排查和查看发布过程详情。
  • 优化

    • Helm 命令默认开启调试模式,日志信息更为详细。

Walkthrough

本次变更为 Helm Release 控制器 API 新增了获取安装日志的接口,并在 UI 详情页中集成了安装日志查看抽屉。同时,Helm 命令执行默认增加了 "--debug" 参数以输出详细日志,涉及后端接口、命令行调用和前端页面的联动调整。

Changes

文件/路径 变更摘要
pkg/controller/helm/helm_release.go 新增 /helm/release/ns/:ns/name/:name/revision/:revision/install_log 路由及处理方法 GetReleaseInstallLog,实现安装日志查询接口。
pkg/helm/helm_cmd.go runAndLog 方法中执行 Helm 命令时默认插入 --debug 参数。
ui/public/pages/helm/release.json Helm Release 详情页新增“安装log”抽屉,支持按钮点击后拉取并展示安装日志。

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant API
    participant DB

    User->>UI: 点击“安装log”按钮
    UI->>API: GET /helm/release/ns/:ns/name/:name/revision/:revision/install_log
    API->>DB: 查询 Helm Release 安装日志
    DB-->>API: 返回日志数据
    API-->>UI: 返回 JSON(包含安装日志 result)
    UI-->>User: 抽屉展示安装日志内容
Loading
sequenceDiagram
    participant API
    participant HelmCmd

    API->>HelmCmd: 执行 Helm 命令(runAndLog)
    HelmCmd->>HelmCmd: 在参数前插入 "--debug"
    HelmCmd->>HelmCmd: 执行 Helm 命令并输出详细日志
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰
新增日志抽屉闪亮亮,
一键点开细节忙。
后台接口加新路,
"--debug" 伴随命令航。
代码审阅轻松跳,
运维小兔乐开花!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 55bba26 and ef3f652.

📒 Files selected for processing (3)
  • pkg/controller/helm/helm_release.go (2 hunks)
  • pkg/helm/helm_cmd.go (1 hunks)
  • ui/public/pages/helm/release.json (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch helm-debug

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@weibaohui weibaohui merged commit 5a35cc6 into main Jul 25, 2025
4 of 5 checks passed
@weibaohui weibaohui deleted the helm-debug branch July 25, 2025 14:37
@coderabbitai coderabbitai bot mentioned this pull request Aug 16, 2025
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