Skip to content

Conversation

@chicks-net
Copy link
Member

@chicks-net chicks-net commented Dec 11, 2025

Done

  • 🥯 [just] v4.2: script for installing pre-requisites
  • cover v4.2 in release notes and fix headings for November/December
  • include link to pull request
  • check for success of brew install
  • allow claude to access its own code reviews

Meta

(Automated in .just/gh-process.just.)

Copilot AI review requested due to automatic review settings December 11, 2025 00:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new prerequisite installation script for the just command runner, versioned as v4.2. The script automates the detection and installation of development tools required for just recipes.

  • Adds a comprehensive bash script that checks for and installs missing prerequisites (just, gh, shellcheck, markdownlint-cli2, jq)
  • Provides platform-specific installation logic for macOS and Linux with multiple package manager support
  • Updates the PR workflow version reference to v4.2

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.just/install-prerequisites.sh New script that detects OS, checks for missing prerequisites, and provides installation instructions or automated installation for supported platforms
.just/gh-process.just Updates version comment from v4.1 to v4.2 to reflect the new prerequisite installation feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +140 to +142
echo " wget -qO - 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null"
echo " echo \"deb [arch=all,\$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr \$(lsb_release -cs)\" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list"
echo " sudo apt update && sudo apt install just"
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

These complex multi-line installation commands are difficult to read and maintain. Consider breaking them into separate echo statements or storing them in a heredoc for better readability.

Suggested change
echo " wget -qO - 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null"
echo " echo \"deb [arch=all,\$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr \$(lsb_release -cs)\" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list"
echo " sudo apt update && sudo apt install just"
cat <<'EOF'
wget -qO - 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
echo "deb [arch=all,$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list
sudo apt update && sudo apt install just
EOF

Copilot uses AI. Check for mistakes.
elif [[ "$PKG_MGR" == "dnf" ]]; then
echo -e "${CYAN}Install shellcheck:${NC} sudo dnf install shellcheck"
elif [[ "$PKG_MGR" == "pacman" ]]; then
echo -e "${CYAN}Install shellcheck:${NC} sudo pacman -S shellcheck"
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The shellcheck installation case is missing a fallback message for manual installation when PKG_MGR is 'manual', unlike the other tools. Consider adding consistency by including an else clause with a reference to shellcheck's installation documentation.

Suggested change
echo -e "${CYAN}Install shellcheck:${NC} sudo pacman -S shellcheck"
echo -e "${CYAN}Install shellcheck:${NC} sudo pacman -S shellcheck"
else
echo -e "${CYAN}Install shellcheck:${NC} See https://github.com/koalaman/shellcheck#installing"

Copilot uses AI. Check for mistakes.
elif [[ "$PKG_MGR" == "dnf" ]]; then
echo -e "${CYAN}Install jq:${NC} sudo dnf install jq"
elif [[ "$PKG_MGR" == "pacman" ]]; then
echo -e "${CYAN}Install jq:${NC} sudo pacman -S jq"
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The jq installation case is missing a fallback message for manual installation when PKG_MGR is 'manual', unlike the just tool which provides a link. Consider adding an else clause for consistency.

Suggested change
echo -e "${CYAN}Install jq:${NC} sudo pacman -S jq"
echo -e "${CYAN}Install jq:${NC} sudo pacman -S jq"
else
echo -e "${CYAN}Install jq manually:${NC} See https://jqlang.github.io/jq/download/"

Copilot uses AI. Check for mistakes.
@claude
Copy link

claude bot commented Dec 11, 2025

Code Review - PR #48: Install Prerequisites Script

Overview

This PR adds a useful prerequisite installation script (.just/install-prerequisites.sh) to help new users set up their development environment. The script detects missing tools and either installs them (macOS) or provides installation instructions (Linux/other).

