351ed2fc24a13b86cf2a1fc9695309e2c0da9de5
lrnassar
  Wed Jun 3 09:33:28 2026 -0700
Make otto fetch failures loud and clinGen silent on no-update. refs #37697

Several otto jobs used 'wget -q'/'curl -s' under 'set -e', so a broken download
aborted with no output and cron (which mails on output, not exit code) sent nothing
-- the mode by which mastermind failed silently for months.

- mastermind, malacards: add an ERR trap that echoes a failure message; switch
mastermind's 'curl -s' to 'curl -sf' so an HTTP error fails loudly instead of
writing a challenge page into the release file.
- geneReviews: add an ERR trap (kept silent on no-update via the wrapper's mail -E).
- All three use 'set -eE' (errtrace) so the ERR trap also fires for failures inside
functions/subshells, not just top-level commands.
- clinGen: capture each sub-build's exit status instead of swallowing it under
'set +e', and report which sub-build failed. Also drop the routine 'No ... update'
echoes and the unconditional 'ClinGen update done.' line, and switch the wrapper to
'mail -E', so clinGen is now silent on no-update and only emails on a real update
or a failure.

diff --git src/hg/utils/otto/clinGen/makeGeneValidity.sh src/hg/utils/otto/clinGen/makeGeneValidity.sh
index 5d8318da8c5..96e19af8d68 100755
--- src/hg/utils/otto/clinGen/makeGeneValidity.sh
+++ src/hg/utils/otto/clinGen/makeGeneValidity.sh
@@ -1,48 +1,46 @@
 #!/bin/bash
 
 # downloads and builds the ClinGen Gene Validity track
 # assumes running in the build directory:
 # /hive/data/outside/otto/clinGen/
 set -beEu -o pipefail
 
 WORKDIR=$1
 mkdir -p ${WORKDIR}/clinGenGeneValidity
 cd ${WORKDIR}/clinGenGeneValidity
 
 # the release directory, where gbdb symlinks will point
 if [ ! -d release ]; then
     mkdir -p ${WORKDIR}/release/{hg19,hg38}
 fi
 
 echo "user anonymous
 ls hg*ClinGenBigBed.bb
 bye" > ftp.geneDiseaseValidity.cmds
 
 if [ -e release.list ]
 then
     mv release.list prev.release.list
 fi
 touch prev.release.list
 rm -f release.list
 
 # connect and list a directory, result to file: ls.check
 ftp -n -v -i ftp.clinicalgenome.org 2>&1 < ftp.geneDiseaseValidity.cmds &> ls.check
 grep "hg.*ClinGenBigBed.bb" ls.check | sort > release.list || echo "Error - no bigBed files found"
 
 # see if anything is changing, if so, notify, download, and build
 diff prev.release.list release.list > release.diff || true
 count=`wc -l release.diff | cut -d' ' -f1`
 if [ "${count}" -gt 1 ]; then
     printf "New ClinGen Gene-Disease tracks\n"
     today=`date +%F`
     mkdir -p $today
     cd $today
     wget -N -q "ftp://ftp.clinicalgenome.org/hg19ClinGenBigBed.bb"
     wget -N -q "ftp://ftp.clinicalgenome.org/hg38ClinGenBigBed.bb"
     cp hg19ClinGenBigBed.bb ${WORKDIR}/release/hg19/clinGenGeneDisease.bb
     cp hg38ClinGenBigBed.bb ${WORKDIR}/release/hg38/clinGenGeneDisease.bb
     cd ..
     echo "ClinGen Gene-Disease update done: `date`"
-else
-    echo "No update"
 fi