-
Notifications
You must be signed in to change notification settings - Fork 0
Modernize dotfiles with Stow and testing #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
mlorentedev
wants to merge
14
commits into
main
from
claude/modernize-dotfiles-testing-011CV52rfvF6DuyTVwvCqcWw
Closed
Modernize dotfiles with Stow and testing #1
mlorentedev
wants to merge
14
commits into
main
from
claude/modernize-dotfiles-testing-011CV52rfvF6DuyTVwvCqcWw
Conversation
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
Major refactoring of dotfiles repository with the following improvements: ## New Features - GNU Stow-based modular structure for easy management - Automated bootstrap script with 3 installation modes (minimal/tools/all) - Comprehensive test suite (unit, integration, Docker-based) - GitHub Actions CI/CD pipeline - Makefile for common operations - Enhanced secrets management with age encryption wrapper - Tool installation scripts for DevOps toolchain ## Structure Changes - Reorganized into Stow modules: bash/, zsh/, git/, shell-common/, scripts/, starship/ - Scripts moved to ~/.local/bin following XDG standards - Added test/ directory with comprehensive test coverage - Added tools/ directory with automated tool installers ## Testing - 7 test suites covering structure, files, executables, syntax, stow, aliases, and PATH - Docker testing on Ubuntu 20.04, 22.04, 24.04 - GitHub Actions workflows for CI/CD - All tests passing ✅ ## Tools & Scripts - bootstrap.sh: Main installation script with dependency management - secrets-wrapper: Enhanced age encryption with backup and validation - install-shell.sh: Automated installation of eza, bat, fzf, zoxide, starship, etc. - install-containers.sh: Docker and lazydocker setup - install-kubernetes.sh: kubectl, k9s, helm, kubectx, stern installation - install-iac.sh: Terraform and Ansible setup ## Documentation - Comprehensive README with badges, examples, and troubleshooting - MIGRATION.md guide for upgrading from old structure - Individual README.md in each module - Inline documentation in all scripts ## Configuration Enhancements - Modern bash config with git-aware prompt and k8s context - Enhanced zsh with Oh My Zsh and custom plugins - Starship prompt configuration - Smart PATH management without duplicates - direnv integration support ## Developer Experience - make minimal/tools/all for installation - make test/lint/check for verification - make backup/clean/update for management - Full shellcheck compliance Breaking Changes: - File locations changed (use MIGRATION.md to migrate) - Scripts renamed (removed .sh extension) - Installation method changed (use bootstrap.sh or Makefile) This modernization brings the dotfiles up to current best practices with a focus on testability, automation, and maintainability.
- Fix test-path.sh by ensuring ~/.local/bin directory exists before testing - Remove all emojis from README.md and MIGRATION.md - Remove IMPLEMENTATION_SUMMARY.md (was redundant with README) - Make documentation more professional and human-like - All tests now passing (7/7)
- Remove excessive separator lines and banners - Simplify header comments to be concise - Remove fancy ASCII boxes from output - Make messages more straightforward and less enthusiastic - Reduce verbosity in all scripts to look more natural - All tests still passing (7/7)
The bashrc has an early return for non-interactive shells, so the PATH setup was never reached in CI. Changed test to use 'bash -i' to ensure interactive mode and full bashrc loading.
- Move typeset -U PATH before adding .local/bin to ensure uniqueness - Add check to prevent adding .local/bin if already in PATH - Fix test regex to properly escape dot in .local/bin pattern - Ensures clean PATH even when .zshrc is sourced repeatedly
- Replace useless cat with direct grep - Use double quotes for variable expansion in echo - Remove quotes from regex patterns in [[ =~ ]] - Use parameter expansion instead of sed for masking - Quote exit code variable - Declare and assign separately to avoid masking return values - Remove useless echo wrapping command substitutions - Add shellcheck source directives for sourced utils.sh All tests passing (7/7)
- SC2076: Fix regex pattern in github-secrets-manager.sh by using variable - SC2155: Separate declare and assign in age-encrypt-decrypt.sh and all tool scripts - SC1091: Add shellcheck source directives to all tool installation scripts - SC2181: Check exit codes directly instead of using $? in test scripts - SC2034: Remove unused YELLOW variable from test-stow.sh
- SC2119: Disable for check_dependencies function that takes no args - SC1091: Disable for sourcing utils and /etc/os-release (standard practice) - SC2034: Remove unused YELLOW variable from run-all-tests.sh
Critical fixes based on comprehensive code review: 1. github-secrets-manager.sh: - Replace predictable temp file (/tmp/ssh_key_decoded.$$) with mktemp - Add trap handler for temp file cleanup on exit - Prevents symlink attacks and TOCTOU race conditions - Ensures SSH private keys are cleaned up even on crash 2. install.sh: - Remove dangerous silent failures (2>/dev/null || true) - Add proper existence checks before copy operations - Fix command substitution in heredoc (security risk) - Use escaped heredoc and separate echo for variable expansion - Properly quote paths in source commands 3. zsh/.zshrc: - Add shellcheck disable for oh-my-zsh.sh source - Variable already properly quoted These changes address: - Unsafe temporary file handling (CRITICAL) - Command injection risk in heredoc (CRITICAL) - Silent failures hiding errors (IMPORTANT) - Resource leaks and cleanup issues (IMPORTANT)
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.
No description provided.