Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

merge bufix #998

Merged
merged 24 commits into from
Feb 19, 2025
Merged

merge bufix #998

merged 24 commits into from
Feb 19, 2025

Conversation

Gaojianli
Copy link
Member

@Gaojianli Gaojianli commented Feb 19, 2025

Summary by CodeRabbit

  • 新功能

    • 新增多种启动方式,涵盖图形界面、静默图形、控制台和低内存模式,为用户提供了更多运行选项。
  • Chores

    • 优化了构建流程,更新了项目及依赖版本,并统一了批处理文件的换行符设置,提升了跨平台一致性和构建稳定性。
  • Bug 修复

    • 加强了操作系统版本检测和错误处理,同时调整了局部网络地址的配置,改善了系统兼容性和稳定性。

Ghost-chu and others added 24 commits February 2, 2025 01:18
Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.12.0 to 2.12.1.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md)
- [Commits](google/gson@gson-parent-2.12.0...gson-parent-2.12.1)

---
updated-dependencies:
- dependency-name: com.google.code.gson:gson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
….gson-gson-2.12.1

Bump com.google.code.gson:gson from 2.12.0 to 2.12.1
Bumps [com.github.mizosoft.methanol:methanol](https://github.com/mizosoft/methanol) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/mizosoft/methanol/releases)
- [Changelog](https://github.com/mizosoft/methanol/blob/master/CHANGELOG.md)
- [Commits](mizosoft/methanol@v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: com.github.mizosoft.methanol:methanol
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…soft.methanol-methanol-1.8.1

Bump com.github.mizosoft.methanol:methanol from 1.8.0 to 1.8.1
This reverts commit 5e3c93a.
Bumps [org.springframework:spring-context](https://github.com/spring-projects/spring-framework) from 6.2.2 to 6.2.3.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.2...v6.2.3)

---
updated-dependencies:
- dependency-name: org.springframework:spring-context
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…work-spring-context-6.2.3

Bump org.springframework:spring-context from 6.2.2 to 6.2.3
@Gaojianli Gaojianli requested a review from a team as a code owner February 19, 2025 19:41
Copy link
Contributor

coderabbitai bot commented Feb 19, 2025

Warning

Rate limit exceeded

@coderabbitai[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 28 minutes and 20 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 6020b39 and 27b5fde.

📒 Files selected for processing (11)
  • .gitattributes (1 hunks)
  • Dockerfile (1 hunks)
  • build.sh (1 hunks)
  • pkg/portable/1. GUI Mode.bat (1 hunks)
  • pkg/portable/2. GUI mode (slient).bat (1 hunks)
  • pkg/portable/3. Console.bat (1 hunks)
  • pkg/portable/4) 以控制台模式启动 (低内存模式,可能使用更多 CPU 和磁盘 IO).bat (1 hunks)
  • pkg/portable/4. Low-memory Mode (May cost more CPU and disk) .bat (1 hunks)
  • pom.xml (4 hunks)
  • src/main/java/com/ghostchu/lib/jni/EcoMode.java (3 hunks)
  • src/main/resources/profile.yml (0 hunks)

Walkthrough

此次提交涵盖多个项目文件的修改。首先,在 .gitattributes 中新增了对 .bat 文件使用 CRLF 换行符的配置。Dockerfile 中调整了包更新逻辑,而 build.sh 脚本重构了 web UI 的构建流程。同时,新增了多个批处理脚本以支持不同启动模式(GUI、静默模式、控制台以及低内存模式)。此外,pom.xml 中更新了项目及相关依赖的版本,EcoMode.java 增加了操作系统版本检测和更严格的异常捕获逻辑,profile.yml 则移除了对特定 IP 地址范围的忽略配置。

Changes

文件 更改摘要
.gitattributes 新增 *.bat text eol=crlf 规则,确保 .bat 文件使用 CRLF 换行符
Dockerfile 构建阶段中先执行 apk --update upgrade 后安装 npm, curl, git;其余构建流程保持不变
build.sh 重构 web UI 构建流程:移除 setup-webui.sh 调用,新增工作目录管理、依赖安装、构建 web UI 并复制构建产物的步骤
pkg/portable/* 新增批处理文件:1. GUI Mode.bat2. GUI mode (slient).batConsole.bat4. Low-memory Mode (May cost more CPU and disk).bat;修改 4) 以控制台模式启动 (低内存模式,可能使用更多 CPU 和磁盘 IO).bat 的窗口标题
pom.xml 更新项目版本(7.4.0 → 7.4.3)及依赖版本:gson (2.12.0 → 2.12.1)、methanol (1.8.0 → 1.8.1)、spring-context (6.2.2 → 6.2.3)
src/main/java/.../EcoMode.java 修改 ecoMode 方法:增加操作系统版本检查、将异常捕获从 Exception 修改为 Throwable,并新增 isSupportedVersion 方法
src/main/resources/profile.yml ignore-peers-from-addresses 列表中移除了 "fd00::/8" 条目

Sequence Diagram(s)

sequenceDiagram
    participant BuildScript as build.sh
    BuildScript->>BuildScript: 设置当前工作目录 (current_wd)
    BuildScript->>BuildScript: 定义静态资源目录 (static_dir)
    BuildScript->>BuildScript: 清空旧静态文件 (rm -rf)
    BuildScript->>BuildScript: 切换至 webui 目录
    BuildScript->>BuildScript: 执行 pnpm install 与 pnpm run build
    BuildScript->>BuildScript: 返回原目录
    BuildScript->>BuildScript: 复制 webui/dist 至 static_dir
    BuildScript->>BuildScript: 通过 Maven 构建 JAR
Loading
sequenceDiagram
    participant Client as 调用者
    participant EcoMode as EcoMode
    Client->>EcoMode: 调用 ecoMode(enable)
    EcoMode->>EcoMode: 获取操作系统版本 (osVersion)
    EcoMode->>EcoMode: 调用 isSupportedVersion(osVersion)
    alt OS版本支持
        EcoMode->>EcoMode: 调用 setEcoMode(enable)
        EcoMode->>Client: 返回成功状态
    else 不支持或出错
        EcoMode->>Client: 抛出异常或返回 false
    end
Loading

Possibly related PRs

  • merge bufix #998: 该 PR 与主 PR 直接相关,均涉及在 .gitattributes 文件中添加相同的行,以将 .bat 文件视为使用 CRLF 换行符的文本文件。

Suggested reviewers

  • paulzzh
  • Gaojianli

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

@Gaojianli Gaojianli merged commit d48c4b4 into dev Feb 19, 2025
12 of 13 checks passed
@coderabbitai coderabbitai bot added backend This is a backend related bug 程序错误,有什么东西无法正常工作 webui This is a webui related labels Feb 19, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
backend This is a backend related bug 程序错误,有什么东西无法正常工作 webui This is a webui related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants