Skip to content

fix(apt): install packages non-interactively - #7500

Merged
viceice merged 1 commit into
mainfrom
fix/apt-noninteractive
Sep 25, 2026
Merged

viceice merged 1 commit into
mainfrom
fix/apt-noninteractive

Conversation

@viceice

@viceice viceice commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Changes

AptService runs apt-get update and apt-get install with DEBIAN_FRONTEND=noninteractive, like the shell apt_install did through the image env. When the cli is started from a /bin/sh step, that env isn't loaded, so a package with a debconf prompt such as tzdata waited for input forever.

Context

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Code and tests were written by Claude Opus 5.5 and Claude Sonnet 5 in Claude Code.

Use of AI in replying to PR comments

Who answers review comments:

  • @username will read and reply directly. Name the account.
  • An agent will draft replies and @viceice will read them before they are posted.
  • Nobody has explicitly committed to replying.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified tests

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • System package updates and installations now run in non-interactive mode, preventing configuration prompts from interrupting setup.
    • This behavior applies to package installation during environment preparation, including setup for supported development tools.

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
Co-Authored-By: Claude Sonnet 5 <michael.kriese+claude-code@mend.io>
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 0dda5e6e-b552-4f45-97ba-1ac9ea4a0c4f

📥 Commits

Reviewing files that changed from the base of the PR and between f1b78e2 and c8d9beb.

📒 Files selected for processing (6)
  • src/cli/services/apt.service.spec.ts
  • src/cli/services/apt.service.ts
  • src/cli/tools/dotnet/index.spec.ts
  • src/cli/tools/git/index.spec.ts
  • src/cli/tools/php/index.spec.ts
  • src/cli/tools/python/conan.spec.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

AptService now sets DEBIAN_FRONTEND=noninteractive for apt-get update and apt-get install. The service and tool tests check that apt commands receive this environment setting.

Changes

Apt installation

Layer / File(s) Summary
Set apt environment for installation
src/cli/services/apt.service.ts, src/cli/services/apt.service.spec.ts, src/cli/tools/dotnet/index.spec.ts, src/cli/tools/git/index.spec.ts, src/cli/tools/php/index.spec.ts, src/cli/tools/python/conan.spec.ts
AptService.install passes DEBIAN_FRONTEND=noninteractive to both apt commands. The service and tool tests assert this environment setting.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to c8d9b

Both apt operations now request non-interactive behavior, addressing hangs on packages that prompt during installation. No actionable merge risk is established; the change is ready for normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to c8d9b

The change can let package installations complete using default answers instead of waiting for input. It does not appear to expand which packages the service can install or who can invoke it, but the effects of defaults for every installed package are not established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed behavior reaches package configuration performed through AptService.install, but the inspected change does not add package sources, arguments, or a new caller authority.

Trust Boundaries and Controls

  • observed — AptService continues to pass caller-requested packages as apt-get argument-array entries after checking their installed status; this change affects the commands' environment option.

Resilience and Maintainability Implications

  • observed — Normal completion and thrown command failures still pass through the existing proxy-file cleanup block; the change does not establish interruption or concurrent-call behavior.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: installing packages with apt in non-interactive mode.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

gitar-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Apt update and installation now run with noninteractive debconf settings.

Adds DEBIAN_FRONTEND=noninteractive to AptService to prevent package installation from blocking on debconf prompts when the CLI is started from a /bin/sh step without the env variable. No issues found.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@viceice
viceice enabled auto-merge September 25, 2026 12:45
@viceice
viceice added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 314a84d Sep 25, 2026
62 checks passed
@viceice
viceice deleted the fix/apt-noninteractive branch September 25, 2026 13:01
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