diff options
| author | aur-build <aur-build@localhost> | 2026-11-19 17:33:17 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-19 17:33:17 +0000 |
| commit | 4304b0f336ddba7b4ec6780795059ff2066d105b (patch) | |
| tree | 10edea744a1c2bf3fc363b4dc7f64abac8b1a0d3 /src/review/risk.rs | |
| parent | e757979f1a2afdbe7146066345bb9acd19d3b151 (diff) | |
| download | aur-build-4304b0f336ddba7b4ec6780795059ff2066d105b.tar.gz aur-build-4304b0f336ddba7b4ec6780795059ff2066d105b.zip | |
comments: keep only what the code cannot show
Stripped every comment that described what an item does, documented its
arguments or fields, or cited the design docs (§n, I-n, m-n, decision n).
2247 comments down to 83.
What survives: the section dividers that segment the large modules, the
secret-handling warnings, the agent wire-frame directions, and the few notes
without which the code they attach to reads as redundant, reorderable, or
unsound.
Diffstat (limited to 'src/review/risk.rs')
| -rw-r--r-- | src/review/risk.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/review/risk.rs b/src/review/risk.rs index 3b483cf..f33f9e0 100644 --- a/src/review/risk.rs +++ b/src/review/risk.rs @@ -8,12 +8,8 @@ pub mod level { pub const HIGH: &str = "high"; } -/// A build tool in `makedepends` means the build can fetch and compile anything -/// (§16: we do not sandbox the network in v0, so the reviewer should see it). const FETCHING_BUILD_TOOLS: &[&str] = &["cargo", "npm", "go", "pip", "python", "ruby", "deno", "rust", "nodejs"]; -/// Files whose presence in an upstream commit range means the build itself -/// changed, not just the code. const BUILD_SYSTEM_FILES: &[&str] = &[ "Cargo.toml", "Cargo.lock", "package.json", "setup.py", "pyproject.toml", "Makefile", "CMakeLists.txt", "meson.build", "go.mod", "Gemfile", "build.gradle", @@ -31,8 +27,6 @@ impl Assessment { } } -/// Score a candidate against the release it would replace. `None` accepted -/// means a first introduction, which is its own kind of review (§7.1b). pub fn assess( db: &Db, cfg: &crate::config::Config, @@ -54,7 +48,6 @@ pub fn assess( } } - // Things only visible from the recipe itself. if new.skipgpcheck { s.add("skippgpcheck", level::HIGH); } @@ -67,8 +60,6 @@ pub fn assess( } } if new.install.is_some() { - // An `.install` script is arbitrary code that runs on every consumer - // machine at install time. s.add("install-script", level::HIGH); } for opt in &new.options { @@ -77,8 +68,6 @@ pub fn assess( } } - // Upstream movement that touches the build system (§6): the diff is in a - // language ecosystem we cannot inspect, so say so. if let Some(a) = accepted { for pin in accepted_pins(accepted) { if let Some(old_pin) = a.pins().into_iter().find(|p| p.index == pin.index) { @@ -101,7 +90,6 @@ fn accepted_pins(accepted: Option<&ReleaseRow>) -> Vec<UpstreamPin> { } fn compare_recipes(old: &Recipe, new: &Recipe, s: &mut SignalSet) { - // Version deltas. if new.epoch != old.epoch && pkgver::vercmp(&new.epoch, &old.epoch) == std::cmp::Ordering::Greater { s.add("epoch-bump", level::MEDIUM); } @@ -111,7 +99,6 @@ fn compare_recipes(old: &Recipe, new: &Recipe, s: &mut SignalSet) { if pkgver::is_downgrade(&old.pkgver, &new.pkgver) { s.add("downgrade", level::MEDIUM); } - // Sources: added/removed entries and host changes. let old_hosts = crate::urlutil::hosts(&old.source); let new_hosts = crate::urlutil::hosts(&new.source); for h in &new_hosts { @@ -122,7 +109,6 @@ fn compare_recipes(old: &Recipe, new: &Recipe, s: &mut SignalSet) { if new.source.len() != old.source.len() { s.add("source-set-changed", level::MEDIUM); } - // Checksums weakening: a sum that existed and is now SKIP. for (i, sum) in new.sha256sums.iter().enumerate() { if sum.eq_ignore_ascii_case("SKIP") { match old.sha256sums.get(i) { @@ -136,7 +122,6 @@ fn compare_recipes(old: &Recipe, new: &Recipe, s: &mut SignalSet) { if !old.validpgpkeys.is_empty() && new.validpgpkeys.is_empty() { s.add("validpgpkeys-removed", level::HIGH); } - // Dependencies. let old_md: std::collections::BTreeSet<String> = pkgver::dep_names(&old.makedepends).into_iter().collect(); for md in pkgver::dep_names(&new.makedepends) { if !old_md.contains(&md) { @@ -146,10 +131,8 @@ fn compare_recipes(old: &Recipe, new: &Recipe, s: &mut SignalSet) { let old_cd: std::collections::BTreeSet<String> = pkgver::dep_names(&old.checkdepends).into_iter().collect(); let new_cd: std::collections::BTreeSet<String> = pkgver::dep_names(&new.checkdepends).into_iter().collect(); if !old_cd.is_empty() && new_cd.is_empty() { - // Tests silently stopped running. s.add("checkdepends-removed", level::MEDIUM); } - // Did the executable part of the recipe change, or only metadata? if crate::recipe::bodies_changed(&old.pkgbuild, &new.pkgbuild) { s.add("recipe-code-changed", level::HIGH); } @@ -158,9 +141,6 @@ fn compare_recipes(old: &Recipe, new: &Recipe, s: &mut SignalSet) { } } -/// Digest comparison. Drift with no version change is an `integrity_alert` -/// (§5.3) and never reaches here as a review, so anything that *does* show up -/// alongside a version change is still worth saying. fn compare_digests( _old: &Recipe, _new: &Recipe, @@ -178,9 +158,7 @@ fn compare_digests( } } - fn upstream_touches_build_system(cfg: &crate::config::Config, from: &str, to: &str) -> bool { - // Best-effort: if we have the upstream clone cached we can ask it directly. let cache = cfg.vcs_cache_dir(); if !cache.exists() { return false; @@ -197,7 +175,6 @@ fn upstream_touches_build_system(cfg: &crate::config::Config, from: &str, to: &s false } -/// Accumulator that keeps the highest level seen and de-duplicates signals. #[derive(Debug, Default)] struct SignalSet { level: String, |
