Repository navigation
feat(cli): devcontainer post-create automatically bootstraps missing devops tools (#620) - #621
Merged
dan-petty merged 1 commit intoSep 26, 2026
Conversation
…devops tools (#620) Automate DevOps tools bootstrapping during devcontainer post-create lifecycle so that managed binaries (k9s, trivy, kube-linter, popeye, pluto, kustomize, argo, argocd, kubectl-argo-rollouts) are available in developer shells immediately upon devcontainer build or rebuild without manual installation. - Add _bootstrap_managed_tools to devcontainer post-create command, installing missing binaries to ~/.local/bin (persisted across container rebuilds via global-devcontainer-home volume). - Add --skip-tools flag to devops devcontainer post-create and honor DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP for hermetic test execution. - Add is_tool_installed(spec, target_dir) and --only-missing flag to devops install-tools, skipping binaries already in PATH with zero download penalty. - Modernize upstream release asset and checksum handling in install_tools.py for argo (argo-workflows-cli-checksums.txt), kubectl-argo-rollouts (argo-rollouts-checksums.txt), kube-linter (kube-linter-linux.tar.gz), and kubectl version invocation without --short. - Add comprehensive unit tests with structural tuple equality assertions. Closes #620
dan-petty
deleted the
feat/620-devcontainer-post-create-bootstraps-devops-tools
branch
September 26, 2026 13:55
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
Following devcontainer recreation or rebuild, managed DevOps tool binaries (
k9s,trivy,kube-linter,popeye,pluto,kustomize,argo,argocd,kubectl-argo-rollouts) were missing from developer shells (zsh: command not found: k9s). While developer tools (uv,pre-commit,claude) andgnome-keyringwere bootstrapped duringpostCreateCommand(devops devcontainer post-create), managed tool installation was omitted from the automated lifecycle.This PR integrates automated tool bootstrapping into
devops devcontainer post-create, installing missing tools into~/.local/bin(mounted on persistent volumeglobal-devcontainer-home) so they survive container rebuilds, with zero download penalty for already installed tools.Key Changes
Automated Tool Bootstrapping in DevContainer Lifecycle (
src/devops_cli/commands/devcontainer.py):_bootstrap_managed_toolshelper delegating toinstall_managed_tools(target_dir=dest, only_missing=True)._run_post_create_lifecyclealongside_bootstrap_developer_toolsand_install_keyring_packages.--skip-toolsCLI option todevops devcontainer post-createand honoredDEVOPS_CLI_SKIP_TOOL_BOOTSTRAPfor hermetic test execution.Zero-Overhead Tool Resolution & Missing-Only Support (
src/devops_cli/commands/install_tools.py):is_tool_installed(spec, target_dir)checking both target directory existence and systemPATHviashutil.which. Tools already present incur zero download penalty.--only-missingflag todevops install-tools.install_allinto single-responsibility helpers (_validate_install_args,_resolve_install_targets,_install_single_target,is_tool_installed), keeping cyclomatic complexity and nesting depth strictly bounded (install_managed_tools(target_dir, only_missing=True) -> list[str].Upstream Release Asset Modernization & Checksum Fallbacks (
src/devops_cli/commands/install_tools.py):argo(argo-workflows-cli-checksums.txtfallback to.sha256).kubectl-argo-rollouts(argo-rollouts-checksums.txtfallback tosha256checksums.txt).kube-linterto check unarchived asset names (kube-linter-linux.tar.gz/kube-linter-linux_arm64.tar.gz).kubectlversion command from deprecated--shortto modern["kubectl", "version", "--client"].Automated Tests & Quality Gates (
tests/test_install_tools.py,tests/test_devcontainer.py):is_tool_installed,install-tools --only-missing, programmaticinstall_managed_tools,_bootstrap_managed_toolslifecycle behaviors, andpost-create --skip-tools.uv run devops ci.Closes #620