feat: publish Curios directly through the Git source

This commit is contained in:
2026-09-09 20:17:55 +08:00
parent 68b7164df8
commit 72272eeb1a
17 changed files with 262 additions and 35 deletions
+10 -4
View File
@@ -377,6 +377,7 @@ async fn main() -> Result<()> {
return remote_source_check(
args.get(2).context("remote source URL required")?,
args.get(3).context("remote source ID required")?,
args.get(4).map(String::as_str).unwrap_or("http"),
)
.await;
}
@@ -477,7 +478,12 @@ async fn main() -> Result<()> {
Ok(())
}
async fn remote_source_check(url: &str, source_id: &str) -> Result<()> {
async fn remote_source_check(url: &str, source_id: &str, kind: &str) -> Result<()> {
let kind = match kind {
"git" => SourceKind::Git,
"http" => SourceKind::Http,
_ => anyhow::bail!("Remote source kind must be git or http"),
};
let sandbox = tempfile::Builder::new()
.prefix("trove-remote-qa-")
.tempdir_in("/tmp")?;
@@ -497,7 +503,7 @@ async fn remote_source_check(url: &str, source_id: &str) -> Result<()> {
packages.add_source(SourceConfig {
id: source_id.into(),
name: source_id.into(),
kind: SourceKind::Http,
kind,
index: url.into(),
enabled: true,
priority: 0,
@@ -599,8 +605,8 @@ async fn remote_source_check(url: &str, source_id: &str) -> Result<()> {
sandbox.close()?;
let failed = rows.iter().filter(|row| row["status"] == "fail").count();
emit(json!({
"schemaVersion":1,"sourceUrl":url,"sourceId":source_id,"target":target(),
"scope":"Remote HTTP index and packages via real PackageManager; installed native backends via real UDS. Desktop UI rendering is not included.",
"schemaVersion":1,"sourceUrl":url,"sourceId":source_id,"sourceKind":kind,"target":target(),
"scope":"Remote source and packages via real PackageManager; installed native backends via real UDS. Desktop UI rendering is not included.",
"passed":rows.len()-failed,"failed":failed,"temporaryDataRemoved":true,"results":rows,
}));
ensure!(failed == 0, "Remote source verification failed");