Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the changelog parsing logic in the UpgradeDialog to use HTML data attributes instead of regex pattern matching for version extraction. The changes simplify version identification by relying on structured data-version attributes in the HTML changelog.
- Removed regex-based version extraction using
CHANGELOG_TITLE_PATTERN - Replaced manual changelog traversal and version parsing with direct HTML attribute selection
- Simplified the changelog version comparison logic
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| changelogVersion = extractVersionNumber(node); | ||
| if (changelogVersion == null || changelogVersion.compareTo(currentVersion) <= 0) { | ||
| String changelogVersion = node.attr("data-version"); | ||
| if (StringUtils.isBlank(changelogVersion) || currentVersion.compareTo(changelogVersion) >= 0) { |
There was a problem hiding this comment.
Type mismatch in compareTo call. currentVersion is a VersionNumber object but changelogVersion is a String. The compareTo method expects a VersionNumber parameter. This will cause a compilation error. Convert changelogVersion to a VersionNumber using VersionNumber.asVersion(changelogVersion) before comparison.
| if (StringUtils.isBlank(changelogVersion) || currentVersion.compareTo(changelogVersion) >= 0) { | |
| if (StringUtils.isBlank(changelogVersion) || currentVersion.compareTo(VersionNumber.asVersion(changelogVersion)) >= 0) { |
现在我们只能提供一个
nowchange和一个nowpreview标签,但如果我们想让稳定版 3.7.x 和 3.6.x 更新到不同目标的话,那么我们就无法为 3.6.x 指定最新更新日志。本 PR 调整了 HMCL 检查更新日志的方式。现在 HMCL 不再依赖
nowchange和nowpreview标签来检查更新日志,而是直接查询目标版本的日志条目。