Repository navigation
fix: keep common tools with --no-ssh - #41
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
🟡 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-sshis 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_SERVERinherited from the devcontainer environment. If a project defines this variable as0(or another invalid value),--sshcan silently skipsshd(or fail validation) whilehandleUpLikestill records the workspace as SSH-enabled. SetSTART_SSH_SERVER=1explicitly 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 execreturns as soon as it seesSTART_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 installinggh, 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.
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>
Owner
Author
|
Addressed in commit
Validation: |
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>
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
--no-sshis used, includinggh, Node/npm, Fresh Editor, git, and tmux.sshdstartup behind the SSH mode.--no-ssh.Validation
bun run typecheckDEVBOX_SKIP_LIVE_EXAMPLE_TESTS=1 bun testbash -n src/runner/ssh-server.shgit diff --check