Skip to content

refactor(repos): remove the npm ci step of worktrees add #7264

Done

Description

@dan-petty

Problem or Motivation

Pull request #7260 (item #7233, merged 2026-11-26) makes devops repos worktrees add run npm ci --ignore-scripts in each new worktree. The premise of #7233 was wrong: the gate did not find the openspec of the image. It found a stale copy in the home volume, and that copy is removed now. So the new step installs the Node tools a second time for each worktree and fixes no cause.

Owner direction, 2026-11-26: "tools should be properly installed in the devtools image and the path should properly make the intended versions available to all user of the container environment", and "an old installation process put them in a home bin dir and that has ended up higher in priority on the path var".

Evidence from the devcontainer (devtools 1.2.2), before the fix:

Copy Version Source
~/.local/bin/openspec 2.1.0 A link into ~/.local/share/devops-cli/tools/openspec/2.1.0, which the removed devops install-tools wrote on 2026-11-18. The shell profiles of the home volume put ~/.local/bin first on PATH.
<workspace>/node_modules/.bin/openspec 2.2.0 The pin of package-lock.json. remoteEnv.PATH of .devcontainer/devcontainer.json names this folder of the main checkout, so each worktree gets it too.
/usr/local/bin/openspec 2.1.1 The devtools image.

The error text of #7233 names ~/.local/bin/openspec and 2.1.0, which is the stale copy. The links osv-scanner (2.6.0, the image has 2.7.1) and ansible-runner had the same source. src/devops_cli holds no code that writes that folder now.

Fix of the cause, done 2026-11-26: the three stale links are removed from the home volume. Proof: in the worktree of #7261, with no node_modules and no npm ci, uv run devops ci --check --only openspec passes, and openspec resolves to the pinned 2.2.0 of the main checkout.

Proposed Solution

Disposition: change the code.

  • Remove the npm ci --ignore-scripts step from devops repos worktrees add, with its test and its document lines.
  • Keep the message of the gate (version_differs), which names the path of the binary that it found. That path shows a stale copy at once.

Proof: devops repos worktrees add starts no npm process, and the openspec row of devops ci passes in a new worktree of the devcontainer.

Open point, with no action in this item: the OpenSpec of the devtools image is 2.1.1 and the pin is 2.2.0. A user with no remoteEnv of the devcontainer gets 2.1.1 until Renovate moves the image.

Existing Tool Considered

The devtools image and the PATH of the devcontainer already give each worktree the pinned tool. The change deletes code and adds none.

Activity

  1. added
    type/refactor
    source/agent
    status/new
    value/medium
    effort/low
    scope/repos
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 26, 2026
  2. removed
    status/in-review
    owner/agent
    on Nov 26, 2026
  3. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor
  4. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-26 01:10 UTC

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-mediumscope/repossource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions