Skip to content

fix(bash): link executed scripts across files#1778

Draft
balloon72 wants to merge 1 commit into
Graphify-Labs:v8from
balloon72:codex/bash-script-invocations
Draft

fix(bash): link executed scripts across files#1778
balloon72 wants to merge 1 commit into
Graphify-Labs:v8from
balloon72:codex/bash-script-invocations

Conversation

@balloon72

Copy link
Copy Markdown
Contributor

Summary

Link Bash scripts that execute sibling scripts directly or through a common shell runner.

Root cause

The Bash extractor only treated source and . as cross-file commands. Direct ./script.sh calls and commands such as bash ./script.sh were ignored, leaving script call topology disconnected.

Changes

  • Emit extracted calls edges from the current entrypoint or function to the target script entrypoint.
  • Resolve literal .sh paths for direct execution and bash, sh, zsh, ksh, and dash runners.
  • Skip dynamic, missing, and user-function-shadowed invocations.
  • Cover absolute and relative inputs with regression tests.

Validation

  • python -m pytest tests/test_extract.py -k "script_invocation" -q (6 passed)
  • python -m pytest tests/test_extract.py -q -k "not collect_files_follows_symlinked_directory and not collect_files_skips_out_of_root_symlinked_directory and not collect_files_skips_out_of_root_symlinked_file_by_default and not collect_files_handles_circular_symlinks" (119 passed, 1 skipped)
  • python -m py_compile graphify/extractors/bash.py tests/test_extract.py
  • python -m graphify update .
  • git diff --check origin/v8...HEAD

The full local suite was attempted but could not complete because Windows Store Python repeatedly crashed in existing ProcessPoolExecutor pipeline tests. GitHub CI remains the full-suite check.

Fixes #1756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bash extractor: bash x.sh and ./x.sh produce no cross-file edge (only source/. do)

1 participant