Skip to content

refactor(devcontainer): remove the DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP test switch from product code #1729

Closed

Description

@dan-petty

Friction

Product code holds a switch that exists only for tests, which docs/TESTING.md rules out: "Product code holds nothing for tests". The switch is DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP.

Evidence

  • _bootstrap_managed_tools in src/devops_cli/commands/devcontainer.py returns early when DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP is 1, true or yes.
  • Its only callers are tests:
    • the autouse isolate_devcontainer_env fixture in tests/test_devcontainer.py;
    • the unit test that checks the switch.
  • Its task file (DevContainer Post-Create Automatically Bootstraps Missing DevOps Tools #620) says it was added "for fast hermetic test isolation".
  • The public --skip-tools option of devops devcontainer post-create does the same thing for a person. No documentation, image or workflow sets the variable.

Remedy

  • Remove the environment check and its unit-test case.
  • Tests that run post-create pass --skip-tools, or skip_tools=True to _run_post_create_lifecycle. Tests that check managed tools answer install_managed_tools' process edge through the shared fake.
  • Every assertion stays.

Acceptance criteria

  • DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP no longer appears in src/ or tests/.
  • No test that runs post-create starts uv, an installer or a download.
  • uv run devops ci passes.

Proposed design

Problem statement

Product code in src/devops_cli/commands/devcontainer.py holds an environment variable check (DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP) that exists only for tests. This violates the rule in docs/TESTING.md that product code holds nothing for tests. The existing skip parameter and the public --skip-tools flag already provide the same behavior, so the env var check is redundant.

Acceptance criteria

  • Criterion 1: DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP no longer appears in src/ or tests/
    Verification: grep -r "DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP" src/ tests/ returns no matches and exits non-zero
  • Criterion 2: No test that runs post-create starts uv, an installer, or a download
    Verification: uv run pytest tests/test_devcontainer.py passes with the hermetic floor active and no process refusal is raised
  • Criterion 3: uv run devops ci passes
    Verification: uv run devops ci exits with code 0

Key questions

  • Where is the DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP check in product code?: In _bootstrap_managed_tools in src/devops_cli/commands/devcontainer.py, the line if os.environ.get("DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP", "").strip().lower() in ("1", "true", "yes"): return [] [sources: src/devops_cli/commands/devcontainer.py]
  • Does the skip parameter already provide the same early-return behavior?: Yes. The first check in _bootstrap_managed_tools is if dry_run or skip: return [], and the skip parameter is wired from skip_tools in _run_post_create_lifecycle and from the --skip-tools CLI flag in the post_create command. [sources: src/devops_cli/commands/devcontainer.py]
  • What do tests currently use to skip tool bootstrap?: The autouse isolate_devcontainer_env fixture in tests/test_devcontainer.py sets the DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP environment variable. [sources: tests/test_devcontainer.py]
  • What should tests use instead of the env var?: Tests that run post-create pass skip_tools=True to _run_post_create_lifecycle, or pass --skip-tools through the CLI. Tests that check managed tools answer install_managed_tools' process edge through the shared fake. (proposed)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/refactor
    on Oct 20, 2026
  2. dan-petty commented on Oct 20, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/refactor. The candidate proposes a refactor to remove test-specific code from product code, which aligns with the type/refactor category.
    • Priority: P2-Medium. This change improves code hygiene and adherence to project guidelines but does not address a critical issue or introduce new functionality.
    • Value: Low. The change improves code quality but has minimal impact on end-user experience or project functionality.
    • Effort: Low. The task involves removing a simple environment check and updating tests, which is straightforward.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at 4da1e34 (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    effort/low
    value/low
    on Oct 28, 2026
  5. removed
    status/ready
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumsource/agenttype/refactorvalue/low

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions