Make the CI checks say what they mean, and format the workspace
The Android job's "Verify minimum API level" step has never verified the minimum API level. It took the first `*.so` anywhere under the target directory, which is a host proc-macro from debug/deps — an x86-64 object built by the runner's gcc, whose .comment section cannot mention Android and so can never contradict the expected value. It now reads the artifact under the target triple, compares against MIN_API parsed from the Dockerfile rather than a second copy of the number, and fails on a mismatch. Both sides are checked non-empty first: two failed parses would otherwise compare equal and pass, which is the same silent success in a new costume. The Android image installs one SDK package per layer and keeps the output. sdkmanager is a JVM program that aborts when it cannot get memory, and the single `> /dev/null` step reported that as a bare "exit code 134" while a retry re-downloaded everything that had already succeeded. tools/ci-local.sh runs all four jobs — desktop, android, layering, traceability — against the host toolchain, which is pinned to the same 1.92.0 CI installs. Its matrix check compares regeneration against the working tree rather than against HEAD: CI starts from a clean checkout, so git's answer is the right one there and reports every local run stale here. The rest is rustfmt across the workspace, and the clippy findings that surfaced once it did: manual_contains in dr-thumbs and collections_ui, a map iterated as pairs for its keys, an index loop over a slice, and two runtime assertions on a constant now made at compile time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -134,7 +134,8 @@ impl NextcloudBackend {
|
||||
for (i, chunk) in body.chunks(chunk_size).enumerate() {
|
||||
if i + 1 > CHUNKS.max_chunks as usize {
|
||||
return Err(RemoteError::Protocol(format!(
|
||||
"{total} bytes exceeds {} chunks", CHUNKS.max_chunks
|
||||
"{total} bytes exceeds {} chunks",
|
||||
CHUNKS.max_chunks
|
||||
)));
|
||||
}
|
||||
let resp = self
|
||||
@@ -221,9 +222,7 @@ impl NextcloudBackend {
|
||||
.map_err(map_send_error)?;
|
||||
|
||||
map_status(resp.status(), path.as_str())?;
|
||||
resp.text()
|
||||
.await
|
||||
.map_err(map_send_error)
|
||||
resp.text().await.map_err(map_send_error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,18 +280,11 @@ impl RemoteBackend for NextcloudBackend {
|
||||
);
|
||||
}
|
||||
|
||||
let resp = req
|
||||
.send()
|
||||
.await
|
||||
.map_err(map_send_error)?;
|
||||
let resp = req.send().await.map_err(map_send_error)?;
|
||||
let status = resp.status();
|
||||
map_status(status, &url)?;
|
||||
|
||||
let body = resp
|
||||
.bytes()
|
||||
.await
|
||||
.map_err(map_send_error)?
|
||||
.to_vec();
|
||||
let body = resp.bytes().await.map_err(map_send_error)?.to_vec();
|
||||
|
||||
// Nextcloud does not advertise Accept-Ranges, so support is detected
|
||||
// by the response code rather than by probing with HEAD (ARCH §6.7).
|
||||
@@ -342,11 +334,7 @@ impl RemoteBackend for NextcloudBackend {
|
||||
None => {}
|
||||
}
|
||||
|
||||
let resp = req
|
||||
.body(body)
|
||||
.send()
|
||||
.await
|
||||
.map_err(map_send_error)?;
|
||||
let resp = req.body(body).send().await.map_err(map_send_error)?;
|
||||
map_status(resp.status(), path.as_str())?;
|
||||
|
||||
resp.headers()
|
||||
@@ -371,10 +359,7 @@ impl RemoteBackend for NextcloudBackend {
|
||||
req = req.header(reqwest::header::IF_MATCH, format!("\"{}\"", v.as_str()));
|
||||
}
|
||||
|
||||
let resp = req
|
||||
.send()
|
||||
.await
|
||||
.map_err(map_send_error)?;
|
||||
let resp = req.send().await.map_err(map_send_error)?;
|
||||
map_status(resp.status(), &url)
|
||||
}
|
||||
|
||||
@@ -491,12 +476,7 @@ impl RemoteBackend for NextcloudBackend {
|
||||
}
|
||||
map_status(resp.status(), &url)?;
|
||||
|
||||
Ok(Some(
|
||||
resp.bytes()
|
||||
.await
|
||||
.map_err(map_send_error)?
|
||||
.to_vec(),
|
||||
))
|
||||
Ok(Some(resp.bytes().await.map_err(map_send_error)?.to_vec()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,15 +513,15 @@ const EXTRA_ROOTS: &[(&str, &[u8])] = &[(
|
||||
/// failing here would take down every connection including the ones that never
|
||||
/// needed the extra anchor.
|
||||
fn extra_roots() -> impl Iterator<Item = reqwest::Certificate> {
|
||||
EXTRA_ROOTS.iter().filter_map(|(name, pem)| {
|
||||
match reqwest::Certificate::from_pem(pem) {
|
||||
EXTRA_ROOTS
|
||||
.iter()
|
||||
.filter_map(|(name, pem)| match reqwest::Certificate::from_pem(pem) {
|
||||
Ok(c) => Some(c),
|
||||
Err(e) => {
|
||||
log::warn!("bundled root {name} unusable: {e}");
|
||||
None
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/// Build an HTTP client with the crypto provider already installed.
|
||||
@@ -852,5 +832,3 @@ mod live {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user