Skip to content

feat(system): add complete Alpine Linux support - #2041

Open
dnlrsls wants to merge 7 commits into
Gentleman-Programming:mainfrom
dnlrsls:feat/issue-334-alpine-support
Open

feat(system): add complete Alpine Linux support#2041
dnlrsls wants to merge 7 commits into
Gentleman-Programming:mainfrom
dnlrsls:feat/issue-334-alpine-support

Conversation

@dnlrsls

@dnlrsls dnlrsls commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Closes #334

Supersedes #1491.

Summary

  • Detect Alpine Linux directly and through ID_LIKE, resolving it as a supported apk platform.
  • Add Alpine dependency guidance and installer command resolution, including direct minimal-Alpine-compatible apk commands.
  • Bootstrap git and bash before the GGA clone/install sequence and add focused regression coverage.

Changes

Area Change
internal/system Alpine detection, platform profile, guard message, dependency hints and commands
internal/installcmd Alpine dependency, OpenCode, uv, and GGA command resolution
Tests Detection, profile, guard, dependency, agent, uv, and GGA ordering regressions

Test Plan

  • git diff --check
  • go test ./internal/system ./internal/installcmd -count=1
  • Independent read-only verification confirmed no remaining sudo apk paths and correct GGA command ordering
  • Runtime Alpine container exercise: N/A locally; deterministic command-resolution behavior is covered by package tests and CI will run the repository gates.

Rollback

Revert commit 311f260f to remove Alpine detection and apk command resolution without affecting existing distro behavior.

Summary by CodeRabbit

  • New Features
    • Added Alpine Linux detection and marked it as supported, using apk as the platform package manager.
    • Added apk-based install hints and commands for tooling and agent/dependency install flows (including uv, OpenCode, and GGA).
    • Extended dependency install support on Alpine for Git, Curl, Node.js/npm, Go, and npm handling.
  • Bug Fixes
    • Updated the unsupported Linux platform message to explicitly include Alpine.
  • Tests
    • Expanded installer resolution and platform/profile detection test coverage with Alpine (apk) cases.

@dnlrsls dnlrsls added the type:feature New feature label Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Alpine Linux is detected as supported through apk. Dependency hints, installation commands, and resolver paths for uv, OpenCode, GGA, and generic dependencies now include Alpine-specific behavior and tests.

Changes

Alpine Linux support

Layer / File(s) Summary
Alpine platform detection and support guard
internal/system/detect.go, internal/system/detect_test.go, internal/system/guard.go, internal/system/guard_test.go
Alpine identifiers resolve to LinuxDistroAlpine, use apk, and pass support validation.
Alpine dependency installation
internal/system/install_deps.go, internal/system/install_deps_test.go
Git, Curl, Node.js/npm, and Go return Alpine-specific hints and apk add --no-cache commands.
Alpine installer command resolution
internal/installcmd/resolver.go, internal/installcmd/resolver_test.go
uv, generic dependencies, OpenCode, and GGA installation flows support Alpine commands with corresponding resolver coverage.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OSRelease
  participant detectLinuxDistro
  participant resolvePlatformProfile
  participant InstallCommandResolver
  participant apk

  OSRelease->>detectLinuxDistro: Read Alpine ID or ID_LIKE
  detectLinuxDistro->>resolvePlatformProfile: Return LinuxDistroAlpine
  resolvePlatformProfile->>InstallCommandResolver: Provide supported apk profile
  InstallCommandResolver->>apk: Run apk add --no-cache commands
Loading

Possibly related PRs

Suggested reviewers: alan-thegentleman, decode2

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding Alpine Linux support.
Linked Issues check ✅ Passed The changes implement Alpine detection, apk support, and the required install guidance and bootstrapping described in issue #334.
Out of Scope Changes check ✅ Passed The Alpine-specific resolver updates and tests stay within the Alpine support scope and do not add unrelated changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/installcmd/resolver.go`:
- Around line 182-183: Update uvInstallHint’s "apk" path to ensure Alpine’s
community repository is enabled before installing uv, or provide a supported
non-apk remediation when it cannot be enabled. Preserve the existing apk
installation behavior once community is available, and align with the repository
configuration used by the system dependency helpers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4cbdf3b5-cf8f-4748-b37c-c02d5016c7bb

📥 Commits

Reviewing files that changed from the base of the PR and between d260cdb and 311f260.

📒 Files selected for processing (8)
  • internal/installcmd/resolver.go
  • internal/installcmd/resolver_test.go
  • internal/system/detect.go
  • internal/system/detect_test.go
  • internal/system/guard.go
  • internal/system/guard_test.go
  • internal/system/install_deps.go
  • internal/system/install_deps_test.go

Comment thread internal/installcmd/resolver.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/installcmd/resolver.go`:
- Around line 182-183: Update the "apk" branch in the installer resolver to
enable Alpine’s community repository through an executable setup step before
running apk add for uv, rather than returning prose only. Ensure the resulting
Alpine installation path works without manual repository configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 203624ba-8078-4d28-b48e-a7ae22de5a44

📥 Commits

Reviewing files that changed from the base of the PR and between 311f260 and b4e30fb.

📒 Files selected for processing (2)
  • internal/installcmd/resolver.go
  • internal/installcmd/resolver_test.go

Comment thread internal/installcmd/resolver.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/installcmd/resolver.go (1)

247-247: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Honor NpmWritable for Alpine OpenCode installs.

apk and Windows branches emit bare npm install -g, while Ubuntu/Arch/Fedora sudo npm when NpmWritable is false. Honor this flag for Alpine too, or document/provide a writable npm prefix; otherwise non-root Alpine installs can fail with EACCES.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/installcmd/resolver.go` at line 247, Update the Alpine OpenCode
install branch in the resolver to honor NpmWritable: use the existing sudo/npm
behavior when the npm prefix is not writable, while retaining the current
non-sudo command when it is writable. Keep the command arguments and version
handling unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/installcmd/resolver.go`:
- Line 183: Update the Alpine fallback returned by the resolver around the uv
installation command to bootstrap or install curl before invoking the uv install
script. Ensure the fallback remains self-contained and works when apk add uv
cannot use the community repository.

---

Outside diff comments:
In `@internal/installcmd/resolver.go`:
- Line 247: Update the Alpine OpenCode install branch in the resolver to honor
NpmWritable: use the existing sudo/npm behavior when the npm prefix is not
writable, while retaining the current non-sudo command when it is writable. Keep
the command arguments and version handling unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f8da33d9-f42c-49cb-908a-72d6fd9c7347

📥 Commits

Reviewing files that changed from the base of the PR and between b4e30fb and 8f5ba10.

📒 Files selected for processing (2)
  • internal/installcmd/resolver.go
  • internal/installcmd/resolver_test.go

Comment thread internal/installcmd/resolver.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/installcmd/resolver.go`:
- Around line 182-183: The Alpine fallback in the “apk” install hint must keep
uv discoverable in the current shell after the standalone installer runs. Update
the fallback command or hint to include the installer’s directory in PATH, and
revise TestUVInstallHint to assert the new install-directory guidance while
preserving the existing apk-first behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 776c1cec-b933-4398-b311-fb30e317030c

📥 Commits

Reviewing files that changed from the base of the PR and between 8f5ba10 and a512d65.

📒 Files selected for processing (2)
  • internal/installcmd/resolver.go
  • internal/installcmd/resolver_test.go

Comment thread internal/installcmd/resolver.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alpine Linux Support

1 participant