Strengths ✅

  1. Good bash practices: Uses set -euo pipefail for strict error handling
  2. Cross-platform support: Handles macOS, Linux (apt-get, dnf, pacman), and provides fallback for unsupported systems
  3. User-friendly output: Excellent use of ANSI color codes for clear, readable feedback
  4. Smart detection: Checks what's already installed before attempting installations
  5. Clear separation of concerns: macOS auto-installs via Homebrew, Linux shows manual commands

Issues Found 🔴

1. Script not integrated into justfile (Severity: Medium)

The script exists but isn't callable via just. Users need to know to run .just/install-prerequisites.sh directly, which defeats the purpose of a streamlined workflow.

Recommendation: Add a recipe to the main justfile:

# install development prerequisites
[group('Utility')]
install_prereqs:
    .just/install-prerequisites.sh

2. Missing from documentation (Severity: Medium)

CLAUDE.md doesn't mention this new script. New users won't know it exists.

Recommendation: Add to CLAUDE.md under "Additional commands" section or create a setup/getting started section.

3. Release notes not updated (Severity: Low)

The version bump to v4.2 in .just/gh-process.just:16 references this script, but .just/RELEASE_NOTES.md hasn't been updated.

Recommendation: Add a v4.2 entry to RELEASE_NOTES.md documenting this feature.

4. Linux behavior inconsistency (Severity: Low)

macOS auto-installs tools, but Linux only shows commands. While this is a reasonable choice (sudo access varies), it could confuse users who expect consistent behavior.

Consider: Adding a --dry-run or --auto flag to control installation behavior explicitly.

5. No validation of installed tools (Severity: Low)

After macOS installation, the script doesn't verify the tools are actually working, only that the installation commands succeeded.

Consider: Re-running the detection checks after installation to confirm success.

6. GitHub CLI authentication reminder (.just/install-prerequisites.sh:94, :153)

The script reminds users to run gh auth login, but doesn't check if they're already authenticated.

Consider: Add gh auth status check and only show the reminder if not authenticated.

Security Considerations 🔒

  1. npm global install (.just/install-prerequisites.sh:107): Installing packages globally with npm can have security implications. This is acceptable for developer tools, but worth noting.
  2. Homebrew detection (.just/install-prerequisites.sh:79): Good security practice - fails if Homebrew isn't installed rather than auto-installing it.
  3. No untrusted input: Script doesn't accept user input, reducing attack surface.

Performance Considerations ⚡

No concerns - script is lightweight and runs standard system commands.

Test Coverage 📊

Issue: No tests exist for this script. The repository has no test framework at all.

Recommendation: Consider adding basic tests:

  • Mock command -v to test detection logic
  • Test color output formatting
  • Verify script behavior on empty/partial prerequisite lists

For a template repo, comprehensive testing may be overkill, but at minimum:

  • Test the script manually on macOS, Linux (different distros), and an unsupported OS
  • Document tested platforms in CLAUDE.md or README

Code Quality 🎨

The bash code is clean and well-structured:

  • Good use of arrays for tracking installed/missing tools
  • Clear variable names (MISSING, INSTALLED, PKG_MGR)
  • Appropriate comments
  • Consistent error handling with exit codes

Minor suggestion: The script could benefit from a --help flag explaining its purpose and usage.

Recommendations Summary

