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/http/routes/mutations.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/http/routes/mutations.rs')
| -rw-r--r-- | src/http/routes/mutations.rs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/http/routes/mutations.rs b/src/http/routes/mutations.rs index 79089b2..2af8b7f 100644 --- a/src/http/routes/mutations.rs +++ b/src/http/routes/mutations.rs @@ -37,8 +37,6 @@ pub(crate) fn review_approve(state: &State, req: &Req, id: &str) -> Res { page_to_res(ReviewsPage { page, rows: review_rows(&state.db) }, 200) } Err(ap::ApproveError::System(e)) => { - // The database refused. Telling the reviewer their review went stale - // would be a lie about the one thing they cannot check themselves. let mut page = chrome(state, req, "Review failed", "nav_reviews"); page.flash = format!("the approval could not be recorded: {e}"); page.has_flash = true; @@ -46,14 +44,10 @@ pub(crate) fn review_approve(state: &State, req: &Req, id: &str) -> Res { page_to_res(ReviewsPage { page, rows: review_rows(&state.db) }, 500) } Err(ap::ApproveError::Stale(stale)) => { - // §7.1a: refuse, re-render what it is now, and say why. Never - // silently retarget the approval onto the newer state. let mut page = chrome(state, req, "Review changed", "nav_reviews"); page.flash = format!("refused: {stale}"); page.has_flash = true; page.flash_err = true; - // Show the review as it stands NOW — the frozen one the form came - // from may have collapsed or been superseded while it was open. let current = candidates::pending_candidates(db) .unwrap_or_default() .into_iter() @@ -109,8 +103,6 @@ pub(crate) fn review_reject(state: &State, req: &Req, id: &str) -> Res { } } -/// Bulk approve/reject (§7.4): per-item, never "approve everything forever", -/// and high-risk items are refused unless each was confirmed individually. pub(crate) fn reviews_bulk(state: &State, req: &Req) -> Res { let db = &state.db; let form = req.form(); @@ -136,8 +128,6 @@ pub(crate) fn reviews_bulk(state: &State, req: &Req) -> Res { page.flash_err = true; return page_to_res(ReviewsPage { page, rows: review_rows(&state.db) }, 400); } - // The rule itself lives in `review::approve::bulk`, so the page and the - // library cannot disagree about what a bulk decision means (§7.4). let items: Vec<(i64, String, String)> = ids .iter() .filter_map(|id| { @@ -200,9 +190,6 @@ pub(crate) fn sub_pause(state: &State, req: &Req) -> Res { let db = &state.db; let name = req.form_get("pkgbase").unwrap_or_default(); let cur = db::get_subscription(db, &name).ok().flatten().map(|s| s.state); - // Pause and resume are the only moves this page makes. A subscription that - // is orphaned or removed is not the reviewer's to pause, and saying so beats - // quietly rewriting its state. let next = match cur { Some(SubscriptionState::Active) => SubscriptionState::Paused, Some(SubscriptionState::Paused) => SubscriptionState::Active, @@ -223,8 +210,6 @@ pub(crate) fn sub_remove(state: &State, req: &Req) -> Res { pub(crate) fn notice_ack(state: &State, req: &Req) -> Res { let id: i64 = req.form_get("id").and_then(|s| s.parse().ok()).unwrap_or(0); let _ = db::acknowledge_notice(&state.db.writer, id); - // POST-redirect-GET: the notice vanishing from the list is its own - // confirmation, and a refresh can no longer re-POST. Res::redirect("/attention") } @@ -270,8 +255,6 @@ pub(crate) fn build_cancel(state: &State, req: &Req, id: &str) -> Res { builds_with(state, req, page) } -/// Retrying a failed build is an explicit, audited decision (§8.4), not -/// something the system does to itself. pub(crate) fn build_retry(state: &State, req: &Req, id: &str) -> Res { match builds::retry(&state.db, id) { Ok(()) => { |
