feat: production-grade overhaul — testability, test coverage, CI optimization#9
Merged
Merged
Conversation
Structural:
- Wrap execution logic in main() with BASH_SOURCE guard
- Replace dynamic completions pipeline with static files
- Ship bash/zsh/fish completion scripts in src/claude-code/completions/
- Delete generate_completion() (66 lines of ANSI/CRLF/timeout cleanup)
- Rewrite setup_completions() as simple file copy (140 → 30 lines)
Bug fixes:
- CQ-1: pacman -Sy → -Syu
- CQ-2: cleanup() uses if/then (fix ERR trap)
- CQ-3: broaden ANSI stripping
- CQ-10: claude --version via head -n1
- CQ-11: boolean normalization via ${VAR,,}
- CQ-12: detect_remote_user UID 1000-60000
- CQ-14: whitespace skip [^[:space:]]
- CQ-15: curl timeouts
- CQ-17: create fish completions dir if missing
…sence - 7 new scenarios: completions_pipeline, negative_validation, security_permissions, custom_node_version, fedora_default, upgrade_version, install_path_with_completions - Completions tests assert files MUST exist (no more pass-on-absence fallbacks) - Content assertions verify known subcommands (auth, mcp, update) in completion files - 4 new helpers: check_completion_file_integrity, check_file_contains, check_file_not_contains, check_no_world_writable - Strengthened existing scenarios (mount_host_config, custom_install_path, idempotency, etc.) - Removed orphaned duplicate.sh
814b55d to
ca725d2
Compare
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
Production-grade overhaul of the installer, test suite, and CI pipeline addressing testability, coverage gaps, robustness, and a fundamentally broken completions feature.
install.sh refactor + 11 bug fixes
main()withBASH_SOURCEguard —install.shcan now be sourced safely for unit testing individual functionspacman -Sy→-Syu(avoid Arch partial upgrade)claude --versionoutput viahead -n1detect_remote_userUID range to 1000-60000[^[:space:]]Static shell completions (replaces broken dynamic generation)
The previous approach ran
claude completions bashat Docker build time, which never worked — it requires authentication unavailable during builds. After 8+ fix iterations polishing a cleanup pipeline for a code path that never succeeded, this PR replaces the entire approach:setup_completions()is now a simple file copy (30 lines replacing 140 lines of ANSI/CRLF/timeout pipeline)generate_completion()and the entire dynamic generation pipelineTest suite overhaul (10 → 17 scenarios)
nodeVersion=22binary download pathcheck_completion_file_integrity,check_file_contains,check_file_not_contains,check_no_world_writableduplicate.shCI optimization (27 → 8 images)
Test plan