You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(flatpak): start host process in a host-valid directory - #1838
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
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
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.
Cause
ReexecOnHostranflatpak-spawn --hostwithout--directory. A working directory that exists only inside another app's Flatpak sandbox made the portal call fail.Fix
Pass
--directory=<cwd>. Use$HOMEwhen the cwd is under/appor unreadable. Omit the flag if$HOMEis 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