-
Notifications
You must be signed in to change notification settings - Fork 9
fix(taskfiles): Output unexpected errors in checksum tasks; Call gtar on macos; Add unit tests for checksum tasks (fixes #67). #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c72511e
394d45f
3b5a816
9c935f9
07b88fc
20802e7
a2ff6f4
194440e
3a92d53
c31ef24
07fd3e4
4ec6588
93a6296
5a230b9
01280e1
b6df417
882c5be
fbe8a72
8534c24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,20 +1,31 @@ | ||||||
version: "3" | ||||||
|
||||||
set: ["u", "pipefail"] | ||||||
shopt: ["globstar"] | ||||||
|
||||||
tasks: | ||||||
|
||||||
# Compute the checksum of the given path include/exclude patterns, saving the result to | ||||||
# `CHECKSUM_FILE`. The calling task can set `FAIL` to "false" if they wish to continue if checksum | ||||||
# computation fails. | ||||||
# | ||||||
# @param {string} CHECKSUM_FILE | ||||||
# @param {string[]} INCLUDE_PATTERNS Path wildcard patterns to compute the checksum for. | ||||||
# @param {string[]} [EXCLUDE_PATTERNS] Path wildcard patterns, relative to any `INCLUDE_PATTERNS`, | ||||||
# to exclude from the checksum. | ||||||
# @param {string} [FAIL="true"] If set to "false" the task will not fail. | ||||||
compute: | ||||||
desc: "Tries to compute a checksum for the given paths and output it to a file." | ||||||
internal: true | ||||||
label: "{{.TASK}}-{{.CHECKSUM_FILE}}" | ||||||
silent: true | ||||||
vars: | ||||||
EXCLUDE_PATTERNS: | ||||||
ref: "default (list) .EXCLUDE_PATTERNS" | ||||||
FAIL: "{{if eq \"false\" .FAIL}}false{{else}}true{{end}}" | ||||||
|
||||||
ARCHIVER: "{{if eq OS \"darwin\"}}gtar{{else}}tar{{end}}" | ||||||
TMP_ERR_LOG: "{{.CHECKSUM_FILE}}.log.tmp" | ||||||
requires: | ||||||
vars: ["CHECKSUM_FILE", "INCLUDE_PATTERNS"] | ||||||
vars: | ||||||
- "CHECKSUM_FILE" | ||||||
- "INCLUDE_PATTERNS" | ||||||
cmds: | ||||||
# We explicitly set `--no-anchored` and `--wildcards` to make the inclusion behaviour match | ||||||
# the default exclusion behaviour. | ||||||
|
@@ -24,58 +35,97 @@ tasks: | |||||
# input patterns cannot be quoted since they're evaluated by the shell and the results are | ||||||
# passed to `tar` as arguments. If the input patterns are passed to `tar` with quotes, the | ||||||
# pattern won't be evaluated and will instead be treated literally. | ||||||
- >- | ||||||
tar | ||||||
--create | ||||||
--file - | ||||||
--group 0 | ||||||
--mtime "UTC 1970-01-01" | ||||||
--numeric-owner | ||||||
--owner 0 | ||||||
--sort name | ||||||
--no-anchored | ||||||
--wildcards | ||||||
{{- range .EXCLUDE_PATTERNS}} | ||||||
--exclude="{{.}}" | ||||||
{{- end}} | ||||||
{{- range .INCLUDE_PATTERNS}} | ||||||
{{.}} | ||||||
{{- end}} | ||||||
2> /dev/null | ||||||
| md5sum > {{.CHECKSUM_FILE}} | ||||||
# Ignore errors so that dependent tasks don't fail | ||||||
ignore_error: true | ||||||
- defer: "rm -f '{{.TMP_ERR_LOG}}'" | ||||||
- |- | ||||||
if ! \ | ||||||
{{.ARCHIVER}} \ | ||||||
--create \ | ||||||
--file - \ | ||||||
--group 0 \ | ||||||
--mtime "UTC 1970-01-01" \ | ||||||
--numeric-owner \ | ||||||
--owner 0 \ | ||||||
--sort name \ | ||||||
--no-anchored \ | ||||||
--wildcards \ | ||||||
{{- range .EXCLUDE_PATTERNS}} | ||||||
--exclude="{{.}}" \ | ||||||
{{- end}} | ||||||
{{- range .INCLUDE_PATTERNS}} | ||||||
{{.}} \ | ||||||
{{- end}} | ||||||
2> "{{.TMP_ERR_LOG}}" \ | ||||||
| md5sum > "{{.CHECKSUM_FILE}}" \ | ||||||
; then | ||||||
rm -f "{{.CHECKSUM_FILE}}" | ||||||
{{- if eq "true" .FAIL}} | ||||||
printf "[{{.TASK}} error] failed with:\n%s\n" "$(cat {{.TMP_ERR_LOG}})" | ||||||
exit 1 | ||||||
{{- else}} | ||||||
exit 0 | ||||||
{{- end}} | ||||||
fi | ||||||
|
||||||
# Validates that the checksum computed from the given include/exclude path patterns matches the | ||||||
# reference checksum stored in the given file. If validation fails, the checksum file is deleted, | ||||||
# but the task succeeds so dependent tasks that list the checksum file under `generates` will | ||||||
# rerun automatically. The calling task can set `FAIL` to "true" to make this task fail when the | ||||||
# validation is expected to succeed. | ||||||
# | ||||||
# @param {string} CHECKSUM_FILE | ||||||
# @param {string[]} INCLUDE_PATTERNS Path wildcard patterns to validate the checksum for. | ||||||
# @param {string[]} [EXCLUDE_PATTERNS] Path wildcard patterns, relative to any `INCLUDE_PATTERNS`, | ||||||
# to exclude from the checksum. | ||||||
# @param {string} [FAIL="false"] If set to "true", the task fails when checksums mismatch. | ||||||
validate: | ||||||
desc: "Validates the checksum of the given directory matches the checksum in the given file, or | ||||||
deletes the checksum file otherwise." | ||||||
internal: true | ||||||
label: "{{.TASK}}-{{.CHECKSUM_FILE}}" | ||||||
silent: true | ||||||
vars: | ||||||
FAIL: "{{if eq \"true\" .FAIL}}true{{else}}false{{end}}" | ||||||
TMP_CHECKSUM_FILE: "{{.CHECKSUM_FILE}}.tmp" | ||||||
TMP_ERR_LOG: "{{.CHECKSUM_FILE}}.log.tmp" | ||||||
requires: | ||||||
vars: ["CHECKSUM_FILE", "INCLUDE_PATTERNS"] | ||||||
vars: | ||||||
- "CHECKSUM_FILE" | ||||||
- "INCLUDE_PATTERNS" | ||||||
cmds: | ||||||
- task: "compute" | ||||||
vars: | ||||||
CHECKSUM_FILE: "{{.TMP_CHECKSUM_FILE}}" | ||||||
INCLUDE_PATTERNS: | ||||||
ref: ".INCLUDE_PATTERNS" | ||||||
EXCLUDE_PATTERNS: | ||||||
ref: "default (list) .EXCLUDE_PATTERNS" | ||||||
CHECKSUM_FILE: "{{.TMP_CHECKSUM_FILE}}" | ||||||
- defer: "rm -f '{{.TMP_CHECKSUM_FILE}}'" | ||||||
# Check that all paths exist and the checksum matches; otherwise delete the checksum file. | ||||||
ref: ".EXCLUDE_PATTERNS" | ||||||
FAIL: "false" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Can we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, the motivation is confusing since I split the PRs. This is necessary for better checksum workflows like in boost. I'll improve the description. In this case when we validate the source directory and it fails we want to completely fail. |
||||||
- defer: |- | ||||||
rm -f "{{.TMP_CHECKSUM_FILE}}" | ||||||
rm -f "{{.TMP_ERR_LOG}}" | ||||||
- |- | ||||||
( | ||||||
{{- range .INCLUDE_PATTERNS}} | ||||||
for path in {{.}}; do | ||||||
test -e "$path" | ||||||
done | ||||||
for path in {{.}}; do | ||||||
test -e "${path}" \ | ||||||
|| ( | ||||||
echo "Include path does not exist: ${path}" > "{{$.TMP_ERR_LOG}}" | ||||||
exit 1 | ||||||
) | ||||||
done && \ | ||||||
{{- end}} | ||||||
diff -q "{{.TMP_CHECKSUM_FILE}}" "{{.CHECKSUM_FILE}}" 2> /dev/null | ||||||
) || rm -f "{{.CHECKSUM_FILE}}" | ||||||
( | ||||||
cmp -s "{{.TMP_CHECKSUM_FILE}}" "{{.CHECKSUM_FILE}}" \ | ||||||
|| ( | ||||||
echo "cmp failed for '{{.TMP_CHECKSUM_FILE}}' '{{.CHECKSUM_FILE}}'" \ | ||||||
> "{{.TMP_ERR_LOG}}" | ||||||
exit 1 | ||||||
) | ||||||
) | ||||||
) \ | ||||||
|| ( | ||||||
{{- if eq "true" .FAIL}} | ||||||
printf "[{{.TASK}} error] failed with:\n%s\n" "$(cat {{.TMP_ERR_LOG}})" | ||||||
exit 1 | ||||||
{{- else}} | ||||||
rm -f "{{.CHECKSUM_FILE}}" | ||||||
{{- end}} | ||||||
) |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,148 @@ | ||||||||||||||
version: "3" | ||||||||||||||
|
||||||||||||||
includes: | ||||||||||||||
checksum: | ||||||||||||||
internal: true | ||||||||||||||
taskfile: "../../exports/taskfiles/utils/checksum.yaml" | ||||||||||||||
|
||||||||||||||
tasks: | ||||||||||||||
default: | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we add tests for testing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with you and want to, but afaik we cannot actually test if a task fails using task itself. E.g. if We probably need to switch to using python to test tasks eventually. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right. for now we can only manually test. |
||||||||||||||
cmds: | ||||||||||||||
- task: "checksum-test-rerun" | ||||||||||||||
- task: "checksum-test-skip" | ||||||||||||||
- task: "checksum-test-update" | ||||||||||||||
|
||||||||||||||
checksum-test-rerun: | ||||||||||||||
vars: | ||||||||||||||
OUTPUT_DIR: "{{.G_OUTPUT_DIR}}/{{.TASK | replace \":\" \"#\"}}" | ||||||||||||||
SRC_DIR: "{{.OUTPUT_DIR}}/src" | ||||||||||||||
|
||||||||||||||
CHECKSUM_FILE: "{{.SRC_DIR}}.md5" | ||||||||||||||
CHECKSUM_FILE_REF: "{{.CHECKSUM_FILE}}.ref" | ||||||||||||||
FILE_0: "{{.SRC_DIR}}/0.txt" | ||||||||||||||
FILE_1: "{{.SRC_DIR}}/1.txt" | ||||||||||||||
cmds: | ||||||||||||||
- task: "checksum-test-init" | ||||||||||||||
vars: | ||||||||||||||
OUTPUT_DIR: "{{.OUTPUT_DIR}}" | ||||||||||||||
- task: "create-dir-with-checksum" | ||||||||||||||
vars: | ||||||||||||||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||||||||||||||
FILE_PATH: "{{.FILE_0}}" | ||||||||||||||
- "mv '{{.CHECKSUM_FILE}}' '{{.CHECKSUM_FILE_REF}}'" | ||||||||||||||
- task: "create-dir-with-checksum" | ||||||||||||||
vars: | ||||||||||||||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||||||||||||||
FILE_PATH: "{{.FILE_1}}" | ||||||||||||||
|
||||||||||||||
# Test create-dir-with-checksum ran the second time and created a different checksum. | ||||||||||||||
- "test ! -e '{{.FILE_0}}'" | ||||||||||||||
- "test -e '{{.FILE_1}}'" | ||||||||||||||
- |- | ||||||||||||||
if ! cmp -s '{{.CHECKSUM_FILE}}' '{{.CHECKSUM_FILE_REF}}'; then | ||||||||||||||
exit 0 | ||||||||||||||
fi | ||||||||||||||
exit 1 | ||||||||||||||
Comment on lines
+41
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The idea is that to only accept 1 as success. 0 when files are identical and >1 when file comparison has operational errors all results in failure. |
||||||||||||||
checksum-test-skip: | ||||||||||||||
vars: | ||||||||||||||
OUTPUT_DIR: "{{.G_OUTPUT_DIR}}/{{.TASK | replace \":\" \"#\"}}" | ||||||||||||||
SRC_DIR: "{{.OUTPUT_DIR}}/src" | ||||||||||||||
|
||||||||||||||
CHECKSUM_FILE: "{{.SRC_DIR}}.md5" | ||||||||||||||
CHECKSUM_MOD_TS: "{{.CHECKSUM_FILE}}-mod-ts.txt" | ||||||||||||||
FILE_0: "{{.SRC_DIR}}/0.txt" | ||||||||||||||
FILE_1: "{{.SRC_DIR}}/1.txt" | ||||||||||||||
cmds: | ||||||||||||||
- task: "checksum-test-init" | ||||||||||||||
vars: | ||||||||||||||
OUTPUT_DIR: "{{.OUTPUT_DIR}}" | ||||||||||||||
- task: "create-dir-with-checksum" | ||||||||||||||
vars: | ||||||||||||||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||||||||||||||
FILE_PATH: "{{.FILE_0}}" | ||||||||||||||
- "date -r '{{.CHECKSUM_FILE}}' > '{{.CHECKSUM_MOD_TS}}'" | ||||||||||||||
- task: "create-dir-with-checksum" | ||||||||||||||
vars: | ||||||||||||||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||||||||||||||
FILE_PATH: "{{.FILE_1}}" | ||||||||||||||
|
||||||||||||||
# Test create-dir-with-checksum didn't run the second time and the checksum is unmodified. | ||||||||||||||
- "test -e '{{.FILE_0}}'" | ||||||||||||||
- "test ! -e '{{.FILE_1}}'" | ||||||||||||||
- "cmp -s '{{.CHECKSUM_MOD_TS}}' <(date -r '{{.CHECKSUM_FILE}}')" | ||||||||||||||
|
||||||||||||||
checksum-test-update: | ||||||||||||||
vars: | ||||||||||||||
OUTPUT_DIR: "{{.G_OUTPUT_DIR}}/{{.TASK | replace \":\" \"#\"}}" | ||||||||||||||
SRC_DIR: "{{.OUTPUT_DIR}}/src" | ||||||||||||||
|
||||||||||||||
CHECKSUM_FILE: "{{.SRC_DIR}}.md5" | ||||||||||||||
CHECKSUM_FILE_REF0: "{{.CHECKSUM_FILE}}.ref0" | ||||||||||||||
CHECKSUM_FILE_REF1: "{{.CHECKSUM_FILE}}.ref1" | ||||||||||||||
FILE_0: "{{.SRC_DIR}}/0.txt" | ||||||||||||||
FILE_1: "{{.SRC_DIR}}/1.txt" | ||||||||||||||
cmds: | ||||||||||||||
- task: "checksum-test-init" | ||||||||||||||
vars: | ||||||||||||||
OUTPUT_DIR: "{{.OUTPUT_DIR}}" | ||||||||||||||
- task: "create-dir-with-checksum" | ||||||||||||||
vars: | ||||||||||||||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||||||||||||||
FILE_PATH: "{{.FILE_0}}" | ||||||||||||||
- "cp '{{.CHECKSUM_FILE}}' '{{.CHECKSUM_FILE_REF0}}'" | ||||||||||||||
|
||||||||||||||
- "cat '{{.CHECKSUM_FILE}}' > '{{.FILE_0}}'" | ||||||||||||||
- task: "checksum:compute" | ||||||||||||||
vars: | ||||||||||||||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||||||||||||||
INCLUDE_PATTERNS: ["{{.SRC_DIR}}"] | ||||||||||||||
- "cp '{{.CHECKSUM_FILE}}' '{{.CHECKSUM_FILE_REF1}}'" | ||||||||||||||
|
||||||||||||||
- task: "create-dir-with-checksum" | ||||||||||||||
vars: | ||||||||||||||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||||||||||||||
FILE_PATH: "{{.FILE_1}}" | ||||||||||||||
|
||||||||||||||
# Test create-dir-with-checksum didn't run the second time and the updated checksum is | ||||||||||||||
# different from the original. | ||||||||||||||
- "test -e '{{.FILE_0}}'" | ||||||||||||||
- "test ! -e '{{.FILE_1}}'" | ||||||||||||||
- "cmp -s '{{.FILE_0}}' '{{.CHECKSUM_FILE_REF0}}'" | ||||||||||||||
- "cmp -s '{{.CHECKSUM_FILE}}' '{{.CHECKSUM_FILE_REF1}}'" | ||||||||||||||
- |- | ||||||||||||||
if ! cmp -s '{{.CHECKSUM_FILE}}' '{{.CHECKSUM_FILE_REF0}}'; then | ||||||||||||||
exit 0 | ||||||||||||||
fi | ||||||||||||||
exit 1 | ||||||||||||||
Comment on lines
+113
to
+117
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
checksum-test-init: | ||||||||||||||
internal: true | ||||||||||||||
requires: | ||||||||||||||
vars: ["OUTPUT_DIR"] | ||||||||||||||
cmds: | ||||||||||||||
- "rm -rf '{{.OUTPUT_DIR}}'" | ||||||||||||||
- "mkdir -p '{{.OUTPUT_DIR}}'" | ||||||||||||||
|
||||||||||||||
create-dir-with-checksum: | ||||||||||||||
internal: true | ||||||||||||||
vars: | ||||||||||||||
DIR: "{{dir .FILE_PATH}}" | ||||||||||||||
requires: | ||||||||||||||
vars: ["CHECKSUM_FILE", "FILE_PATH"] | ||||||||||||||
sources: ["{{.TASKFILE}}"] | ||||||||||||||
generates: ["{{.CHECKSUM_FILE}}"] | ||||||||||||||
deps: | ||||||||||||||
- task: "checksum:validate" | ||||||||||||||
vars: | ||||||||||||||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||||||||||||||
INCLUDE_PATTERNS: ["{{.DIR}}"] | ||||||||||||||
cmds: | ||||||||||||||
- |- | ||||||||||||||
rm -rf "{{.DIR}}" | ||||||||||||||
mkdir -p "{{.DIR}}" | ||||||||||||||
touch "{{.FILE_PATH}}" | ||||||||||||||
- task: "checksum:compute" | ||||||||||||||
vars: | ||||||||||||||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||||||||||||||
INCLUDE_PATTERNS: ["{{.DIR}}"] |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2,6 +2,7 @@ version: "3" | |||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
includes: | ||||||||||||||||||||||||||||
boost: "boost/tests.yaml" | ||||||||||||||||||||||||||||
checksum: "checksum/tests.yaml" | ||||||||||||||||||||||||||||
remote: "remote/tests.yaml" | ||||||||||||||||||||||||||||
ystdlib-py: "ystdlib-py/tests.yaml" | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
@@ -10,6 +11,7 @@ tasks: | |||||||||||||||||||||||||||
internal: true | ||||||||||||||||||||||||||||
cmds: | ||||||||||||||||||||||||||||
- task: "boost" | ||||||||||||||||||||||||||||
- task: "checksum" | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainBroken task reference: calling an included Task requires a namespace or a wrapper.
Option A — add a wrapper (recommended for consistency with other entries): tasks:
all:
internal: true
cmds:
- task: "boost"
- - task: "checksum"
+ - task: "checksum"
- task: "remote"
- task: "ystdlib-py"
+ checksum:
+ cmds:
+ - task: "checksum:default" Option B — call the namespaced default directly: - - task: "checksum"
+ - task: "checksum:default" 🏁 Script executed: #!/bin/bash
# Validate that the "checksum" task is resolvable after your change.
# 1) List tasks to ensure the wrapper shows up (if using Option A).
task --list || true
# 2) Dry-run the "all" task to confirm it can reach checksum without executing commands.
task -n all Length of output: 85 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "PWD: $(pwd)"
echo
# helper to run rg if available, else grep fallback
if command -v rg >/dev/null 2>&1; then
echo "Using rg for searches"
RG_AVAIL=true
else
echo "rg not found; using grep fallback"
RG_AVAIL=false
fi
echo
echo "==> Check for taskfiles/tests.yaml"
if [ -f taskfiles/tests.yaml ]; then
echo "FOUND: taskfiles/tests.yaml (showing first 200 lines):"
nl -ba taskfiles/tests.yaml | sed -n '1,200p'
else
echo "taskfiles/tests.yaml not found at path taskfiles/tests.yaml"
fi
echo
echo "==> Search for occurrences of the word 'checksum' across the repo (context included)"
if [ "$RG_AVAIL" = true ]; then
rg -n --hidden -S '\bchecksum\b' -g '!node_modules/**' -g '!**/.git/**' -C3 || true
else
grep -RIn --line-number --exclude-dir=node_modules --exclude-dir=.git -I -n -E '\bchecksum\b' . || true
fi
echo
echo "==> Search for '- task:' entries (calls to included tasks)"
if [ "$RG_AVAIL" = true ]; then
rg -n --hidden -S '^\s*-\s*task\s*:' -g '!node_modules/**' -C3 || true
else
grep -RIn --line-number --exclude-dir=node_modules --exclude-dir=.git -I -n -E '^\s*-\s*task\s*:' . || true
fi
echo
echo "==> Search for 'checksum' task wrapper definitions (e.g. 'checksum:' or 'checksum:default')"
if [ "$RG_AVAIL" = true ]; then
rg -n --hidden -S '^\s*checksum\s*:' -g '!node_modules/**' -C3 || true
rg -n --hidden -S 'checksum:default' -g '!node_modules/**' -C3 || true
else
grep -RIn --line-number --exclude-dir=node_modules --exclude-dir=.git -I -n -E '^\s*checksum\s*:' . || true
grep -RIn --line-number --exclude-dir=node_modules --exclude-dir=.git -I -n -E 'checksum:default' . || true
fi Length of output: 179 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "PWD: $(pwd)"
echo
echo "==> List taskfiles directory"
ls -la taskfiles || true
echo
echo "==> Show taskfiles/tests.yaml (up to 400 lines) if present"
if [ -f taskfiles/tests.yaml ]; then
echo "----- taskfiles/tests.yaml start -----"
sed -n '1,400p' taskfiles/tests.yaml || true
echo "----- taskfiles/tests.yaml end -----"
else
echo "taskfiles/tests.yaml not found at taskfiles/tests.yaml"
fi
echo
echo "==> Search repository for occurrences of 'checksum' (3 lines context)"
if command -v rg >/dev/null 2>&1; then
rg -n --hidden -S '\bchecksum\b' -g '!node_modules/**' -g '!**/.git/**' -C3 || true
else
grep -RIn --line-number --exclude-dir=node_modules --exclude-dir=.git -I -n -E '\bchecksum\b' . || true
fi
echo
echo "==> Search for '- task:' entries (calls to included tasks) with context"
if command -v rg >/dev/null 2>&1; then
rg -n --hidden -S '^\s*-\s*task\s*:' -g '!node_modules/**' -C3 || true
else
grep -RIn --line-number --exclude-dir=node_modules --exclude-dir=.git -I -n -E '^\s*-\s*task\s*:' . || true
fi
echo
echo "==> Search for task wrapper/definition keys named 'checksum' or 'checksum:default'"
if command -v rg >/dev/null 2>&1; then
rg -n --hidden -S '^\s*checksum\s*:' -g '!node_modules/**' -C3 || true
rg -n --hidden -S 'checksum:default' -g '!node_modules/**' -C3 || true
else
grep -RIn --line-number --exclude-dir=node_modules --exclude-dir=.git -I -n -E '^\s*checksum\s*:' . || true
grep -RIn --line-number --exclude-dir=node_modules --exclude-dir=.git -I -n -E 'checksum:default' . || true
fi Length of output: 1913 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "PWD: $(pwd)"
echo
echo "==> Show taskfiles/checksum/tests.yaml (up to 400 lines)"
if [ -f taskfiles/checksum/tests.yaml ]; then
sed -n '1,400p' taskfiles/checksum/tests.yaml || true
else
echo "MISSING: taskfiles/checksum/tests.yaml"
fi
echo
echo "==> Show top-level keys in taskfiles/checksum/tests.yaml (yaml keys)"
if command -v python3 >/dev/null 2>&1; then
python3 - <<'PY'
import sys, yaml, pathlib
p = pathlib.Path("taskfiles/checksum/tests.yaml")
if not p.exists():
print("file not found")
sys.exit(0)
try:
data = yaml.safe_load(p.read_text())
except Exception as e:
print("yaml parse error:", e)
sys.exit(0)
if not isinstance(data, dict):
print("yaml root is not a mapping")
sys.exit(0)
for k in data.keys():
print(k)
# If there is a 'tasks' key, print its top-level task names
if 'tasks' in data and isinstance(data['tasks'], dict):
print("\nTop-level tasks in this file:")
for t in data['tasks'].keys():
print("-", t)
PY
else
echo "python3 not available; skipping YAML introspection"
fi Length of output: 4826 Fix broken task reference "checksum"
Option A — add a wrapper (consistent with other entries): tasks:
all:
internal: true
cmds:
- task: "boost"
- - task: "checksum"
+ - task: "checksum"
- task: "remote"
- task: "ystdlib-py"
+ checksum:
+ cmds:
+ - task: "checksum:default" Option B — call the namespaced default directly: - - task: "checksum"
+ - task: "checksum:default" Verified: taskfiles/checksum/tests.yaml defines a top-level "default" task. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that we should add a wrapper task to stay consistent with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Bill-hbrhbr, thank you for confirming! Adding the wrapper task will indeed maintain consistency with the existing patterns used for |
||||||||||||||||||||||||||||
- task: "remote" | ||||||||||||||||||||||||||||
- task: "ystdlib-py" | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.