build: refactor Flatpak packaging to use online builds and force X11 …#339
build: refactor Flatpak packaging to use online builds and force X11 …#339rainxchzed merged 16 commits intomainfrom
Conversation
…backend - Enable network access during the Flatpak build process to allow Gradle to download dependencies directly. - Remove pre-downloaded Gradle distribution and the offline `flatpak-sources.json` dependency list. - Switch the build command from `packageReleaseUberJarForCurrentOS` to `packageUberJarForCurrentOS` to avoid ProGuard duplicate jar conflicts. - Force `GDK_BACKEND=x11` in the launch script to improve reliability for Skiko/Compose on Wayland environments. - Enhance `disable-android-for-flatpak.sh` to more aggressively strip Android-specific configuration blocks (`androidMain`, `debugImplementation`) across all project modules. - Refactor the `RoomConventionPlugin` within the Flatpak build logic to remove Android-specific KSP dependencies. - Update the Flatpak manifest to point to the latest commit for version 1.6.2.
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughFlatpak packaging and runtime changes: broadened Android-removal in build scripts, added a non‑Android Room convention plugin, forced X11 for the bundled app, allowed network during Flatpak builds, simplified Flatpak sources, and added Flatpak-aware install detection and helpers in the desktop installer. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packaging/flatpak/disable-android-for-flatpak.sh (1)
256-285: Avoid forkingRoomConventionPlugin.ktinside this patch script.These lines create a second full copy of
build-logic/convention/src/main/kotlin/RoomConventionPlugin.kt. Any later Room convention change will land in normal builds but be silently skipped by Flatpak builds. Prefer a targeted edit that removes only the Android-specific KSP wiring, like the smaller patches above.Based on learnings: Use convention plugins from
build-logic/convention/for module setup:convention.kmp.library,convention.cmp.library,convention.cmp.feature,convention.cmp.application,convention.room,convention.buildkonfig🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packaging/flatpak/disable-android-for-flatpak.sh` around lines 256 - 285, This patch currently forks RoomConventionPlugin by writing a full duplicate file (creating RoomConventionPlugin.kt) which will diverge from build-logic/convention; instead, change the script to perform a targeted edit on the existing RoomConventionPlugin in build-logic/convention: remove only the Android/KSP-specific wiring — i.e., delete or conditionalize the apply("com.google.devtools.ksp") call and the "kspJvm"(libs.findLibrary("androidx-room-compiler").get()) dependency while keeping the RoomExtension.schemaDirectory and commonMainApi lines intact — so that you do not create a second copy and Flatpak builds reuse the canonical RoomConventionPlugin implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packaging/flatpak/githubstore.sh`:
- Around line 11-13: The script currently force-sets GDK_BACKEND to x11; change
it to only default to x11 when GDK_BACKEND is not already defined so
Wayland-only users can override it. Locate the export of GDK_BACKEND (symbol:
GDK_BACKEND) and modify the assignment to use the existing environment value if
present (i.e., leave GDK_BACKEND alone when set, otherwise set it to x11) so the
manifest's Wayland socket access can be used when desired.
In `@packaging/flatpak/zed.rainxch.githubstore.yml`:
- Around line 52-60: Remove the sed replacement that rewrites distributionUrl to
gradle-bin.zip in the build-commands (the line that runs sed on
gradle/wrapper/gradle-wrapper.properties); since --share=network is enabled the
wrapper should download the distribution from the original URL, so delete or
comment out that sed invocation and keep the remaining build-commands (including
disable-android-for-flatpak.sh and ./gradlew
:composeApp:packageUberJarForCurrentOS) intact.
---
Nitpick comments:
In `@packaging/flatpak/disable-android-for-flatpak.sh`:
- Around line 256-285: This patch currently forks RoomConventionPlugin by
writing a full duplicate file (creating RoomConventionPlugin.kt) which will
diverge from build-logic/convention; instead, change the script to perform a
targeted edit on the existing RoomConventionPlugin in build-logic/convention:
remove only the Android/KSP-specific wiring — i.e., delete or conditionalize the
apply("com.google.devtools.ksp") call and the
"kspJvm"(libs.findLibrary("androidx-room-compiler").get()) dependency while
keeping the RoomExtension.schemaDirectory and commonMainApi lines intact — so
that you do not create a second copy and Flatpak builds reuse the canonical
RoomConventionPlugin implementation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 91ef71f0-d5fd-4ccd-b1bf-aec2f23aa629
📒 Files selected for processing (4)
packaging/flatpak/disable-android-for-flatpak.shpackaging/flatpak/flatpak-sources.jsonpackaging/flatpak/githubstore.shpackaging/flatpak/zed.rainxch.githubstore.yml
packaging/flatpak/githubstore.sh
Outdated
| # Force X11 (via XWayland on Wayland) — Skiko/Compose doesn't yet | ||
| # reliably support native Wayland drawing surfaces with JBR. | ||
| export GDK_BACKEND=x11 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Check if the file exists and read the relevant section
fd -t f "githubstore.sh" packaging/flatpak/ 2>/dev/null && \
echo "=== File content (lines 1-20) ===" && \
head -20 packaging/flatpak/githubstore.shRepository: OpenHub-Store/GitHub-Store
Length of output: 851
🏁 Script executed:
# Also check for the manifest file mentioned
find packaging/flatpak -type f -name "*.json" -o -name "*manifest*" -o -name "*.yml" | head -10Repository: OpenHub-Store/GitHub-Store
Length of output: 154
🏁 Script executed:
# Look for all relevant shell scripts in the flatpak directory
ls -la packaging/flatpak/Repository: OpenHub-Store/GitHub-Store
Length of output: 656
🏁 Script executed:
cat packaging/flatpak/zed.rainxch.githubstore.ymlRepository: OpenHub-Store/GitHub-Store
Length of output: 3463
Allow GDK_BACKEND to be overridden for Wayland-only sessions.
Line 13 hard-codes GDK_BACKEND=x11, preventing users on Wayland-only systems without XWayland from overriding it when the app fails to start. The manifest already grants Wayland socket access. While defaulting to X11 is reasonable due to current Skiko/Compose limitations, allow environment override so Wayland-only users can attempt workarounds.
Suggested change
-export GDK_BACKEND=x11
+export GDK_BACKEND="${GDK_BACKEND:-x11}"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Force X11 (via XWayland on Wayland) — Skiko/Compose doesn't yet | |
| # reliably support native Wayland drawing surfaces with JBR. | |
| export GDK_BACKEND=x11 | |
| # Force X11 (via XWayland on Wayland) — Skiko/Compose doesn't yet | |
| # reliably support native Wayland drawing surfaces with JBR. | |
| export GDK_BACKEND="${GDK_BACKEND:-x11}" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packaging/flatpak/githubstore.sh` around lines 11 - 13, The script currently
force-sets GDK_BACKEND to x11; change it to only default to x11 when GDK_BACKEND
is not already defined so Wayland-only users can override it. Locate the export
of GDK_BACKEND (symbol: GDK_BACKEND) and modify the assignment to use the
existing environment value if present (i.e., leave GDK_BACKEND alone when set,
otherwise set it to x11) so the manifest's Wayland socket access can be used
when desired.
| build-args: | ||
| - --share=network | ||
| build-commands: | ||
| # Use local Gradle distribution (no network in sandbox) | ||
| - sed -i 's|distributionUrl=.*|distributionUrl=gradle-bin.zip|' gradle/wrapper/gradle-wrapper.properties | ||
| # Disable Android targets (no Android SDK in Flatpak sandbox) | ||
| - bash packaging/flatpak/disable-android-for-flatpak.sh | ||
| # Build uber JAR | ||
| - ./gradlew :composeApp:packageReleaseUberJarForCurrentOS | ||
| # Build uber JAR (using non-release to avoid ProGuard duplicate jar conflicts) | ||
| - ./gradlew :composeApp:packageUberJarForCurrentOS |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Confirm the manifest still rewrites the wrapper to a local ZIP.
sed -n '52,60p' packaging/flatpak/zed.rainxch.githubstore.yml
echo
# Show the wrapper URL that exists in the repository before the Flatpak patch runs.
grep -n 'distributionUrl' gradle/wrapper/gradle-wrapper.properties
echo
# If this prints nothing, the manifest is forcing a local ZIP that is no longer staged.
find . -name 'gradle-bin.zip' -printRepository: OpenHub-Store/GitHub-Store
Length of output: 663
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check if the disable-android-for-flatpak.sh script exists
ls -la packaging/flatpak/disable-android-for-flatpak.sh
echo "---"
# Check the full sources section of the githubstore module in the manifest
# to see if gradle-bin.zip is referenced anywhere
sed -n '40,75p' packaging/flatpak/zed.rainxch.githubstore.ymlRepository: OpenHub-Store/GitHub-Store
Length of output: 1842
Remove the sed command that forces a non-existent local Gradle distribution.
Line 56 rewrites distributionUrl to gradle-bin.zip, but this file is not staged in the manifest. With --share=network enabled, Gradle should fetch the distribution from the internet using the original URL in gradle/wrapper/gradle-wrapper.properties. The current sed command causes the build to fail immediately.
Suggested fix
- # Use local Gradle distribution (no network in sandbox)
- - sed -i 's|distributionUrl=.*|distributionUrl=gradle-bin.zip|' gradle/wrapper/gradle-wrapper.properties
+ # Keep the repository's wrapper URL so Gradle can fetch its own distribution📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| build-args: | |
| - --share=network | |
| build-commands: | |
| # Use local Gradle distribution (no network in sandbox) | |
| - sed -i 's|distributionUrl=.*|distributionUrl=gradle-bin.zip|' gradle/wrapper/gradle-wrapper.properties | |
| # Disable Android targets (no Android SDK in Flatpak sandbox) | |
| - bash packaging/flatpak/disable-android-for-flatpak.sh | |
| # Build uber JAR | |
| - ./gradlew :composeApp:packageReleaseUberJarForCurrentOS | |
| # Build uber JAR (using non-release to avoid ProGuard duplicate jar conflicts) | |
| - ./gradlew :composeApp:packageUberJarForCurrentOS | |
| build-args: | |
| - --share=network | |
| build-commands: | |
| # Keep the repository's wrapper URL so Gradle can fetch its own distribution | |
| # Disable Android targets (no Android SDK in Flatpak sandbox) | |
| - bash packaging/flatpak/disable-android-for-flatpak.sh | |
| # Build uber JAR (using non-release to avoid ProGuard duplicate jar conflicts) | |
| - ./gradlew :composeApp:packageUberJarForCurrentOS |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packaging/flatpak/zed.rainxch.githubstore.yml` around lines 52 - 60, Remove
the sed replacement that rewrites distributionUrl to gradle-bin.zip in the
build-commands (the line that runs sed on
gradle/wrapper/gradle-wrapper.properties); since --share=network is enabled the
wrapper should download the distribution from the original URL, so delete or
comment out that sed invocation and keep the remaining build-commands (including
disable-android-for-flatpak.sh and ./gradlew
:composeApp:packageUberJarForCurrentOS) intact.
Change flatpak - force X11 backend and update build sources for development
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packaging/flatpak/zed.rainxch.githubstore.yml`:
- Around line 51-55: Update the misleading comment in the build-commands block:
replace "Use local Gradle distribution (no network in sandbox)" with a note that
the Gradle distribution is pre-downloaded for reproducible builds and that
sandbox network access is enabled via the build-args (--share=network) so
dependency resolution may use the network; ensure the comment sits next to the
sed line modifying gradle/wrapper/gradle-wrapper.properties so readers
understand the wrapper points to a local gradle-bin.zip while network access
remains available for dependencies.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b6ec47a8-4df7-4b4c-92dd-232bbc1634e1
📒 Files selected for processing (2)
packaging/flatpak/githubstore.shpackaging/flatpak/zed.rainxch.githubstore.yml
- Implement Flatpak detection by checking `/.flatpak-info` and environment variables. - Add host OS detection from within Flatpak by reading `/run/host/os-release`. - Update asset filtering to prefer native packages (`.deb`, `.rpm`) over AppImages when running in Flatpak due to FUSE limitations. - Implement a delegated installation flow using `xdg-open` portals to hand off package installation to the host system. - Add desktop notification support for Flatpak using `notify-send` via the notifications portal. - Skip executable permission checks for Linux downloads when sandboxed.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt`:
- Around line 516-535: The Flatpak AppImage branch only sets the executable bit
and shows a notification but the fallback shell commands are fragile and
directory-dependent; update the notification text to use the absolute path
(file.absolutePath) for both chmod and execution and make the path shell-safe by
escaping single quotes (e.g., implement a small helper like shellEscape(path:
String) and use it when building the message), and avoid suggesting "./" which
assumes current dir; also make it clear Install will not auto-open the host app
(leave launch to user) and consider adding a "Show in Files" / open-folder hint
in the notification (reference showFlatpakNotification, file.setExecutable,
file.absolutePath, file.name and add a shellEscape helper).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3a0f215a-f977-4569-84f9-355923d3e511
📒 Files selected for processing (1)
core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt
core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt
Show resolved
Hide resolved
- Implement `openInFileManager` to highlight downloaded files using D-Bus `org.freedesktop.FileManager1.ShowItems`, with a fallback to `xdg-open` on the parent directory. - Update Flatpak notification messages to be more concise, removing absolute file paths in favor of automatically opening the file manager. - Refactor package installation and AppImage handling to trigger the file manager focus after download. - Simplify the fallback case for unknown file types to notify the user and open the download location.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt`:
- Around line 582-604: The openInFileManager method currently attempts a gdbus
ProcessBuilder call to org.freedesktop.FileManager1 which will fail inside
Flatpak unless the manifest includes --talk-name=org.freedesktop.FileManager1,
and it constructs a GVariant string by interpolating fileUri unsafely
(vulnerable to single-quote/] injection). Fix by either removing this D-Bus
branch and relying on xdg-open, or ensure the Flatpak manifest grants
talk-name=org.freedesktop.FileManager1; if keeping the gdbus call, sanitize the
path before building the GVariant: compute an escapedPath from file.absolutePath
that replaces single quotes and other problematic chars (e.g., replace "'" with
"\\'") and use that escaped value when constructing the GVariant argument passed
to ProcessBuilder (identify openInFileManager, fileUri/escapedPath, and the
ProcessBuilder call to locate the code).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: aa7628f7-8b01-4f72-8362-b946fdc449f0
📒 Files selected for processing (1)
core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt
| private fun openInFileManager(file: File) { | ||
| try { | ||
| // D-Bus call to org.freedesktop.FileManager1.ShowItems — this highlights | ||
| // the specific file in the file manager. Works via Flatpak portal. | ||
| val fileUri = "file://${file.absolutePath}" | ||
| val process = ProcessBuilder( | ||
| "gdbus", "call", | ||
| "--session", | ||
| "--dest", "org.freedesktop.FileManager1", | ||
| "--object-path", "/org/freedesktop/FileManager1", | ||
| "--method", "org.freedesktop.FileManager1.ShowItems", | ||
| "['$fileUri']", "", | ||
| ).start() | ||
| val exitCode = process.waitFor() | ||
|
|
||
| if (exitCode == 0) { | ||
| Logger.d { "Opened file manager via D-Bus ShowItems: ${file.absolutePath}" } | ||
| return | ||
| } | ||
| Logger.w { "D-Bus ShowItems failed with exit code $exitCode" } | ||
| } catch (e: Exception) { | ||
| Logger.w { "D-Bus ShowItems not available: ${e.message}" } | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if FileManager1 D-Bus permission is declared
grep -r "FileManager1" packaging/flatpak/ 2>/dev/null || echo "No FileManager1 permission found"
echo "---"
# Check finish-args for talk-name permissions
grep -A 30 "finish-args" packaging/flatpak/zed.rainxch.githubstore.yml | grep "talk-name" || echo "No talk-name permissions declared"Repository: OpenHub-Store/GitHub-Store
Length of output: 140
🏁 Script executed:
#!/bin/bash
# Check if file exists and get line count
if [ -f "core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt" ]; then
wc -l "core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt"
else
echo "File not found at expected path"
# Try to find it
find . -name "DesktopInstaller.kt" 2>/dev/null
fiRepository: OpenHub-Store/GitHub-Store
Length of output: 154
🏁 Script executed:
#!/bin/bash
# Read the openInFileManager method context (lines 575-614)
if [ -f "core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt" ]; then
echo "=== Lines 575-614 ==="
sed -n '575,614p' "core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt"
else
echo "File not found, searching..."
find . -name "DesktopInstaller.kt" -exec echo "Found: {}" \; -exec head -650 {} \; 2>/dev/null | tail -100
fiRepository: OpenHub-Store/GitHub-Store
Length of output: 1794
🏁 Script executed:
#!/bin/bash
# Verify package naming compliance with coding guideline: zed.rainxch.{module}.{layer}
grep -n "^package " "core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt" 2>/dev/null || echo "Package declaration not found"Repository: OpenHub-Store/GitHub-Store
Length of output: 110
D-Bus FileManager1 call will fail in Flatpak; GVariant argument is injection-vulnerable.
Two issues:
-
Missing D-Bus permission: The code comment claims the D-Bus call "works via Flatpak portal," but this is misleading. The
org.freedesktop.FileManager1service is not a Flatpak portal — it requires explicit--talk-name=org.freedesktop.FileManager1in the manifest'sfinish-args. This permission is not currently declared, so thegdbus callwill fail with a permission error and always fall back toxdg-open. Either add the permission to the manifest, or remove this dead code path entirely and rely solely onxdg-open. -
GVariant format injection: The file URI is interpolated directly into
['$fileUri']. Paths containing'or]will break GVariant parsing. For example, a file namedapp'name.debproduces['file:///path/app'name.deb']with unbalanced quotes. Escape single quotes in the path:val escapedPath = file.absolutePath.replace("'", "\\'")and use it in the GVariant argument.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt`
around lines 582 - 604, The openInFileManager method currently attempts a gdbus
ProcessBuilder call to org.freedesktop.FileManager1 which will fail inside
Flatpak unless the manifest includes --talk-name=org.freedesktop.FileManager1,
and it constructs a GVariant string by interpolating fileUri unsafely
(vulnerable to single-quote/] injection). Fix by either removing this D-Bus
branch and relying on xdg-open, or ensure the Flatpak manifest grants
talk-name=org.freedesktop.FileManager1; if keeping the gdbus call, sanitize the
path before building the GVariant: compute an escapedPath from file.absolutePath
that replaces single quotes and other problematic chars (e.g., replace "'" with
"\\'") and use that escaped value when constructing the GVariant argument passed
to ProcessBuilder (identify openInFileManager, fileUri/escapedPath, and the
ProcessBuilder call to locate the code).
# Conflicts: # core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt
There was a problem hiding this comment.
🧹 Nitpick comments (1)
core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt (1)
264-299: Consider extracting shared distro classification logic.The distro classification (checking ID/ID_LIKE for Debian/RPM-based systems) is duplicated between
detectHostLinuxPackageTypeanddetermineLinuxPackageType. A small helper could reduce duplication:private fun classifyDistro(id: String, idLike: String): LinuxPackageType { if (id in listOf("debian", "ubuntu", "linuxmint", "pop", "elementary") || idLike.contains("debian") || idLike.contains("ubuntu")) { return LinuxPackageType.DEB } if (id in listOf("fedora", "rhel", "centos", "rocky", "almalinux", "opensuse", "suse") || idLike.contains("fedora") || idLike.contains("rhel") || idLike.contains("suse") || idLike.contains("centos")) { return LinuxPackageType.RPM } return LinuxPackageType.UNIVERSAL }Otherwise, the approach of reading
/run/host/os-releasefor Flatpak is correct.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt` around lines 264 - 299, Extract the duplicated distro classification logic into a private helper (e.g., classifyDistro(id: String, idLike: String): LinuxPackageType) and replace the inlined ID/ID_LIKE checks in both detectHostLinuxPackageType() and determineLinuxPackageType() to call that helper; ensure the helper returns LinuxPackageType.DEB for Debian/Ubuntu family checks, LinuxPackageType.RPM for Fedora/RHEL/SUSE families, and LinuxPackageType.UNIVERSAL otherwise, and keep the existing logging in the caller functions (or add minimal caller-specific logs) so behavior and return values remain identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt`:
- Around line 264-299: Extract the duplicated distro classification logic into a
private helper (e.g., classifyDistro(id: String, idLike: String):
LinuxPackageType) and replace the inlined ID/ID_LIKE checks in both
detectHostLinuxPackageType() and determineLinuxPackageType() to call that
helper; ensure the helper returns LinuxPackageType.DEB for Debian/Ubuntu family
checks, LinuxPackageType.RPM for Fedora/RHEL/SUSE families, and
LinuxPackageType.UNIVERSAL otherwise, and keep the existing logging in the
caller functions (or add minimal caller-specific logs) so behavior and return
values remain identical.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5166e9b9-5fee-4cc1-9cf7-611384afa6da
📒 Files selected for processing (1)
core/data/src/jvmMain/kotlin/zed/rainxch/core/data/services/DesktopInstaller.kt
… installation - Clear `cachedDownloadAssetName` on non-Android platforms when a file is installed or handed off to the system. - Prevents the `onCleared()` lifecycle method from deleting the downloaded asset once it has been saved to the user's downloads or installed.
- Update Flatpak manifest to support fully offline builds by removing network access during the build stage. - Configure Gradle to use a pre-populated offline Maven repository via `settings.gradle.kts` injection. - Update build commands to use the `--offline` flag and local Gradle distribution. - Switch source from local directory to GitHub repository tagged at version `1.6.2`. - Include `flatpak-sources.json` for pre-downloaded dependencies. - Add branding colors (light and dark schemes) to the AppStream metainfo file.
…-logic resolution - Replace basic `settings.gradle.kts` appending with a Python-based rewriting script for both root and `build-logic` settings. - Configure `pluginManagement` and `dependencyResolutionManagement` to strictly use the local offline repository for all project modules. - Explicitly include `build-logic` and configure its version catalog resolution from `gradle/libs.versions.toml`. - Update build source from a remote Git tag to the local directory for development builds. - Remove the `--offline` flag from the Gradle execution as network isolation is handled by the Flatpak sandbox. - Update comments to clarify Flathub submission requirements for source types.
- Add `flatpak-gradle-generator` plugin to the Version Catalog. - Update the root `flatpakGradleGenerator` task to output to `packaging/flatpak/flatpak-sources.json` and exclude test configurations. - Apply and configure the generator plugin within `build-logic/convention` to generate `flatpak-sources-convention.json`. - Update the Flatpak manifest to include the newly generated convention sources. - Set the generator's download directory to `./offline-repository` for dependency caching.
- Add `ls` and `find` commands to the Flatpak manifest to debug the directory structure and locate `gradle-wrapper.properties` during the build process.
- Add `.gitattributes` to ensure Flatpak packaging files use Unix LF line endings to prevent parsing errors in `flatpak-builder`. - Remove debug `ls` and `find` commands from the Flatpak build manifest.
- Remove `flatpak-sources-convention.json` and `flatpak-sources-manual.json` from the build sources.
…backend
flatpak-sources.jsondependency list.packageReleaseUberJarForCurrentOStopackageUberJarForCurrentOSto avoid ProGuard duplicate jar conflicts.GDK_BACKEND=x11in the launch script to improve reliability for Skiko/Compose on Wayland environments.disable-android-for-flatpak.shto more aggressively strip Android-specific configuration blocks (androidMain,debugImplementation) across all project modules.RoomConventionPluginwithin the Flatpak build logic to remove Android-specific KSP dependencies.Summary by CodeRabbit
New Features
Chores
Style
Bug Fixes