summaryrefslogtreecommitdiffstats
path: root/src/http/routes/pages.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-19 17:33:17 +0000
committeraur-build <aur-build@localhost>2026-11-19 17:33:17 +0000
commit4304b0f336ddba7b4ec6780795059ff2066d105b (patch)
tree10edea744a1c2bf3fc363b4dc7f64abac8b1a0d3 /src/http/routes/pages.rs
parente757979f1a2afdbe7146066345bb9acd19d3b151 (diff)
downloadaur-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/http/routes/pages.rs')
-rw-r--r--src/http/routes/pages.rs21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/http/routes/pages.rs b/src/http/routes/pages.rs
index f1f3ef8..bb5db34 100644
--- a/src/http/routes/pages.rs
+++ b/src/http/routes/pages.rs
@@ -56,7 +56,6 @@ pub(crate) fn review_rows(db: &Db) -> Vec<ReviewRow> {
revision: c.revision,
})
.collect();
- // Risk first, then oldest — the scarcest resource gets the loudest rows.
let rank = |r: &str| match r {
risk::level::HIGH => 0,
risk::level::MEDIUM => 1,
@@ -83,8 +82,6 @@ pub(crate) fn review_detail(state: &State, req: &Req, id: &str) -> Res {
let Some(c) = candidates::candidate_by_id(db, id).unwrap_or(None) else {
return not_found(state, req);
};
- // Opening a review freezes it: a later detection now opens a fresh review
- // instead of silently changing what is on screen (§7.1).
let _ = candidates::mark_viewed(db, id);
let page = chrome(state, req, &format!("Review {}", c.pkgbase), "nav_reviews");
let (head, panels, recipe, srcinfo, sources_resolved, deps_resolved) = review_body(state, &c);
@@ -113,7 +110,6 @@ pub(crate) fn panels_base(c: &CandidateRow) -> (String, bool) {
}
}
-/// Build the review body: the panel set plus the first-introduction material.
pub(crate) fn review_body(
state: &State,
c: &CandidateRow,
@@ -224,7 +220,6 @@ pub(crate) fn attention(state: &State, req: &Req) -> Res {
.into_iter()
.map(|(id, pkgbase, blocked_on)| BlockedRow { id_short: short(&id), id, pkgbase, blocked_on })
.collect();
- // Staleness is computed on read (P4 fills the query in).
let stale = crate::watch::staleness::stale_rows(db).unwrap_or_default();
let outdated: Vec<StaleRow> = stale
.iter()
@@ -322,8 +317,6 @@ pub(crate) fn package_detail(state: &State, req: &Req, name: &str) -> Res {
step: b.current_step.unwrap_or_default(),
})
.collect();
- // Depends-on comes from the recipe we actually serve; needed-by comes from
- // the packages whose own recipes name this one (§10.3).
let deps_in: Vec<String> = accepted
.as_ref()
.and_then(|r| db::accepted_recipe(db, r).ok().flatten())
@@ -375,8 +368,6 @@ pub(crate) fn package_detail(state: &State, req: &Req, name: &str) -> Res {
// --------------------------------------------------------------- builds --
-/// The version a build is about. A build points at a candidate, or — for a
-/// manual rebuild of something already published — at a release.
pub(crate) fn build_version(db: &Db, b: &builds::BuildRow) -> String {
if let Some(cid) = b.candidate_id {
if let Some(c) = candidates::candidate_by_id(db, cid).ok().flatten() {
@@ -424,8 +415,6 @@ pub(crate) fn build_rows(state: &State) -> Vec<BuildRow> {
pub(crate) fn builds_page(state: &State, req: &Req) -> Res {
let page = chrome(state, req, "Builds", "nav_builds");
- // htmx asks for the fragment; a browser with JavaScript off never does and
- // gets the whole page either way (§13).
if req.query_get("fragment").as_deref() == Some("1") {
return page_to_res(
BuildsTable { page, rows: build_rows(state), recent: recent_rows(state) },
@@ -514,17 +503,12 @@ pub(crate) fn build_log(state: &State, id: &str) -> Res {
Res::text(200, body)
}
-/// The live tail (§13). Server-sent events from a blocking reader: the pipeline
-/// appends to a file and never learns this connection exists, so a viewer that
-/// hangs up, stalls or never shows up cannot slow a build.
pub(crate) fn build_log_stream(state: &State, req: &Req, id: &str) -> Res {
if builds::get(&state.db, id).unwrap_or(None).is_none() {
return not_found(state, req);
}
let tail = sse::LogTail::new(&state.cfg, state.db.clone(), id);
let mut res = Res::stream("text/event-stream", tail, None);
- // No caching, and no proxy buffering: a buffered event stream is a log tail
- // that arrives all at once, which is the thing we are trying to avoid.
res.header("Cache-Control", "no-cache");
res.header("X-Accel-Buffering", "no");
res
@@ -550,11 +534,6 @@ pub(crate) fn audit(state: &State, req: &Req) -> Res {
page_to_res(Audit { page, rows }, 200)
}
-/// `GET /metrics` in Prometheus text exposition format (§12, §15).
-///
-/// Everything here is computed from live state on every scrape. There are no counters
-/// incremented at event sites: a counter every code path has to maintain quietly
-/// drifts the first time a path is added; a query cannot drift.
pub fn metrics(state: &State) -> Res {
match ops::metrics(&state.cfg, &state.db) {
Ok(m) => {