diff options
author | Malfurious <m@lfurio.us> | 2023-11-20 02:59:48 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2023-11-20 05:04:57 -0500 |
commit | 05c0a659d9ac69a0e1fbd4bb243b0aafee8a475e (patch) | |
tree | 07e26c6e3b697ac5c2515d42fa94ecc5b34cf4ea /acid | |
parent | c2740abc5e7e6e7c0eee07eb34377ba15e95d93d (diff) | |
download | cychedelic-05c0a659d9ac69a0e1fbd4bb243b0aafee8a475e.tar.gz cychedelic-05c0a659d9ac69a0e1fbd4bb243b0aafee8a475e.zip |
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 <m@lfurio.us>
Diffstat (limited to 'acid')
-rwxr-xr-x | acid/acid | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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" |