feat(webui): support for commit hash update (implement #6782)#6817
feat(webui): support for commit hash update (implement #6782)#6817mzwing wants to merge 5 commits intoAstrBotDevs:masterfrom
Conversation
Summary of ChangesHello, 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! This pull request introduces a significant enhancement to the dashboard's update mechanism, allowing users to directly specify a Git commit hash to update the application. This capability streamlines the process of testing and previewing unreleased features or bug fixes, providing greater flexibility and control over the application version. The changes primarily involve UI integration and internationalization to support this new functionality. Highlights
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. Footnotes
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The commit hash validation logic is duplicated between
commitHashRulesand the button:disabledexpression; consider centralizing this into a single computed (e.g.,isCommitHashValid) or shared helper to avoid divergence. - The newly added
.mdi-qrcodeicon in the MDI subset appears unused in the shown changes; if it's not required by this feature, consider removing it to keep the subset minimal.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The commit hash validation logic is duplicated between `commitHashRules` and the button `:disabled` expression; consider centralizing this into a single computed (e.g., `isCommitHashValid`) or shared helper to avoid divergence.
- The newly added `.mdi-qrcode` icon in the MDI subset appears unused in the shown changes; if it's not required by this feature, consider removing it to keep the subset minimal.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.
Code Review
This pull request introduces a valuable feature allowing users to update the application by specifying a commit hash, which is great for testing unreleased changes. The implementation is well-contained, adding a new UI component to the update dialog and correctly leveraging existing backend functionality. I've included a couple of suggestions to refactor a small piece of duplicated validation logic in the Vue component to enhance maintainability. Otherwise, the changes look good.
There was a problem hiding this comment.
Pull request overview
Adds a WebUI option to update AstrBot by specifying a Git commit hash (leveraging the existing backend update endpoint), plus the necessary i18n strings.
Changes:
- Add a commit-hash input + validation + “install” button to the update dialog UI.
- Add i18n strings for the new commit-hash section (zh-CN/en-US/ru-RU).
- Regenerate/update the MDI subset (CSS + bundled font files), including adding
mdi-qrcode.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dashboard/src/layouts/full/vertical-header/VerticalHeader.vue | Adds commit-hash input UI and hooks it into the existing /api/update/do update flow |
| dashboard/src/i18n/locales/zh-CN/core/header.json | Adds zh-CN strings for commit-hash update section |
| dashboard/src/i18n/locales/en-US/core/header.json | Adds en-US strings for commit-hash update section |
| dashboard/src/i18n/locales/ru-RU/core/header.json | Adds ru-RU strings for commit-hash update section |
| dashboard/src/assets/mdi-subset/materialdesignicons-subset.css | Updates auto-generated icon subset CSS (adds mdi-qrcode, updates icon count comment) |
| dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff2 | Updated icon subset font binary |
| dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff | Updated icon subset font binary |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds a useful feature to update the application via a specific commit hash from the WebUI. The implementation is straightforward, reusing existing logic. I've found a few areas for improvement regarding code style and maintainability. Specifically, I've suggested removing inline styles in favor of CSS classes, adding missing newlines at the end of JSON files, and separating an unrelated icon change into its own pull request to maintain focus. These changes will improve code quality and consistency.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable feature allowing users to update the application to a specific version using a commit hash directly from the WebUI. The changes are well-implemented, including the addition of the necessary UI components, input validation, and internationalization support. The code reuses existing update logic effectively. I have one suggestion to improve the accessibility and UI consistency of the new input field.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable feature allowing users to update the application to a specific version using a commit hash, which is great for testing unreleased changes. The implementation is straightforward, adding a new input section to the existing update dialog and reusing the backend logic.
My main feedback is a critical issue regarding the internationalization (i18n) keys used for the new UI elements. The keys have an incorrect path, which will prevent the text from being displayed correctly. I've left specific comments with suggestions to fix this.
Once the i18n keys are corrected, this change looks good to go.
Implement #6782 .
Add support for dashboard WebUI to support update via specifying commit hash.
This can let users preview the unreleased fixes or features much more easily.
Modifications / 改动点
Edited files:
dashboard/src/layouts/full/vertical-header/VerticalHeader.vue: Add commit input frame logic.dashboard/src/i18n/locales/**/core/header.json: Add needed text's i18n translation.Functions:
Note:
I'm not familiar with ru-RU, so I just translate it using Google Translate. It may be better to refine the i18n text later.
This is NOT a breaking change. / 这不是一个破坏性变更。
Screenshots or Test Results / 运行截图或测试结果
Screenshot:
Log:
Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Add dashboard WebUI support for updating to a specific core version by commit hash and update related UI assets and translations.
New Features:
Enhancements: