add status checks #18
Annotations
2 errors and 11 warnings
reviewdog: Too many results (annotations) in diff.
You may miss some annotations due to GitHub limitation for annotation created by logging command.
Please check GitHub Actions log console to see all results.
Limitation:
- 10 warning annotations and 10 error annotations per step
- 50 annotations per job (sum of annotations from all the steps)
- 50 annotations per run (separate from the job annotations, these annotations aren't created by users)
Source: https://github.com/orgs/community/discussions/26680#discussioncomment-3252835
|
|
zfs-replicate.sh#L12
[shfmt] reported by reviewdog 🐶
Raw Output:
zfs-replicate.sh:12:- ## declare log array
zfs-replicate.sh:13:- declare -a logs=()
zfs-replicate.sh:14:- ## initialize index
zfs-replicate.sh:12:+ ## declare log array
zfs-replicate.sh:13:+ declare -a logs=()
zfs-replicate.sh:14:+ ## initialize index
zfs-replicate.sh:15:+ local index=0
zfs-replicate.sh:16:+ ## find existing logs
zfs-replicate.sh:17:+ for log in $(${FIND} ${LOGBASE} -maxdepth 1 -type f -name autorep-\*); do
zfs-replicate.sh:18:+ ## get file change time via stat (platform specific)
zfs-replicate.sh:19:+ case "$(uname -s)" in
zfs-replicate.sh:20:+ Linux | SunOS)
zfs-replicate.sh:21:+ local fstat=$(stat -c %Z ${log})
zfs-replicate.sh:22:+ ;;
zfs-replicate.sh:23:+ *)
zfs-replicate.sh:24:+ local fstat=$(stat -f %c ${log})
zfs-replicate.sh:25:+ ;;
zfs-replicate.sh:26:+ esac
zfs-replicate.sh:27:+ ## append logs to array with creation time
zfs-replicate.sh:28:+ logs[$index]="${fstat}\t${log}\n"
zfs-replicate.sh:29:+ ## increase index
zfs-replicate.sh:30:+ let "index += 1"
zfs-replicate.sh:31:+ done
zfs-replicate.sh:32:+ ## set log count
zfs-replicate.sh:33:+ local lcount=${#logs[@]}
zfs-replicate.sh:34:+ ## check count ... if greater than keep loop and delete
zfs-replicate.sh:35:+ if [ $lcount -gt ${LOG_KEEP} ]; then
zfs-replicate.sh:36:+ ## build new array in descending age order and reset index
zfs-replicate.sh:37:+ declare -a slogs=()
|
zfs-replicate.sh#L16
[shfmt] reported by reviewdog 🐶
Raw Output:
zfs-replicate.sh:16:- ## find existing logs
zfs-replicate.sh:17:- for log in $(${FIND} ${LOGBASE} -maxdepth 1 -type f -name autorep-\*); do
zfs-replicate.sh:18:- ## get file change time via stat (platform specific)
zfs-replicate.sh:19:- case "$(uname -s)" in
zfs-replicate.sh:20:- Linux|SunOS)
zfs-replicate.sh:21:- local fstat=$(stat -c %Z ${log})
zfs-replicate.sh:22:- ;;
zfs-replicate.sh:23:- *)
zfs-replicate.sh:24:- local fstat=$(stat -f %c ${log})
zfs-replicate.sh:25:- ;;
zfs-replicate.sh:26:- esac
zfs-replicate.sh:27:- ## append logs to array with creation time
zfs-replicate.sh:28:- logs[$index]="${fstat}\t${log}\n"
zfs-replicate.sh:29:- ## increase index
zfs-replicate.sh:30:- let "index += 1"
zfs-replicate.sh:39:+ ## loop through existing array
zfs-replicate.sh:40:+ for log in $(echo -e ${logs[@]:0} | sort -rn | cut -f2); do
zfs-replicate.sh:41:+ ## append log to array
zfs-replicate.sh:42:+ slogs[$index]=${log}
zfs-replicate.sh:43:+ ## increase index
zfs-replicate.sh:44:+ let "index += 1"
|
zfs-replicate.sh#L32
[shfmt] reported by reviewdog 🐶
Raw Output:
zfs-replicate.sh:32:- ## set log count
zfs-replicate.sh:33:- local lcount=${#logs[@]}
zfs-replicate.sh:34:- ## check count ... if greater than keep loop and delete
zfs-replicate.sh:35:- if [ $lcount -gt ${LOG_KEEP} ]; then
zfs-replicate.sh:36:- ## build new array in descending age order and reset index
zfs-replicate.sh:37:- declare -a slogs=(); local index=0
zfs-replicate.sh:38:- ## loop through existing array
zfs-replicate.sh:39:- for log in $(echo -e ${logs[@]:0} | sort -rn | cut -f2); do
zfs-replicate.sh:40:- ## append log to array
zfs-replicate.sh:41:- slogs[$index]=${log}
zfs-replicate.sh:42:- ## increase index
zfs-replicate.sh:43:- let "index += 1"
zfs-replicate.sh:44:- done
zfs-replicate.sh:45:- ## delete excess logs
zfs-replicate.sh:46:- printf "deleting old logs: %s ...\n" "${slogs[@]:${LOG_KEEP}}"
zfs-replicate.sh:47:- rm -rf ${slogs[@]:${LOG_KEEP}}
zfs-replicate.sh:48:- fi
zfs-replicate.sh:46:+ ## delete excess logs
zfs-replicate.sh:47:+ printf "deleting old logs: %s ...\n" "${slogs[@]:${LOG_KEEP}}"
zfs-replicate.sh:48:+ rm -rf ${slogs[@]:${LOG_KEEP}}
zfs-replicate.sh:49:+ fi
|
zfs-replicate.sh#L53
[shfmt] reported by reviewdog 🐶
Raw Output:
zfs-replicate.sh:53:- ## print errors
zfs-replicate.sh:54:- if [ "${1}x" != "x" ] && [ ${1} != 0 ]; then
zfs-replicate.sh:55:- printf "Last operation returned error code: %s\n" "${1}"
zfs-replicate.sh:56:- fi
zfs-replicate.sh:57:- ## check log files
zfs-replicate.sh:58:- check_old_log
zfs-replicate.sh:59:- ## always exit 0
zfs-replicate.sh:60:- printf "Exiting...\n"
zfs-replicate.sh:61:- exit 0
zfs-replicate.sh:54:+ ## print errors
zfs-replicate.sh:55:+ if [ "${1}x" != "x" ] && [ ${1} != 0 ]; then
zfs-replicate.sh:56:+ printf "Last operation returned error code: %s\n" "${1}"
zfs-replicate.sh:57:+ fi
zfs-replicate.sh:58:+ ## check log files
zfs-replicate.sh:59:+ check_old_log
zfs-replicate.sh:60:+ ## always exit 0
zfs-replicate.sh:61:+ printf "Exiting...\n"
zfs-replicate.sh:62:+ exit 0
|
zfs-replicate.sh#L65
[shfmt] reported by reviewdog 🐶
Raw Output:
zfs-replicate.sh:65:-check_lock () {
zfs-replicate.sh:66:- ## check our lockfile status
zfs-replicate.sh:67:- if [ -f "${1}" ]; then
zfs-replicate.sh:68:- ## get lockfile contents
zfs-replicate.sh:69:- local lpid=$(cat "${1}")
zfs-replicate.sh:70:- ## see if this pid is still running
zfs-replicate.sh:71:- local ps=$(ps auxww|grep $lpid|grep -v grep)
zfs-replicate.sh:72:- if [ "${ps}x" != 'x' ]; then
zfs-replicate.sh:73:- ## looks like it's still running
zfs-replicate.sh:74:- printf "ERROR: This script is already running as: %s\n" "${ps}"
zfs-replicate.sh:75:- else
zfs-replicate.sh:76:- ## well the lockfile is there...stale?
zfs-replicate.sh:77:- printf "ERROR: Lockfile exists: %s\n" "${1}"
zfs-replicate.sh:78:- printf "However, the contents do not match any "
zfs-replicate.sh:79:- printf "currently running process...stale lockfile?\n"
zfs-replicate.sh:80:- fi
zfs-replicate.sh:81:- ## tell em what to do...
zfs-replicate.sh:82:- printf "To run script please delete: %s\n" "${1}"
zfs-replicate.sh:83:- ## compress log and exit...
zfs-replicate.sh:84:- exit_clean
zfs-replicate.sh:66:+check_lock() {
zfs-replicate.sh:67:+ ## check our lockfile status
zfs-replicate.sh:68:+ if [ -f "${1}" ]; then
zfs-replicate.sh:69:+ ## get lockfile contents
zfs-replicate.sh:70:+ local lpid=$(cat "${1}")
zfs-replicate.sh:71:+ ## see if this pid is still running
zfs-replicate.sh:72:+ local ps=$(ps auxww | grep $lpid | grep -v grep)
zfs-replicate.sh:73:+ if [ "${ps}x" != 'x' ]; then
zfs-replicate.sh:74:+ ## looks like it's still running
zfs-replicate.sh:75:+ printf "ERROR: This script is already running as: %s\n" "${ps}"
|
zfs-replicate.sh#L86
[shfmt] reported by reviewdog 🐶
Raw Output:
zfs-replicate.sh:86:- ## well no lockfile..let's make a new one
zfs-replicate.sh:87:- printf "Creating lockfile: %s\n" "${1}"
zfs-replicate.sh:88:- echo $$ > "${1}"
zfs-replicate.sh:77:+ ## well the lockfile is there...stale?
zfs-replicate.sh:78:+ printf "ERROR: Lockfile exists: %s\n" "${1}"
zfs-replicate.sh:79:+ printf "However, the contents do not match any "
zfs-replicate.sh:80:+ printf "currently running process...stale lockfile?\n"
|
zfs-replicate.sh#L90
[shfmt] reported by reviewdog 🐶
Raw Output:
zfs-replicate.sh:82:+ ## tell em what to do...
zfs-replicate.sh:83:+ printf "To run script please delete: %s\n" "${1}"
zfs-replicate.sh:84:+ ## compress log and exit...
zfs-replicate.sh:85:+ exit_clean
zfs-replicate.sh:86:+ else
zfs-replicate.sh:87:+ ## well no lockfile..let's make a new one
zfs-replicate.sh:88:+ printf "Creating lockfile: %s\n" "${1}"
zfs-replicate.sh:89:+ echo $$ > "${1}"
zfs-replicate.sh:90:+ fi
|
zfs-replicate.sh#L94
[shfmt] reported by reviewdog 🐶
Raw Output:
zfs-replicate.sh:94:- ## delete lockfiles...and that's all we do here
zfs-replicate.sh:95:- if [ -f "${1}" ]; then
zfs-replicate.sh:96:- printf "Deleting lockfile: %s\n" "${1}"
zfs-replicate.sh:97:- rm "${1}"
zfs-replicate.sh:98:- fi
zfs-replicate.sh:95:+ ## delete lockfiles...and that's all we do here
zfs-replicate.sh:96:+ if [ -f "${1}" ]; then
zfs-replicate.sh:97:+ printf "Deleting lockfile: %s\n" "${1}"
zfs-replicate.sh:98:+ rm "${1}"
zfs-replicate.sh:99:+ fi
|
zfs-replicate.sh#L103
[shfmt] reported by reviewdog 🐶
Raw Output:
zfs-replicate.sh:103:- ## do we have a remote check defined
zfs-replicate.sh:104:- if [ "${REMOTE_CHECK}x" != 'x' ]; then
zfs-replicate.sh:105:- ## run the check
zfs-replicate.sh:106:- $REMOTE_CHECK > /dev/null 2>&1
zfs-replicate.sh:107:- ## exit if above returned non-zero
zfs-replicate.sh:108:- if [ $? != 0 ]; then
zfs-replicate.sh:109:- printf "ERROR: Remote health check '%s' failed!\n" "${REMOTE_CHECK}"
zfs-replicate.sh:110:- exit_clean
zfs-replicate.sh:111:- fi
zfs-replicate.sh:104:+ ## do we have a remote check defined
zfs-replicate.sh:105:+ if [ "${REMOTE_CHECK}x" != 'x' ]; then
zfs-replicate.sh:106:+ ## run the check
zfs-replicate.sh:107:+ $REMOTE_CHECK > /dev/null 2>&1
zfs-replicate.sh:108:+ ## exit if above returned non-zero
zfs-replicate.sh:109:+ if [ $? != 0 ]; then
zfs-replicate.sh:110:+ printf "ERROR: Remote health check '%s' failed!\n" "${REMOTE_CHECK}"
zfs-replicate.sh:111:+ exit_clean
|
zfs-replicate.sh#L113
[shfmt] reported by reviewdog 🐶
Raw Output:
zfs-replicate.sh:113:+ fi
|
|
This job failed
Loading