Repository navigation
[Sprint] sprint-loop-35 - #31
Merged
Merged
Conversation
scealiontach
marked this pull request as ready for review
May 5, 2026 18:17
…-branch
exec::capture writes exec.log relative to CWD; in switch-to-branch the
script cd's into each visited repo before the call, which drops exec.log
into every git repo even when LOGFILE_DISABLE is absent or overridden.
Replace with an inline command substitution that captures git's error
output into the log::warn message directly and leaves no file.
Tighten the SUR-2334 bats test: raise LOG_LEVEL to WARNING (-v) so the
script's own warn message appears in $output; assert the message
specifically; add assertions that no exec.log was created in either repo.
Tighten options.bats assertions for SUR-2322: replace loose OR-condition
fallbacks with exact error string checks that match the actual log::error
messages ("Missing required option: -l", "Required option -l cannot be
empty").
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-05-05 sprint loop 35
Sprint goal
Deliver a tight slice of correctness, safety, and operator trust across the shell-scripts codebase: fix silent failure modes in git branching and Docker registry calls, bound AWS ECR scan polling so CI cannot spin forever, align
release-imageswith shared logging conventions, enforce the documented mandatory-options contract inoptions.sh, and harden PagerDuty incident submission againstxtraceleaking bearer tokens. Together these issues reduce wrong-success outcomes, improve diagnostics, and close gaps between documented CLI behavior and runtime enforcement.Selected issues
SUR-2322 — Bug:
options::add -m(mandatory) flag is decorative — never enforced-monly affects help text (options::doc/options::syntax);options::parsenever rejects missing required flags, so globals stay empty and scripts proceed with dangerous defaults (empty label selectors, cryptic${1:?}failures downstream). Fix should post-parse walkOPTIONS/OPTIONS_OPTIONAL, track whether options were seen (including parse-fn-only options), and calloptions::syntax_exitwhen required options are absent or empty-string.-l ""case).tests/options.batscovers missing mandatory flag and empty-arg cases.-mstill passmake test/ relevant bats specs (adjust tests or call sites only if required).release-imagesbats need explicit flags after enforcement tightens.SUR-2334 — Anti-pattern:
switch-to-branch -nsilently falls back to plain checkout when-bfailsNEW_BRANCH=true, failedcheckout -bfalls through to plaincheckout, hiding errors viaexec::hide. Exclusive-npath should only attempt create, log failure with visible git output (exec::capture), and not switch onto an existing branch.-npath does not fall through to existing-branch checkout on-bfailure.exec::capturepattern).tests/switch-to-branch.batscovers existing branch scenario: warns/errors appropriately and does not move HEAD to existing branch when-nwas requested.SUR-2337 — Bug:
docker::registrycmdbuilds malformedAuthorization: Basic nullwhen registry missing from~/.docker/config.jsonjq -remits literalnull; curl sendsAuthorization: Basic null. Validate token (jq default + explicit checks),log::errorwith actionable message, return non-zero; prefercurl -fsSfor HTTP failures.nullauth entry short-circuits with non-zero exit and clear log line (docker loginhint).curlfailures propagate appropriately (-fsSor equivalent agreed behavior).tests/docker.batsuses isolatedHOMEwith empty~/.docker/config.jsonand asserts failure for registry without auth.release-imagesmanual testing if desired, not blocking.SUR-2339 — Anti-pattern:
pagerduty::send_incidentdoes not silencextracearound Authorization Token headerset -x, curl command line leaks PagerDuty token. Apply{ set +x; } 2>/dev/nullpattern consistent withsecret.sh; optionally consider_incident_datafor consistency per issue.pagerduty::send_incidentdisables xtrace (or equivalent safe pattern) before token-bearing curl.tests/pagerduty.batsenablesset -x, records/mocks curl, asserts trace output does not contain token string.SUR-2340 — Bug:
aws::wait_for_scan_completeloops forever with no timeout / max attemptswhile ! aws::is_scan_completecan hang on FAILED, stuck IN_PROGRESS, or bad status. Add max attempts + sleep, fast-fail FAILED, trace logging for intermediate states, timeout error.log::error.tests/aws.batsmocks non-COMPLETE status path and asserts bounded exit (non-infinite).SUR-2344 — Anti-pattern:
release-imagesforceslog::level 2and defines no-opusage()log::level 2before parse (letoptions::standard/-vdrive verbosity); delete deadusagefunction; align with otherbash/commands.usagesymbol.-vv).usageremoved.make test_bats/tests/release-images.batsstill passes; update expectations if log volume assertions existed.release-images; otherwise parallel.Risks and mitigations
make test, add targeted bats for high-risk commands listed in SUR-2322.helpers::isolate_home, sourced libs, mocked functions).switch-to-branchintegration complexity — Multi-repo behavior hard to fully simulate; mitigations: focused bats with temp git dirs mirroring existing spec style.set -x— Trace format varies by bash version; mitigations: assert on absence of token substring only, tight mock ofcurl.Out of scope
shell-scriptsor teamSurinis.relatedTodependency grooming (not used as blockers per planning rules).manual-label workflow beyond skipping that label (none encountered this run).Linear Evidence
ce9ebfde-ff2b-4f54-90f1-c388591ca110, keySUR)a43901a0-b02b-4009-aae1-a6e8903d127d)list_issueswithproject=shell-scripts,team=Surinis,state=Backlog,limit=250,includeArchived=false; per-issueget_issue(..., includeRelations=true)forblockedBy;list_issues(parentId=<each candidate>)for sub-issues;list_comments(issueId=<each candidate>)for full comment threads.[][](OPEN_PR_FILES was[])Sub-issue status
No candidate in the reviewed Backlog set had Linear sub-issues (
list_issueswithparentIdset to each candidate returned empty). No parent was skipped for incomplete children.Linear state transitions