feature: issues/1387,支持除github外的更多仓库源、支持自定义zip下载地址仓库源#1410
Open
xzxiaoshan wants to merge 5 commits intofarion1231:mainfrom
Open
feature: issues/1387,支持除github外的更多仓库源、支持自定义zip下载地址仓库源#1410xzxiaoshan wants to merge 5 commits intofarion1231:mainfrom
xzxiaoshan wants to merge 5 commits intofarion1231:mainfrom
Conversation
xzxiaoshan
commented
Mar 11, 2026
4 tasks
farion1231
reviewed
Mar 11, 2026
Owner
farion1231
left a comment
There was a problem hiding this comment.
这个pr没必要升级数据库版本,这 3 个字段本质上是“纯加列 + 合理默认值”,更适合走项目里已有的 repair 路径:
在 create_tables_on_conn() 里把新库的 skill_repos 表定义补全
对旧库用 add_column_if_missing() 自动补这 3 列
Comment on lines
+990
to
+1002
| // 为现有数据生成 zip_url 和 website_url(按 GitHub 格式),并设置 repo_source | ||
| conn.execute( | ||
| "UPDATE skill_repos SET | ||
| zip_url = 'https://github.com/' || owner || '/' || name || '/archive/refs/heads/' || branch || '.zip', | ||
| website_url = 'https://github.com/' || owner || '/' || name, | ||
| repo_source = 'github' | ||
| WHERE zip_url IS NULL", | ||
| [], | ||
| ) | ||
| .map_err(|e| AppError::Database(format!("迁移 skill_repos 数据失败:{e}")))?; | ||
|
|
||
| log::info!("v6 -> v7 迁移完成:已添加 zip_url、website_url 和 repo_source 字段"); | ||
| Ok(()) |
Owner
There was a problem hiding this comment.
从 lock 导入、branch = HEAD 的旧仓库会被固定成 .../HEAD.zip,直接失败
即使下载成功,返回的 resolved branch 也是空字符串,后续 repoBranch / 文档链接都会异常
| })} | ||
| </span> | ||
| <div className="mt-1 text-xs text-muted-foreground truncate max-w-[400px]"> | ||
| {repo.zipUrl || `https://github.com/${repo.owner}/${repo.name}`} |
Owner
There was a problem hiding this comment.
仓库管理列表里,zipUrl 为空时仍然默认展示并打开 https://github.com/{owner}/{name}。这会导致 Gitee 仓库显示成 GitHub 地址,点击外链也跳错站点。
| })} | ||
| </span> | ||
| <div className="mt-1 text-xs text-muted-foreground truncate max-w-[400px]"> | ||
| {repo.zipUrl || `https://github.com/${repo.owner}/${repo.name}`} |
Author
|
我来每处处理一下。 |
Author
Author
|
已全部修改完,请处理。 另外,这个代码被 merge 以后。我打算处理一下这个添加仓库的性能问题(修改为添加哪个仓库就只fetch对应仓库)。 |
|
有个小问题,那种公司内部的仓库能行吗? |
Author
支持,只需要填上分支对应的下载地址即可。不知道作者什么时候回review合并。 |
|
请求佬同步支持一下gitlab |
Author
本次PR,已新增对gitlab的支持。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
