Skip to content

feature: issues/1387,支持除github外的更多仓库源、支持自定义zip下载地址仓库源#1410

Open
xzxiaoshan wants to merge 5 commits intofarion1231:mainfrom
xzxiaoshan:private-repo
Open

feature: issues/1387,支持除github外的更多仓库源、支持自定义zip下载地址仓库源#1410
xzxiaoshan wants to merge 5 commits intofarion1231:mainfrom
xzxiaoshan:private-repo

Conversation

@xzxiaoshan
Copy link
Copy Markdown

image image

Copy link
Copy Markdown
Owner

@farion1231 farion1231 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个pr没必要升级数据库版本,这 3 个字段本质上是“纯加列 + 合理默认值”,更适合走项目里已有的 repair 路径:

在 create_tables_on_conn() 里把新库的 skill_repos 表定义补全
对旧库用 add_column_if_missing() 自动补这 3 列

Comment thread src-tauri/src/database/schema.rs Outdated
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(())
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

从 lock 导入、branch = HEAD 的旧仓库会被固定成 .../HEAD.zip,直接失败
即使下载成功,返回的 resolved branch 也是空字符串,后续 repoBranch / 文档链接都会异常

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已处理

Comment thread src-tauri/src/services/skill.rs
Comment thread src/components/skills/RepoManager.tsx Outdated
})}
</span>
<div className="mt-1 text-xs text-muted-foreground truncate max-w-[400px]">
{repo.zipUrl || `https://github.com/${repo.owner}/${repo.name}`}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

仓库管理列表里,zipUrl 为空时仍然默认展示并打开 https://github.com/{owner}/{name}。这会导致 Gitee 仓库显示成 GitHub 地址,点击外链也跳错站点。

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已处理

})}
</span>
<div className="mt-1 text-xs text-muted-foreground truncate max-w-[400px]">
{repo.zipUrl || `https://github.com/${repo.owner}/${repo.name}`}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已处理

@xzxiaoshan
Copy link
Copy Markdown
Author

我来每处处理一下。

@xzxiaoshan
Copy link
Copy Markdown
Author

在测试时,我看到了关于 “添加仓库” 按钮执行的代码逻辑,我产生一个疑问,如下图所示:
image

@xzxiaoshan
Copy link
Copy Markdown
Author

已全部修改完,请处理。

另外,这个代码被 merge 以后。我打算处理一下这个添加仓库的性能问题(修改为添加哪个仓库就只fetch对应仓库)。

@xzxiaoshan xzxiaoshan requested a review from farion1231 March 12, 2026 03:20
@axinhouzilaoyue
Copy link
Copy Markdown

有个小问题,那种公司内部的仓库能行吗?

@xzxiaoshan
Copy link
Copy Markdown
Author

有个小问题,那种公司内部的仓库能行吗?

支持,只需要填上分支对应的下载地址即可。不知道作者什么时候回review合并。

@Ezreal-07
Copy link
Copy Markdown

请求佬同步支持一下gitlab

@xzxiaoshan
Copy link
Copy Markdown
Author

请求佬同步支持一下gitlab

本次PR,已新增对gitlab的支持。

@farion1231 @Ezreal-07

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.

5 participants