Must fix before merge:

  • Add integration to justfile (or document why it's intentionally standalone)
  • Update documentation (CLAUDE.md or README)

Should fix:

  • Update RELEASE_NOTES.md for v4.2
  • Add --help flag

Nice to have:

  • Improve Linux/macOS behavior consistency
  • Add post-installation validation
  • Check gh auth status before showing reminder
  • Add basic test coverage

Conclusion

This is a solid addition that will help new users get started faster. The code quality is good and follows bash best practices. The main gaps are in integration and documentation rather than the script itself. With the integration and documentation updates, this will be a valuable addition to the template.


Review automated via Claude Code

@claude
Copy link

claude bot commented Dec 11, 2025

Code Review - PR #48

Summary

This PR adds a well-crafted prerequisites installation script (install-prerequisites.sh) that automates the setup of development tools needed for the repository. The implementation is solid with good attention to user experience and cross-platform support.


✅ Strengths

1. Code Quality

  • Clean bash implementation with proper set -euo pipefail for strict error handling
  • Good use of arrays for tracking installed vs. missing tools
  • Consistent code style and well-structured logic flow
  • Appropriate use of ANSI color codes for clear user feedback

2. Cross-Platform Support

  • Handles macOS (Homebrew) with automatic installation
  • Covers multiple Linux package managers (apt-get, dnf, pacman)
  • Graceful fallback for unsupported systems with helpful manual instructions
  • Proper OS detection using $OSTYPE

3. User Experience

  • Visual feedback with colored output (✓ for installed, ✗ for missing)
  • Clear, actionable error messages
  • Helpful reminders (e.g., "Don't forget to authenticate: gh auth login")
  • Idempotent design - can be run multiple times safely

4. Documentation

  • Comprehensive release notes entry in .just/RELEASE_NOTES.md
  • Clear description of what the script does and how to use it
  • Proper version bump to v4.2 in gh-process.just
  • Includes PR link in release notes

🔍 Areas for Consideration

1. Script Behavior Inconsistency (Linux vs macOS)

The script has different behaviors on Linux vs macOS:

  • macOS: Actually installs packages automatically
  • Linux: Only displays installation commands (user must run manually)

This inconsistency could confuse users. Consider either:

  • Making Linux auto-install too (with a --dry-run flag for safety)
  • Making macOS show commands first and ask for confirmation
  • Clearly documenting this difference in the script's header comments

Reference: Lines 76-114 (macOS auto-installs) vs 117-182 (Linux shows commands)

2. Missing Error Handling for Failed Installations

On macOS, if a brew install command fails, the script continues to the next tool due to the loop structure. Consider:

  • Checking exit codes after each installation
  • Providing feedback on which tools installed successfully vs which failed
  • Offering to continue or abort on failure

Reference: .just/install-prerequisites.sh:85-114

3. npm Global Install Considerations

Line 107 uses npm install -g markdownlint-cli2 which:

  • May require sudo depending on npm setup
  • Could fail silently if user lacks permissions
  • No verification that the install succeeded

Consider adding:

  • A note about potential permission issues
  • Verification after npm install
  • Alternative installation method (npx or local install)

Reference: .just/install-prerequisites.sh:107

4. Hardcoded Package Manager Commands

The apt-get installation for just (lines 138-142) uses a specific PPA that:

  • May become outdated
  • Requires multi-line copy-paste
  • Could fail if the PPA is unavailable

Consider mentioning alternative installation methods or linking to official docs.

Reference: .just/install-prerequisites.sh:138-142


🔒 Security

No significant security concerns

  • No unsafe eval or command injection vulnerabilities
  • Proper use of quoted variables throughout
  • External URLs are from trusted sources (brew.sh, github.com, stedolan.github.io)
  • No credential handling or sensitive operations

Minor note: The wget/gpg command chain on line 140 pipes directly to system locations. This is standard practice but users should verify the source is trusted.


⚡ Performance

Efficient implementation

  • Minimal overhead - just command checks and conditional execution
  • No unnecessary file I/O or network calls
  • Appropriate use of command -v for tool detection

🧪 Test Coverage

Current state: No automated tests for the shell script

Recommendations:

  • Consider adding a test that verifies the script runs without errors in different scenarios
  • Could use bats (Bash Automated Testing System) or similar
  • Test cases: all installed, some missing, none installed, unsupported OS

However, given this is a developer tooling script that will be run manually, extensive testing may be overkill. The shellcheck validation provides good static analysis coverage.


📝 Documentation & Release Notes

Excellent documentation

  • Release notes are comprehensive and well-structured
  • Proper heading hierarchy fix (November/December sections)
  • PR link included
  • Clear usage instructions

Minor suggestion: Consider adding a usage example in the README or a comment at the top of the script itself showing:

# Usage: ./.just/install-prerequisites.sh
# This script checks for required tools and helps install them

🎯 Overall Assessment

Status: ✅ Approved with minor suggestions

This is a high-quality contribution that adds real value for repository onboarding. The code is clean, well-structured, and thoughtfully implemented. The inconsistency between macOS and Linux behavior is the main item worth addressing, but it's not a blocker.

Suggested improvements (non-blocking):

  1. Document the macOS vs Linux behavior difference
  2. Add error handling for failed installations
  3. Consider adding a dry-run or interactive mode
  4. Add basic test coverage if this script becomes critical infrastructure

Nice touches:

  • Color-coded output
  • Helpful reminders about authentication
  • Graceful handling of edge cases (no package manager, no npm, etc.)
  • Executable permissions already set

Great work! 🎉

@claude
Copy link

claude bot commented Dec 11, 2025

Code Review - PR #48

Overview

This PR adds a comprehensive prerequisites installation script (install-prerequisites.sh) to help new contributors set up their development environment. The implementation is solid and well-documented.

✅ Strengths

  1. Excellent User Experience

    • Clear color-coded output for installation status
    • Helpful error messages and installation instructions
    • Smart detection of what's already installed vs. missing
    • Platform-aware installation (macOS auto-installs, Linux shows commands)
  2. Code Quality

    • Clean bash script with proper set -euo pipefail strict mode
    • Well-structured with logical flow
    • Good error handling for missing package managers
    • Comprehensive comments and usage documentation
  3. Platform Coverage

    • macOS with Homebrew (automated installation)
    • Linux with apt-get, dnf, and pacman support
    • Fallback for unsupported platforms with helpful documentation links
  4. Integration

    • Properly added to Claude's allowed commands in .claude/settings.local.json
    • Well-documented in release notes with clear versioning (v4.2)
    • Version bump in gh-process.just from v4.1 to v4.2

🔍 Minor Observations

  1. Potential Enhancement: Exit Code on Linux (.just/install-prerequisites.sh:239)

    • The Linux path currently doesn't exit after showing commands, but falls through to the final success message
    • This could be slightly misleading since nothing was actually installed (just commands shown)
    • Consider adding exit 0 after line 239 to clarify the script only showed instructions
  2. Documentation Consistency

    • The release notes mention "December 2025" but we're actually in December 2024 per the PR date
    • The heading structure in RELEASE_NOTES.md is good - moved "November 2025" heading to line 57 to keep chronological order
  3. Brew Install Verification

    • The script checks for brew installation success properly (lines 103, 112, 122, 144)
    • Good practice tracking successes/failures separately

🛡️ Security

  • No security concerns identified
  • Script uses standard package managers and official repositories
  • No hardcoded credentials or sensitive data
  • Uses official documentation links for installation resources

🧪 Test Coverage

  • Script is executable and follows shellcheck best practices (based on structure)
  • Error handling is comprehensive
  • Missing: Automated tests for the script itself, but this is acceptable for an installation helper

📝 Documentation

  • Excellent inline documentation
  • Clear usage instructions in script header
  • Comprehensive release notes with links to the PR
  • Well-integrated into the existing workflow documentation

Recommendation

Approve with optional minor enhancement. The code is production-ready as-is. The only suggestion is to add exit 0 after line 239 in the Linux path to avoid the potentially misleading final "Installation complete!" message when only showing commands rather than actually installing.

Overall, this is a well-crafted contribution that significantly improves the onboarding experience for new contributors. Great work! 🎯


Review generated by Claude Code

@chicks-net chicks-net merged commit 5a43703 into main Dec 11, 2025
5 checks passed
@chicks-net chicks-net deleted the chicks/2025-12-11-just-prerequisites branch December 11, 2025 01:22
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.

2 participants