summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2023-11-20 02:59:48 -0500
committerMalfurious <m@lfurio.us>2023-11-20 05:04:57 -0500
commit05c0a659d9ac69a0e1fbd4bb243b0aafee8a475e (patch)
tree07e26c6e3b697ac5c2515d42fa94ecc5b34cf4ea
parentc2740abc5e7e6e7c0eee07eb34377ba15e95d93d (diff)
downloadcychedelic-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>
-rwxr-xr-xacid/acid3
1 files changed, 1 insertions, 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"