Skip to content

Put the Managed Bin Directory on install-tools.sh's Own PATH When the Caller Omits It - #2588

Merged
ptr727 merged 2 commits into
developfrom
feature/wsl-2257
Oct 8, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/wsl-2257

Conversation

@ptr727

@ptr727 ptr727 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

install-tools.sh now puts its own $BIN_DIR (/usr/local/bin) first on PATH at the start of main when the caller's PATH leaves it out, so a cron-style PATH=/usr/bin:/bin reads the managed jq, uv and git-restore-mtime instead of calling them missing or adding a false shadow note. A PATH that already names $BIN_DIR keeps its order, so a copy genuinely ahead of it is still reported as a shadow. Prepending (not appending) makes the managed copy win, which matches the script's own stated intent.

Tests: four-plus unit tests in tests/test_install_tools.py cover the prepend, an empty PATH, an unchanged PATH with a real shadow still reported, an equivalent spelling of the directory, no false shadow on a minimal PATH, and main calling the function.

Host evidence (WSL2 Debian 13):

$ env -i PATH=/usr/bin:/bin host-setup/linux/install-tools.sh --report jq uv git-restore-mtime
jq                 1.8.2    1.8.2    jqlang/jq             current
git-restore-mtime  2025.08  2025.08  MestreLion/git-tools  current
uv                 0.12.21  0.12.24  astral-sh/uv          outdated

--report --json returns the same installed versions with empty notes. Shellcheck clean, ruff clean, python3 -m unittest tests.test_install_tools OK.

Closes on promotion: #2257

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 8, 2026 14:28
… Caller Omits It

Under a cron-style PATH of /usr/bin:/bin the report called managed jq, uv and
git-restore-mtime missing or read the distro jq and added a false shadow note.
The script now prepends its bin directory when the caller's PATH lacks it, and
leaves a PATH that names it alone so a real shadow is still reported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Oct 8, 2026
Copilot AI lite review requested due to automatic review settings October 8, 2026 21:31
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Oct 8, 2026
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 849beddb-b485-425c-8387-b98cc017ea02
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.85%. Comparing base (1ff98e3) to head (e81b525).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2588   +/-   ##
========================================
  Coverage    58.85%   58.85%           
========================================
  Files           16       16           
  Lines         8181     8181           
========================================
  Hits          4815     4815           
  Misses        3366     3366           
Flag Coverage Δ
python-3.13 58.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Only a minor documentation nit remains; no blocking issues were identified.

0 open findings

What changed in this PR

Updates the Linux installer to prepend /usr/local/bin when absent, ensuring managed tools resolve correctly under minimal PATH values.

Changes:

  • Adds PATH normalization and integration in main.
  • Adds tests for PATH handling, shadow detection, and reporting.
  • Retains one P2 documentation nit regarding redundant function comments.
File Reviewed changes
tests/​test_install_tools.py Tests PATH normalization, shadow handling, and main integration.
host-setup/​linux/​install-tools.sh Adds managed-bin PATH handling; contains a P2 documentation nit about redundant comments.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727
ptr727 merged commit f89a790 into develop Oct 8, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/wsl-2257 branch October 8, 2026 21:39
ptr727 added a commit that referenced this pull request Oct 8, 2026
…, Table Carry Test (#2591)

## Summary

Promotes develop to main, carrying:

- #2588 Put the Managed Bin Directory on install-tools.sh's Own PATH
When the Caller Omits It
- #2589 Run bootstrap.sh's Whole Main Flow Against a Stub Download and
Stub Tools
- #2586 Pin the Table Carry Onto a Second-Format Lite Round That Finds
Nothing
- #2593 Assert the Lite Table-Carry Test's Own Premise

Fixes #2257
Fixes #1767
Fixes #2282

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants