~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Rust 1.100, and the paths its coverage finds untaken

Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:ci/rust-1.100
.knotless/workflows/check.yml+6−1
@@ -4,7 +4,7 @@
# The image is the Rust `just lint` runs locally, so a newer release's new
# lints land on purpose. The build, the toolchain's components and
# cargo-deny are kept between runs, so a push lints only what it changed.
image: rust:1.98
image: rust:1.100
# The shared runner host; ci.knotless.dev, also this repository's, runs only deploy.yml.
runners: [runner.knotless.dev]
# A pre-flight: the merge queue takes a pull into a batch only once this
@@ -14,6 +14,11 @@ on:
push: {refs: [refs/heads/main]}
pull: {base: [refs/heads/main, refs/heads/feature/*]}
cache: [target, /usr/local/cargo/registry, /usr/local/rustup, /opt/cargo-deny]
env:
# The image's version: the cached /usr/local/rustup hides the image's own
# and keeps the default of the first image that filled it, so rustup
# installs this one into the cache on the first run that names it.
RUSTUP_TOOLCHAIN: "1.100.0"
steps:
# cargo fmt --check, then clippy over the workspace, warnings denied.
- uses: chadtmiller.com/steps/rust-lint@1
.knotless/workflows/e2e.yml+3−1
@@ -14,7 +14,7 @@
# here. Node, the packages, Chromium, the libraries it needs, the alpha
# and the build are kept between runs, as main's runs leave them: nothing
# is fetched again until what it is made from changes.
image: rust:1.98
image: rust:1.100
# The shared runner host; ci.knotless.dev, also this repository's, runs only deploy.yml.
runners: [runner.knotless.dev]
# Every push to main, and pulls into it or a feature/ branch that change
@@ -28,6 +28,8 @@ on:
paths: [web/**, packages/**, lexicons/**, crates/**, Cargo.toml, Cargo.lock, harness/e2e/**, docs/guides/**, harness/look/**, harness/shots.mjs, harness/world.mjs, harness/pds.mjs, harness/alpha.sh, harness/tls-proxy.mjs, harness/package.json, harness/package-lock.json, .knotless/workflows/e2e.yml, .knotless/uses.lock]
cache: [target, /usr/local/cargo/registry, /usr/local/rustup, /opt/node, /opt/atproto, /opt/browsers, /opt/chromium-debs, packages/sdk/node_modules, web/node_modules, harness/node_modules]
env:
# The image's toolchain, over the cached rustup's default (check.yml).
RUSTUP_TOOLCHAIN: "1.100.0"
PLAYWRIGHT_BROWSERS_PATH: /opt/browsers
GROUP_HOST_DEV_ENV: /opt/atproto/packages/dev-env
steps:
.knotless/workflows/test.yml+8−1
@@ -7,7 +7,7 @@
# the harness's packages, the alpha's build, cargo-llvm-cov and the build
# are kept between runs; each is made again only when what it is made from
# changes.
image: rust:1.98
image: rust:1.100
# The shared runner host; ci.knotless.dev, also this repository's, runs only deploy.yml.
runners: [runner.knotless.dev]
# A pre-flight, as check is: the merge queue takes a pull into a batch only
@@ -17,6 +17,9 @@ on:
push: {refs: [refs/heads/main]}
pull: {base: [refs/heads/main, refs/heads/feature/*]}
cache: [target, /usr/local/cargo/registry, /usr/local/rustup, /opt/tools, /opt/node, /opt/atproto, harness/node_modules]
env:
# The image's toolchain, over the cached rustup's default (check.yml).
RUSTUP_TOOLCHAIN: "1.100.0"
steps:
- uses: chadtmiller.com/steps/node@1
with: {version: 24.22.1}
@@ -37,5 +40,9 @@ steps:
- name: test
run: |
export PATH=/opt/node/bin:/opt/tools:$PATH GROUP_HOST_DEV_ENV=/opt/atproto/packages/dev-env
# Cargo 1.100 builds test binaries under debug/build/; those the cached
# target kept in debug/deps from before are stale, and cargo-llvm-cov,
# walking the whole directory, would count their lines as never run.
rm -rf target/llvm-cov-target/debug/deps
cargo llvm-cov --workspace --ignore-filename-regex '(tests/|harness/)' \
--fail-under-lines 100 --fail-under-functions 100 --show-missing-lines
crates/group-host/src/actors.rs+3−4
@@ -66,10 +66,9 @@ impl Host {
/// name and picture as they may read them, and how many are in it.
fn group_view_basic(&self, group: &str, viewer: &str) -> Answer {
let handle = group_of(self, group)?;
let mut view = json!({"did": group, "handle": handle});
if let Some(address) = self.store.address(group).map_err(XrpcError::internal)? {
view["address"] = json!(address);
}
let address = self.store.address(group).map_err(XrpcError::internal)?;
let address = address.expect("a group has an address");
let mut view = json!({"did": group, "handle": handle, "address": address});
let roles = self.roles(group, viewer).map_err(XrpcError::internal)?;
let meta = meta_space(group);
if self.reads_space(&meta, &roles)? {
crates/group-host/src/api.rs+2−4
@@ -345,10 +345,8 @@ pub async fn atproto_did(
.next()
.unwrap_or_default()
.to_ascii_lowercase();
let account = host
.store
.account(&handle)
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
let account = host.store.account(&handle);
let account = account.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
account
.filter(|a| a.handle == handle)
.map(|a| a.did)
crates/group-host/src/group_api.rs+3−11
@@ -117,9 +117,8 @@ fn cid_of(blob: &Value) -> Option<&str> {
blob["ref"]["$link"].as_str()
}
/// What a group's profile shows of it.
fn profile_view(profile: &Value) -> Value {
let mut view = json!({});
/// Puts in `view` what a group's profile shows of it.
fn show_profile(view: &mut Value, profile: &Value) {
for key in [
"displayName",
"description",
@@ -140,7 +139,6 @@ fn profile_view(profile: &Value) -> Value {
view[key] = json!(cid);
}
}
view
}
/// The group's rules in the order they are presented: by `order`, then as
@@ -184,12 +182,6 @@ fn base(host: &Host, did: &str, handle: &str) -> Result<Value, XrpcError> {
Ok(view)
}
fn merge(into: &mut Value, from: Value) {
if let (Some(into), Value::Object(from)) = (into.as_object_mut(), from) {
into.extend(from);
}
}
fn objects(field: &str, items: impl IntoIterator<Item = impl Into<String>>) -> Value {
items
.into_iter()
@@ -257,7 +249,7 @@ pub async fn get_group(
let mut view = base(&host, group, &handle)?;
if reads_meta {
if let Some(profile) = record(&meta, "profile", "self")? {
merge(&mut view, profile_view(&profile));
show_profile(&mut view, &profile);
}
view["rules"] = json!(rules(&host, group)?);
let labeler = record(&meta, "labeler", "self")?.unwrap_or_default();
crates/group-host/src/logs.rs+6−4
@@ -120,13 +120,14 @@ impl Logs {
let db = self.db.lock().expect("not poisoned");
let since = crate::time::now_millis() - DAYS * 86_400_000;
db.execute("DELETE FROM line WHERE at < ?1", [since])?;
let last: Option<i64> = db
let last = db
.query_row(
"SELECT id FROM line WHERE level <= ?1 ORDER BY id DESC LIMIT 1 OFFSET ?2",
params![rank("INFO"), self.keep],
|r| r.get(0),
)
.optional()?;
.optional();
let last: Option<i64> = last?;
if let Some(last) = last {
db.execute(
"DELETE FROM line WHERE level <= ?1 AND id <= ?2",
@@ -168,9 +169,10 @@ impl Logs {
let mut stmt = db.prepare_cached(sql)?;
let p = params![asked.trace, asked.message, level, asked.min_ms, limit];
let rows = stmt.query_map(p, |r| r.get::<_, String>(0))?;
let mut lines: Vec<Value> = rows
let lines: rusqlite::Result<Vec<Value>> = rows
.map(|r| r.map(|text| serde_json::from_str(&text).unwrap_or_default()))
.collect::<rusqlite::Result<_>>()?;
.collect();
let mut lines = lines?;
lines.reverse();
Ok(lines)
}
crates/group-host/src/mcp.rs+2−4
@@ -331,10 +331,8 @@ impl Host {
// Over https, or http for a host on http, as on a dev network.
let on_http = self.config.public_url.starts_with("http://");
if client_id.starts_with("https://") || (on_http && client_id.starts_with("http://")) {
let doc = self
.public_json(client_id, "its client metadata")
.await
.ok()?;
let doc = self.public_json(client_id, "its client metadata").await;
let doc = doc.ok()?;
if doc["client_id"] != client_id {
return None;
}
crates/group-host/src/migration.rs+4−4
@@ -100,11 +100,11 @@ impl Store {
pub fn may_export(&self, group: &str, hash: &str, now: i64) -> Result<bool> {
let sql =
"SELECT 1 FROM migration_export WHERE did = ?1 AND token_hash = ?2 AND expires_at > ?3";
let found: Option<i64> = self
let found = self
.conn()
.query_row(sql, params![group, hash, now], |r| r.get(0))
.optional()?;
Ok(found.is_some())
.query_row(sql, params![group, hash, now], |r| r.get::<_, i64>(0))
.optional();
Ok(found?.is_some())
}
/// `did`'s files that records hold, and their types.
crates/group-host/src/sites.rs+2−5
@@ -445,11 +445,8 @@ impl Host {
(site["notFound"].as_str(), StatusCode::NOT_FOUND),
];
for (named, status) in missing {
if let Some(found) = named
.map(|p| self.site_file(did, &site, p))
.transpose()?
.flatten()
{
let found = named.map(|p| self.site_file(did, &site, p)).transpose();
if let Some(found) = found?.flatten() {
return Ok(file(status, found, asking));
}
}
crates/group-host/src/store.rs+4−4
crates/group-host/src/token_writes.rs+6−4
crates/group-host/tests/common/groups.rs+11−0
crates/group-host/tests/common/mod.rs+15−0
crates/group-host/tests/account_move.rs+26−0
crates/group-host/tests/actors.rs+28−1
crates/group-host/tests/app_passwords.rs+9−0
crates/group-host/tests/authorization.rs+10−0
crates/group-host/tests/console_login.rs+7−0
crates/group-host/tests/groups.rs+8−0
crates/group-host/tests/invites.rs+14−6
crates/group-host/tests/mcp.rs+34−12
crates/group-host/tests/oauth_scope.rs+11−0
crates/group-host/tests/spaces.rs+56−5
crates/group-host-mcp/src/lib.rs+6−4
crates/opensocial/tests/commands.rs+5−5
docs/deploying.md+1−1
AGENTS.md+11−3
Cargo.lock+0−2
Cargo.toml+4−1
Dockerfile+1−1