From 05c0a659d9ac69a0e1fbd4bb243b0aafee8a475e Mon Sep 17 00:00:00 2001 From: Malfurious Date: Mon, 20 Nov 2023 02:59:48 -0500 Subject: acid: Base job reason strictly on source updates I find the previous logic to be a little unhelpful. Every job executing in a batch was classified based on whether we were in the middle of maintenance or not. Therefore even a service with actual new updates would get serviced via a "maint" build job. Now, reasons are determined on a per-job basis. We consider a job event-triggered if there are new sources (acid-source returns 1). This allows for a mix of reason types in a batch of jobs that more accurately reflects the state of sources while doing work. This also means that any source errors result in the job being considered "maint". Below is the effective truth table for determining job reason. acid-source result forcing builds not forcing -------------------------------------------------------- 0 (no action) maint -- 1 (new files) event event 2 (error) maint maint Signed-off-by: Malfurious --- acid/acid | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/acid/acid b/acid/acid index 9b01fb5..a134d34 100755 --- a/acid/acid +++ b/acid/acid @@ -45,14 +45,13 @@ update() { forceopt="--force-self" selfopt="--self" - [ -z "$1" ] && reason="event" || reason="maint" - for line in "${CYCHE_SERVICES[@]}"; do read -r -a arr <<< "$line" hash=$(acid-source ${arr[@]:0:3} 2>"$CYCHE_TMP_LOG") res=$? if [ $res -ne 0 ] || [ "$1" == "$forceopt" ]; then + [ $res -eq 1 ] && reason="event" || reason="maint" job=$(make_log "$hash" "$reason" "${arr[0]}") logdir="$CYCHE_LOG_DIR/$job" log="$logdir/log" -- cgit v1.2.3