summaryrefslogtreecommitdiffstats
path: root/src/db/builds
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-21 13:43:30 +0000
committeraur-build <aur-build@localhost>2026-11-21 13:43:30 +0000
commit7afffd1a0ca798dd5826c2e1881b09fe135dbcbd (patch)
tree819ceee7916e55b51b26809bd48de237638d8629 /src/db/builds
parent864bb0bc3181ff57f4b8a30c4fc4ac4099185ba9 (diff)
downloadaur-build-7afffd1a0ca798dd5826c2e1881b09fe135dbcbd.tar.gz
aur-build-7afffd1a0ca798dd5826c2e1881b09fe135dbcbd.zip
src: delete the fields nothing reads, and the two knobs nothing obeys
The census only sees `pub` items, so the constructs below it stayed invisible until narrowing made the compiler look: rustc reported `ReviewSubject::pkgbase`, `StageB::cached` and `StageB::version` as dead the moment their structs stopped being exported, and the same question asked of every struct field, enum variant and SQL literal in the crate found six more. `BuildRow::lease_owner` and `BuildRow::priority` were selected out of the database into a row nobody read; the *columns* are live — the dispatcher leases through one and orders by the other — so the SELECT list and the row mapper lost them and the schema did not. `Pkgbase::unpinable` and `SnapshotRow::files_json` are the same shape, and `Config::git_bin` and `Config::build_user` are worse: they are knobs an operator can set, defaulted, serialized, and consulted by nothing. A setting that changes nothing is not an unimplemented feature, it is a lie in a config file, so both are gone; `a_config_init_wrote_before_the_enum_ still_loads` now proves a config that still names them loads anyway. Two axes came back empty, and both were checked rather than assumed: every string literal containing SQL is passed to a call, and the two `Error` variants that name matches never mention — `Json` and `Sqlite` — are constructed by `?` in about a hundred places, which is why they were left alone. Every template and every static asset is reachable from a route or an `extends`.
Diffstat (limited to 'src/db/builds')
-rw-r--r--src/db/builds/mod.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/db/builds/mod.rs b/src/db/builds/mod.rs
index fc84335..83566ad 100644
--- a/src/db/builds/mod.rs
+++ b/src/db/builds/mod.rs
@@ -16,17 +16,15 @@ pub struct BuildRow {
pub state: BuildState,
pub blocked_on_json: String,
pub current_step: Option<String>,
- pub lease_owner: Option<String>,
pub lease_expires_at: Option<String>,
pub attempt: i64,
- pub priority: i64,
pub cancel_requested: bool,
pub error: Option<String>,
}
const BUILD_COLS: &str = "id, pkgbase_id, candidate_id, release_id, kind, world_snapshot_id, \
- build_profile, state, blocked_on_json, current_step, lease_owner, lease_expires_at, \
- attempt, priority, cancel_requested, error";
+ build_profile, state, blocked_on_json, current_step, lease_expires_at, \
+ attempt, cancel_requested, error";
pub(crate) fn row_to_build(r: &rusqlite::Row<'_>) -> rusqlite::Result<BuildRow> {
let state = crate::db::state_col::<BuildState>(7, &r.get::<_, String>(7)?)?;
@@ -41,12 +39,10 @@ pub(crate) fn row_to_build(r: &rusqlite::Row<'_>) -> rusqlite::Result<BuildRow>
state,
blocked_on_json: r.get(8)?,
current_step: r.get(9)?,
- lease_owner: r.get(10)?,
- lease_expires_at: r.get(11)?,
- attempt: r.get(12)?,
- priority: r.get(13)?,
- cancel_requested: r.get::<_, i64>(14)? != 0,
- error: r.get(15)?,
+ lease_expires_at: r.get(10)?,
+ attempt: r.get(11)?,
+ cancel_requested: r.get::<_, i64>(12)? != 0,
+ error: r.get(13)?,
})
}