Repository navigation
[Sprint] sprint-loop-47 - #45
Merged
Merged
Conversation
exportRange now returns non-zero when the Java export exits non-zero or when the required output files (daml.yaml, Export.daml) are absent. The main loop gates correct_export/build on that status and the script exits non-zero overall, instead of reporting false success on missing/partial artifacts.
start_or_create_minikube documented and defaulted CNI but never passed it to minikube start, so the setting silently had no effect. Add --cni="$CNI" to both start branches so the documented, user-facing setting actually takes effect.
…r (SUR-3649) main enabled set -euo pipefail then dereferenced node2pod[$FROM_NODE] / node2pod[$TRGT_NODE] directly, so a requested node with no matching pod aborted with an opaque nounset error. Add validateNodesMapped, a testable helper that checks both keys are present and emits a clear error naming the missing node and selector, exiting non-zero before any key copy or label mutation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sprint Plan — 2026-06-08-sprint-loop-47
Sprint Goal
Harden three independent
bash/command scripts against silent or brittlefailure modes, each backed by a new Bats regression test. All three selected
issues are High-priority bugs in the
shell-scriptsproject where a commandeither reports false success, silently ignores configuration, or crashes with
an opaque
nounseterror instead of a clear validation message. The sprintdelivers small, reviewable fixes that make these scripts fail loudly and
correctly, with regression coverage so the behaviours cannot silently
regress. The work is deliberately scoped to disjoint files so the issues can
be implemented and reviewed in parallel.
Selected Issues
1. SUR-3644 — Bug: daml-export exits successfully after export command failure
bash/daml-export'sexportRange(lines ~70-100)runs
java ... export script, records the exit code, and printsREDO, butit never returns a non-zero status. The main loop (~278-287) then calls
correct_exportand schedulesbuildagainst an output directory that maylack
daml.yaml/Export.daml, and the script can still exit 0(~335-340). Audit repro:
bash/daml-export -d /tmp/daml-audit -e 0000000000000001 -h example.comwith the SDK jar absent printsmissing-file errors yet exits 0. Suggested fix: make
exportRangereturnnon-zero when the Java export fails or when required output files are
absent, and gate
correct_export/buildon that status.DAML export, letting CI jobs proceed on missing/partial artifacts — a
high-impact correctness bug. Small, self-contained fix in one command
script with a clear, stub-driven regression.
exportRangereturns non-zero when the Java export exits non-zero OR whenrequired output files (
daml.yaml,Export.daml) are absent.correct_exportorschedule
buildon failure; the script exits non-zero overall.javato fail and asserts the script exitsnon-zero and performs no correction/build step.
pre-commit run --all-files(shellcheck + shfmt) passes on the change.make test/ the new Bats spec passes locally.attachment on SUR-3644 — NOT committed under
.claude/.of SUR-3648 and SUR-3649 (disjoint files).
2. SUR-3648 — Bug: minikube-test-environment ignores the CNI setting
bash/minikube-test-environmentdefinesCNI=${CNI:-calico}(~line 7) and documentsCNIin help (~176-177), butstart_or_create_minikube(lines ~53-73) never passes it tominikube start— the command sets k8s version, driver, node count, memory, andaddons but omits any
--cniargument. Existingtests/minikube-test-environment.batsonly covers help/stop shallowly anddoes not assert create/start argv. Suggested fix: pass
--cni="$CNI"tominikube startin both start branches and add a Bats test with a stubbedminikubeasserting the generatedstartargv includes the CNI value.which is especially risky for test clusters whose network behaviour depends
on the CNI. Low-risk, localized fix that also closes a real test-coverage
gap.
start_or_create_minikubepasses the configured CNI (e.g.--cni="$CNI") tominikube startin BOTH start branches.minikube, runs thecreate/start path, andasserts the captured
startargv contains the CNI value.pre-commit run --all-files(shellcheck + shfmt) passes on the change.make test/ the Bats spec passes locally.minikube startargv) postedas a Linear comment or attachment on SUR-3648 — NOT committed under
.claude/.of SUR-3644 and SUR-3649 (disjoint files).
3. SUR-3649 — Bug: replace-validator crashes when a requested node has no matching pod
matching pod
bash/replace-validatorenablesset -euo pipefailinmain, then readsnode2pod[$FROM_NODE]/node2pod[$TRGT_NODE]directly (lines ~131-132). If the label selectoryields no pod for a requested node, Bash treats the missing
associative-array element as an unbound variable and aborts with an opaque
nounseterror rather than a clear validation message.mapPodspopulatesthe map around lines 46-58;
tests/replace-validator.batsdoes not exercisemissing-node validation. Suggested fix: validate the populated map (e.g.
${node2pod[$FROM_NODE]+set}) before dereferencing, emit a clear errornaming the missing node/selector, and exit before any key copy or label
mutation; add Bats coverage by extracting/sourcing
mainor factoring thevalidation into a testable helper.
validator keys; a typo in
-f/-t/-lor a missing pod should failcleanly BEFORE any destructive action. Replacing a brittle nounset crash
with a precise pre-flight check is a safety-critical, contained fix.
FROM_NODEandTRGT_NODEkeys innode2podbefore any dereference.node/selector and exits non-zero BEFORE any key copy or label mutation.
main).asserts the clear error + early non-zero exit (no mutation attempted).
pre-commit run --all-files(shellcheck + shfmt) passes on the change.Linear comment or attachment on SUR-3649 — NOT committed under
.claude/.of SUR-3644 and SUR-3648 (disjoint files).
Scope Preference Note
All three selected issues are small, equal-priority (High), and independent;
none were deferred for size. The sprint holds exactly 3 items, within the
1–4 cap, and was kept reviewable by choosing issues with disjoint file
footprints.
Risks + Mitigations
daml-export(SUR-3644) is hard to test end-to-end because itshells out to
javaand a real SDK jar.Mitigation: Stub
javain the Bats test (PATH shim) to force a non-zeroexit / absent output files; assert exit status and that
correct_export/buildare not invoked, rather than running a real export.exportRangereturn semantics could mask the existingREDO/retry behaviour or alter the main loop's control flow.Mitigation: Preserve the
REDOretry path; only add a terminal non-zeroreturn when retries are exhausted/required files are missing. Review the
main-loop wait/exit handling (~335-340) carefully.
(
--cnivs--network-plugin).Mitigation: Follow the issue's suggested
--cni="$CNI", but assert on theconfigured value appearing in the stubbed argv rather than hard-coding a
brittle full-string match; note any version caveat in the PR.
replace-validatormainis monolithic and may resist unittesting without refactor.
Mitigation: Factor the node-presence validation into a small helper that
can be sourced/called with a controlled
node2podmap, per the issue'ssuggestion; keep the refactor minimal to stay reviewable.
Mitigation: Run
pre-commit run --all-fileslocally before pushing and fixfindings; respect the repo's
-i 2 -cishfmt config andpackage::namenamespacing rules.
.claude/.Mitigation: Each issue explicitly forbids this; post evidence to Linear as a
comment/attachment only. Called out in IMPLEMENTATION_PLAN.md.
branch (
feature/...,fix/...,refactor/..., orsprint/...).Out of Scope
daml-export's overall export/retry architecture beyond theexit-status fix.
wiring the CNI flag.
replace-validatorbeyond what is needed to make themissing-node validation testable.
issue, or any issue carrying a
manuallabel.bash/scripts, libraries, packaging, or CI workflows.Linear Evidence
ce9ebfde-ff2b-4f54-90f1-c388591ca110,key
SUR)a43901a0-b02b-4009-aae1-a6e8903d127d) — confirmed to belong to team Surinislist_issueswithteam=Surinis,project=shell-scripts,state=7e43e7b1-8a35-4fe0-83a1-62726c462941(Backlog state UUID),
limit=100; then per-issueget_issue includeRelations=true,list_comments, andlist_issues parentId=<ID>forsub-issue checks.
empty; Filter B was a no-op)
Sub-issue Status
N/A — none of the candidate issues (SUR-3644, SUR-3648, SUR-3649) has any
sub-issues (
list_issues parentId=<ID>returned empty for all three). Noparent gate applied; no parent was skipped or deferred for active sub-issues.
Linear State Transitions
All three transitions were applied via
save_issueusing the Todo state UUID196ea437-817f-416c-8f85-f5aea570c6e8and verified in the response payloads(
status: "Todo",statusType: "unstarted").