diff options
| author | aur-build <aur-build@localhost> | 2026-11-21 09:38:21 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-21 09:38:21 +0000 |
| commit | ae492c87ff66b9f2c8fec25a5ca917c438bf5858 (patch) | |
| tree | 18297d0227af73562f9cf6575664649448d8d907 /src/watch | |
| parent | 28023ba17adbe6fc096a31d5e2c62d017a88fc4c (diff) | |
| download | aur-build-ae492c87ff66b9f2c8fec25a5ca917c438bf5858.tar.gz aur-build-ae492c87ff66b9f2c8fec25a5ca917c438bf5858.zip | |
src: close the items the stricter detector surfaced
The auditor's two counterexamples were real, and fixing the detector exposed
seventeen more items it had never listed. Each was checked individually rather
than dispositioned in bulk, and the check changed what the right answer was:
- `review::approve::withdraw` — gated. The CLI and the web UI both go through
`usecase::withdraw_package`; nothing invokes this. tests/pipeline.rs pins its
invariants, so it is gated rather than deleted: the test is the cover for an
operation production has not grown yet.
- `pipeline::dispatch::Pool::shutdown` — gated. Production runs the pool until
the process exits; a test needs the join to assert on effects after the
threads stop. Its two fields now carry a matching `cfg_attr(allow(dead_code))`
because in a release build they are stored and never read.
- `shims::{mkarchroot,makechrootpkg,makepkg,gpg,pacman,record}` — plain
`pub(crate)`. `run` dispatches to them by tool name; no module outside `shims`
names them and no test calls them. The tool names appear in test *strings*,
which is not a caller.
- `db::Writer::start`, `fetch::open`, `http::Req::form`, `http::Page::new`,
`http::Panel::new`, `http::render::BuildRow` — plain `pub(crate)`, same
reason: used only from inside their own module.
- `db::AuditEntry::system` — deleted. `audit_system` builds the row through the
free `audit()`; nothing ever called the constructor, production or otherwise.
- `pkgver::Version::display` — deleted, a wrapper around `to_string` with no
callers.
- `http::Server`, `watch::Stale`, `pkgver::Version` — private inner module with a
gated alias. `Server` is what `spawn` hands back and `main` holds without
naming; `Stale` is what `stale_rows` returns to `http` and `ops`; `Version` is
what `parse` returns. All three must stay nameable to those callers in shape
but not in name, which is exactly what the inner-module alias gives.
Measured on the release build's public surface: 466 reachable public names at the
start of this goal, 402 now, newly-public set empty.
Diffstat (limited to 'src/watch')
| -rw-r--r-- | src/watch/staleness.rs | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/watch/staleness.rs b/src/watch/staleness.rs index 4e171a1..94813eb 100644 --- a/src/watch/staleness.rs +++ b/src/watch/staleness.rs @@ -7,15 +7,34 @@ pub enum Kind { Missing, } -#[derive(Debug, Clone)] -pub struct Stale { - pub kind: Kind, - pub pkgbase: String, - pub dependency: String, - pub built_with: String, - pub now: String, +/// The real definition. The module is private, so this `pub` +/// is not a nameable path from outside; the alias below is the +/// only way to reach it, and the alias is what carries the +/// feature-conditional visibility. +mod stale { + use super::*; + + #[derive(Debug, Clone)] + pub struct Stale { + pub kind: Kind, + pub pkgbase: String, + pub dependency: String, + pub built_with: String, + pub now: String, + } } +/// one row of the staleness report. `http` and `ops` read the report `stale_rows` returns, but only the staleness tests write the name. +/// +/// `pub` only under `test-support`. Production reaches the type +/// through its own module and never names it from outside; the +/// outside reader that needs the name is a test. +#[cfg(feature = "test-support")] +pub use stale::Stale; + +#[cfg(not(feature = "test-support"))] +pub(crate) use stale::Stale; + pub fn stale_rows(db: &Db) -> Result<Vec<Stale>> { let rows = db::published_world_members(db)?; |
