Skip to content

fix: keep common tools with --no-ssh - #41

Merged
PabloZaiden merged 3 commits into
mainfrom
chat-devbox-1-e9e3c08e
Sep 11, 2026
Merged

PabloZaiden merged 3 commits into
mainfrom
chat-devbox-1-e9e3c08e

Conversation

@PabloZaiden

Copy link
Copy Markdown
Owner

Summary

  • Keep the shared container setup running when --no-ssh is used, including gh, Node/npm, Fresh Editor, git, and tmux.
  • Gate only OpenSSH package/configuration installation and sshd startup behind the SSH mode.
  • Stop existing managed SSH listeners when switching a workspace to --no-ssh.
  • Update documentation and regression coverage.

Validation

  • bun run typecheck
  • DEVBOX_SKIP_LIVE_EXAMPLE_TESTS=1 bun test
  • bash -n src/runner/ssh-server.sh
  • git diff --check

Run the shared container setup while gating only OpenSSH installation and startup behind the SSH mode. Update regression coverage and documentation for the new behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 11, 2026 01:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Four moderate findings remain covering listener cleanup, no-SSH tool-installation coverage, and explicit SSH startup configuration.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates --no-ssh to retain shared development tools while skipping SSH setup and stopping existing managed listeners.

Changes:

  • Gates SSH installation, configuration, and startup by mode.
  • Preserves common tools including gh, Node/npm, Fresh Editor, git, and tmux.
  • Updates orchestration, documentation, and regression coverage.
File summaries
File Reviewed change Final review comment
tests/runtime.test.ts Tests runner command generation. No final comment.
tests/examples.test.ts Updates simulated no-SSH workflow coverage. Moderate (1 vote): The fake exec exits before common setup; add coverage executing the branch with faked tool commands or verify tools in a real container.
tests/examples.live.test.ts Updates live-workspace expectations. No final comment.
src/runtime.ts Passes SSH mode to the bundled runner. Moderate (1 vote): Explicitly set START_SSH_SERVER=1 in the SSH-enabled command and update the script expectation.
src/runner/ssh-server.sh Separates common tooling from SSH setup. Moderate (1 vote): Add real-container assertions that no-SSH installs gh, Node/npm, Fresh Editor, git, and tmux.
src/core.ts Updates CLI help text. No final comment.
src/cli.ts Stops prior SSH listeners and updates orchestration. Moderate (2 votes): Add coverage switching from SSH-enabled to no-SSH and verify cleanup uses the old managed port.
README.md Documents revised no-SSH behavior. No final comment.
Review details

Suppressed comments (3)

src/runner/ssh-server.sh:172

  • The no-SSH integration coverage only checks the success message; the simulated runner exits before executing this script, and the live test does not verify any installed tool. A regression that skips the common setup would still pass. Add a real-container assertion for the expected gh, Node/npm, Fresh Editor, git, and tmux installations when --no-ssh is used.
if [[ "$START_SSH_SERVER" != "1" ]]; then
  echo "Bundled SSH server disabled; common container tools installed."
  exit 0
fi

src/runtime.ts:892

  • The normal SSH branch leaves START_SSH_SERVER inherited from the devcontainer environment. If a project defines this variable as 0 (or another invalid value), --ssh can silently skip sshd (or fail validation) while handleUpLike still records the workspace as SSH-enabled. Set START_SSH_SERVER=1 explicitly for the SSH-enabled command so the CLI mode cannot be overridden by container configuration, and update the corresponding script expectation.
  if (!startSshServer) {
    return `env START_SSH_SERVER=${quoteShell("0")} bash -s`;

tests/examples.test.ts:327

  • This fake devcontainer exec returns as soon as it sees START_SSH_SERVER='0', so it never executes the bundled script's common-setup path. The live test only checks CLI output, and the runtime test only checks source text; a regression that exits before installing gh, Node/npm, Fresh Editor, git, or tmux would still pass. Please add coverage that executes this branch with faked package/tool commands or verifies the resulting tools in a real container.
    if (script.includes("START_SSH_SERVER='0'")) {
      console.log("Bundled SSH server disabled; common container tools installed.");
      return;
    }
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/cli.ts
Explicitly pin the SSH runner mode and strengthen no-SSH coverage for common tool installation and listener cleanup. Add live assertions for the installed development tools.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PabloZaiden

Copy link
Copy Markdown
Owner Author

Addressed in commit 3015ead:

  • Explicitly set START_SSH_SERVER=1 for the SSH-enabled runner path.
  • Added simulated coverage that executes the no-SSH runner with fake package/tool commands and verifies gh, Node/npm, Fresh Editor, git, and tmux/dtach setup while excluding OpenSSH packages.
  • Added live-container assertions for the installed common tools.
  • Added regression coverage for switching a running SSH-enabled workspace to --no-ssh and verifying cleanup of the previous managed SSH port.

Validation: bun run test:fast (180 passed, 8 skipped), focused runtime/example tests, typecheck, shell syntax, and diff checks.

Use a portable dtach presence check in live integration coverage and keep the simulated runner from invoking the host sudo configuration when tests run as a non-root CI user.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PabloZaiden
PabloZaiden merged commit 1bc003d into main Sep 11, 2026
1 check passed
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.

2 participants