Skip to content

fix(flatpak): start host process in a host-valid directory - #1838

Merged
skevetter merged 1 commit into
mainfrom
fix/1836-flatpak-reexec-sandbox-cwd
Nov 13, 2026
Merged

skevetter merged 1 commit into
mainfrom
fix/1836-flatpak-reexec-sandbox-cwd

Conversation

@skevetter

@skevetter skevetter commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Cause

ReexecOnHost ran flatpak-spawn --host without --directory. A working directory that exists only inside another app's Flatpak sandbox made the portal call fail.

Fix

Pass --directory=<cwd>. Use $HOME when the cwd is under /app or unreadable. Omit the flag if $HOME is empty.

Test evidence

Commit: see head SHA. go test ./pkg/flatpak: ok. golangci-lint run ./pkg/flatpak/...: 0 issues.

Not verified

Real Flatpak portal run. Restricting re-exec to Devsy's own Flatpak is out of scope.

Summary by CodeRabbit

  • Bug Fixes
    • Commands launched from Flatpak now start in the appropriate host directory. When the current location is inside the app’s sandbox, they start from the home directory instead.

@netlify

netlify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 51c4a30
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6af698b256cfa2344539b17b

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

ReexecOnHost now selects a host-side working directory and passes it to flatpak-spawn when nonempty. Empty working directories and paths under /app use $HOME. Tests cover directory selection and spawn argument construction.

Changes: Flatpak host re-execution

Layer / File(s) Summary
Select directory and build spawn arguments
pkg/flatpak/flatpak.go, pkg/flatpak/flatpak_test.go
hostSpawnDirectory selects $HOME for empty or /app paths and keeps other paths. buildSpawnArgs adds --directory=<path> only when a directory is available. ReexecOnHost uses the generated arguments. Tests cover directory selection and argument construction.

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

Change: Bug fix

Possibly related issues

  • devsy-org/devsy#1836: The change addresses the reported missing --directory behavior and falls back to $HOME for sandbox-only paths. The issue also describes re-execution in Flatpaks outside Devsy, which this PR states is out of scope.

Suggested labels: bug

Merge Risk: Minimal · up to 51c4a

Flatpak host re-execution now starts in a directory the host can use, falling back to the home directory when the working directory is under /app or empty. No actionable merge-blocking risk is evident. The change has not been run against a real Flatpak portal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title uses the Conventional Commits form and names the main change: the host process started by ReexecOnHost now runs in a directory valid on the host. The raw summary confirms the changeset adds …
Description check Passed The description gives the cause, the fix, test evidence, and what was not verified. It does not follow the repository template: the 'Fixes #' issue link is missing, the Type of change checkboxes are n…
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.
Full details: Title check

Explanation

The title uses the Conventional Commits form and names the main change: the host process started by ReexecOnHost now runs in a directory valid on the host. The raw summary confirms the changeset adds a --directory flag selection for flatpak-spawn --host, matching the title.

Full details: Description check

Explanation

The description gives the cause, the fix, test evidence, and what was not verified. It does not follow the repository template: the 'Fixes #' issue link is missing, the Type of change checkboxes are not marked, the AI assistance section is absent, and the Testing section does not state whether an integration (e2e) test was added or why none is needed. The Checklist and Notes sections are also missing. The description covers the core content, so the check passes with these gaps noted.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4dc7be0c-2119-4adf-ade7-de91ea4b7113
Commits

Reviewing files that changed from the base of the PR and between cbca209 and 51c4a30.

Files selected for processing: 2

  • pkg/flatpak/flatpak.go
  • pkg/flatpak/flatpak_test.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@netlify

netlify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 51c4a30
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6af698b264065be93c17e41b

@skevetter

Copy link
Copy Markdown
Contributor Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds --directory when starting the host CLI through flatpak-spawn.

  • Flatpak host commands start from a host-usable folder.

No actionable issues found. No tests or real Flatpak launch were run during this review.

Reviews (1) · Last reviewed commit: "fix(flatpak): start host process in a ho..." · Reviewed by Greptile

@skevetter

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Action performed

Full review finished.

@skevetter
skevetter marked this pull request as ready for review November 13, 2026 16:09
@mergify

mergify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@skevetter
skevetter merged commit 15d9065 into main Nov 13, 2026
39 checks passed
@skevetter
skevetter deleted the fix/1836-flatpak-reexec-sandbox-cwd branch November 13, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ReexecOnHost fails with "Portal call failed" when devsy runs from a Flatpak sandbox cwd that does not exist on the host

1 participant