Normalize shared shell helpers in finance scripts - #34
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VM2WVZz7NxE541SaTwt2wg
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.
Summary
usage()andcheck_commands()inrun.shanddeploy.shto the same shared contract used elsewhere:check_commands()inspects the command names given in"$@", exiting127when a command cannot be resolved and126when the resolved path is not executable;usage()callscheck_commands awkbefore extracting the header block and exits0.$CHARTS/$SUMMARY/$NOTIFYexecutable checks out ofrun.sh'scheck_commands()into a separatecheck_pipeline_commands(), preserving the existing status1, error message, and pip install guidance.main()now callsload_environment,check_pipeline_commands,check_commands date,check_credential,check_environment, in that order.deploy.sh'smain()now callscheck_commands "$PYTHON" sudo installinstead of a fixed internal list.doc/POLICY.mdrules under2.6 Shell Scriptsstating that a shared helper name is an interface (same arguments/exit statuses/side effects/implementation), that repository-specific behavior belongs at the call site or in a differently named helper, and documenting thecheck_commands()/usage()contracts.doc/VERSIONS' unreleasedv1.0.2 (Release Date: TBD)entry with a bullet describing the normalized127/126command-check statuses.Exit CodesandVersion History(v1.1) headers in bothrun.shanddeploy.sh.Validation
sh -n run.sh,sh -n deploy.sh): PASSusage()/check_commands()match the specified common implementation in both scripts): PASSrun.sh -h,run.sh --help,deploy.sh -h,deploy.sh --help): PASS (header shown, status 0, no pipeline/deployment body executed)awksmoke test (controlledPATHwithoutawk): PASS (status 127, common missing-command message, no header shown, no further processing)run.shpipeline-command failure preservation (one of$CHARTS/$SUMMARY/$NOTIFYnon-executable): PASS (status 1, existingCommand not foundmessage and pip install guidance preserved)run.shmissingdate(pipeline commands present,dateunresolvable): PASS (status 127, common missing-command message, pipeline checks passed first)deploy.shnon-executable$PYTHON: PASS (status 126, common non-executable message, no deployment side effects)pytest: PASS (513 passed, 2 deselected)ruff check .: PASS (all checks passed)git diff --check): PASS (no errors); changed files limited torun.sh,deploy.sh,doc/POLICY.md,doc/VERSIONS🤖 Generated with Claude Code
https://claude.ai/code/session_01VM2WVZz7NxE541SaTwt2wg
Generated by Claude Code