v0.5.0: fix update-check repository URL (inherit workspace repository)
The About-tab "check for updates" returned "repository URL not configured at build time" because the http-api crate didn't inherit the workspace `repository` field, leaving CARGO_PKG_REPOSITORY empty. Add `repository.workspace = true` so the Gitea releases API URL derives correctly, and strengthen the unit test to assert the URL is present. Caught by the v0.5.0 container smoke test before publish. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
fc99973ac3
commit
f9df3f8bd8
@@ -4,6 +4,10 @@ version.workspace = true
|
|||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
# v0.5.0: inherit the workspace repository so CARGO_PKG_REPOSITORY is
|
||||||
|
# populated at build time — the About-tab update check derives the
|
||||||
|
# Gitea releases API URL from it.
|
||||||
|
repository.workspace = true
|
||||||
description = "HTTP server: ISO uploads, iPXE script generation, ISO streaming"
|
description = "HTTP server: ISO uploads, iPXE script generation, ISO streaming"
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
|
|||||||
@@ -2345,12 +2345,12 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn gitea_api_url_derives_from_repo() {
|
fn gitea_api_url_derives_from_repo() {
|
||||||
// CARGO_PKG_REPOSITORY is set from the workspace manifest.
|
// The crate inherits the workspace `repository`, so
|
||||||
let url = gitea_releases_api_url();
|
// CARGO_PKG_REPOSITORY is populated and the update check has a
|
||||||
if let Some(u) = url {
|
// real URL to hit (regressed once when the inherit was missing).
|
||||||
assert!(u.contains("/api/v1/repos/"), "got: {u}");
|
let u = gitea_releases_api_url().expect("repository must be configured at build time");
|
||||||
assert!(u.ends_with("/releases/latest"), "got: {u}");
|
assert!(u.contains("/api/v1/repos/"), "got: {u}");
|
||||||
}
|
assert!(u.ends_with("/releases/latest"), "got: {u}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user