Skip to content

feat(cli): devcontainer post-create automatically bootstraps missing devops tools (#620) - #621

Merged
dan-petty merged 1 commit into
release/v0.2.23from
feat/620-devcontainer-post-create-bootstraps-devops-tools
Sep 26, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.23from
feat/620-devcontainer-post-create-bootstraps-devops-tools

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

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) and gnome-keyring were bootstrapped during postCreateCommand (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 volume global-devcontainer-home) so they survive container rebuilds, with zero download penalty for already installed tools.

Key Changes

  1. Automated Tool Bootstrapping in DevContainer Lifecycle (src/devops_cli/commands/devcontainer.py):

    • Added _bootstrap_managed_tools helper delegating to install_managed_tools(target_dir=dest, only_missing=True).
    • Wired into _run_post_create_lifecycle alongside _bootstrap_developer_tools and _install_keyring_packages.
    • Added --skip-tools CLI option to devops devcontainer post-create and honored DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP for hermetic test execution.
  2. Zero-Overhead Tool Resolution & Missing-Only Support (src/devops_cli/commands/install_tools.py):

    • Added is_tool_installed(spec, target_dir) checking both target directory existence and system PATH via shutil.which. Tools already present incur zero download penalty.
    • Added --only-missing flag to devops install-tools.
    • Decomposed install_all into single-responsibility helpers (_validate_install_args, _resolve_install_targets, _install_single_target, is_tool_installed), keeping cyclomatic complexity and nesting depth strictly bounded ($M \le 10$, depth $\le 5$).
    • Exposed programmatic helper install_managed_tools(target_dir, only_missing=True) -> list[str].
  3. Upstream Release Asset Modernization & Checksum Fallbacks (src/devops_cli/commands/install_tools.py):

    • Modernized checksum resolution for argo (argo-workflows-cli-checksums.txt fallback to .sha256).
    • Modernized checksum resolution for kubectl-argo-rollouts (argo-rollouts-checksums.txt fallback to sha256checksums.txt).
    • Updated kube-linter to check unarchived asset names (kube-linter-linux.tar.gz / kube-linter-linux_arm64.tar.gz).
    • Updated kubectl version command from deprecated --short to modern ["kubectl", "version", "--client"].
  4. Automated Tests & Quality Gates (tests/test_install_tools.py, tests/test_devcontainer.py):

    • Refactored monolithic installer tests into focused, low-complexity modules with structural tuple equality assertions.
    • Added unit test suites verifying is_tool_installed, install-tools --only-missing, programmatic install_managed_tools, _bootstrap_managed_tools lifecycle behaviors, and post-create --skip-tools.
    • 100% pass across all quality gates in uv run devops ci.

Closes #620

…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
dan-petty merged commit 4a07093 into release/v0.2.23 Sep 26, 2026
8 checks passed
@dan-petty
dan-petty deleted the feat/620-devcontainer-post-create-bootstraps-devops-tools branch September 26, 2026 13:55
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.

1 participant