MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / build_version

Function build_version

atomic-cli/src/commands/diagnostics/metrics.rs:64–78  ·  view source on GitHub ↗
(txn: &redb::ReadTransaction, key: &str)

Source from the content-addressed store, hash-verified

62}
63
64fn build_version(txn: &redb::ReadTransaction, key: &str) -> Observation<String> {
65 match read_version(txn, key) {
66 Ok(Some(value))
67 if !value.is_empty()
68 && value.len() <= 128
69 && value
70 .bytes()
71 .all(|b| b.is_ascii_alphanumeric() || b" .()-_+".contains(&b)) =>
72 {
73 Observation::available(value)
74 }
75 Ok(None) => Observation::unavailable("not recorded"),
76 _ => Observation::unavailable("build metadata unreadable or invalid"),
77 }
78}
79
80#[derive(Debug, Default, Serialize)]
81pub(crate) struct IntentCounts {

Callers 1

collectFunction · 0.85

Calls 7

read_versionFunction · 0.85
unavailableFunction · 0.50
is_emptyMethod · 0.45
lenMethod · 0.45
allMethod · 0.45
bytesMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected