Skip to content

refactor: Moved Proton downloading to launch deps (again, but mirroring original behaviour + tests)#1052

Open
unbelievableflavour wants to merge 4 commits intoutkarshdalal:masterfrom
unbelievableflavour:proton-mirror-previous
Open

refactor: Moved Proton downloading to launch deps (again, but mirroring original behaviour + tests)#1052
unbelievableflavour wants to merge 4 commits intoutkarshdalal:masterfrom
unbelievableflavour:proton-mirror-previous

Conversation

@unbelievableflavour
Copy link
Copy Markdown
Contributor

@unbelievableflavour unbelievableflavour commented Mar 30, 2026

Description

Unreverted the proton refactor and moved launch deps to mirror origina behaviour + removed delete which wasnt previously there.


Summary by cubic

Restores original Proton handling on Bionic by moving launch-dependency checks earlier and encapsulating Proton 9.0 downloads/extraction in BionicDefaultProtonDependency. Reapplies the refactor, removes the deletion step, shows a sync-fail dialog on errors, and adds tests for progress and timing.

  • Refactors
    • Added and registered BionicDefaultProtonDependency to download/extract proton-9.0-arm64ec and proton-9.0-x86_64 into opt/<version> on Bionic when missing; forwards progress and throws on extraction failure.
    • Moved ensureLaunchDependencies(...) earlier in PluviaMain; removed the manual Proton block and the later duplicate call; failures stop launch with a sync-fail dialog.
    • Added tests for applies-to/satisfied checks, early return on unsupported versions, and progress forwarding.

Written for commit 2c604d1. Summary will update on new commits.

Summary by CodeRabbit

  • Refactor

    • Dependency checks now run earlier during app launch; on failure the loading UI is hidden and a sync-fail dialog is shown to stop launch.
    • Removed a legacy Proton download/extraction branch from the later launch flow.
  • New Features

    • Added Proton provisioning for Bionic containers with version-specific messages, download progress forwarding, and extraction when needed.
  • Tests

    • Added tests for Proton dependency applicability, satisfaction, messaging, and download-progress behavior.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

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

ensureLaunchDependencies() is invoked immediately after SplitCompat.install() in preLaunchApp. Inline Proton 9.0 archive download/extract logic was removed from PluviaMain and replaced by a new BionicDefaultProtonDependency registered in LaunchDependencies. Errors during early dependency assurance hide the loader and show DialogType.SYNC_FAIL.

Changes

Cohort / File(s) Summary
Launch flow
app/src/main/java/app/gamenative/ui/PluviaMain.kt
ensureLaunchDependencies() moved to run right after SplitCompat.install(context); removed the later duplicate call and the inline Proton 9.0 download/extract branch.
Dependency registry
app/src/main/java/app/gamenative/utils/LaunchDependencies.kt
Added BionicDefaultProtonDependency to the companion launchDependencies list so it is evaluated during launch dependency checks.
New Proton dependency
app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt
New LaunchDependency for Container.BIONIC proton-9.0 variants: restricts appliesTo to BIONIC/proton-9.0-*, checks opt/<wineVersion>/bin, uses SteamService to verify/download proton-9.0-*.txz, reports progress via LaunchDependencyCallbacks, and extracts via TarCompressorUtils.
Tests
app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt
Added Robolectric/JUnit tests covering appliesTo, isSatisfied, getLoadingMessage, and install (including download progress callback and SteamService interactions).

Sequence Diagram

sequenceDiagram
    participant App as App (preLaunchApp)
    participant Split as SplitCompat
    participant LaunchDeps as LaunchDependencies
    participant Bionic as BionicDefaultProtonDependency
    participant Steam as SteamService
    participant Tar as TarCompressorUtils
    participant FS as ImageFs

    App->>Split: install(context)
    App->>LaunchDeps: ensureLaunchDependencies(context,...)
    LaunchDeps->>Bionic: appliesTo(container, gameSource, gameId)?
    alt applies
        LaunchDeps->>Bionic: isSatisfied(context,...)
        alt not satisfied
            Bionic->>LaunchDeps: getLoadingMessage(...)
            LaunchDeps->>Bionic: install(context, callbacks,...)
            Bionic->>Steam: isFileInstallable(archive)
            alt not installable
                Bionic->>Steam: downloadFile(archive, progressCallback)
                Steam->>FS: write archive
                progressCallback-->>Bionic: progress updates
            end
            Bionic->>Tar: extract(archive, opt/<version>)
            Tar->>FS: create opt/<version>/bin
            Tar-->>Bionic: extraction result
        end
    end
    LaunchDeps-->>App: done
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • phobos665

Poem

🐇
I hopped the startup path, tidy and spry,
Moved Proton to a box where downloads lie.
Dependencies checked, progress leaps and drums,
Bionic finds its bins — the launch drum hums.
Off I bound — a happy rabbit, time to fly! 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive The PR description does not reference any linked issues or GitHub issue numbers that this PR is intended to resolve. Link related GitHub issues to provide context on the original problem and previous refactor attempts being addressed.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: re-applying a Proton refactor by moving it to launch dependencies while mirroring original behavior and adding tests.
Description check ✅ Passed The description provides clear context on what changed and why, with an auto-generated summary explaining the refactor, moved dependencies, and new tests. However, no recording was provided as required by the template.
Out of Scope Changes check ✅ Passed The changes are focused on Proton dependency handling and remain within the declared scope of refactoring launch dependencies and mirroring original behavior.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt (1)

69-69: Minor: Reuse the imageFs variable from line 50.

ImageFs.find(context) is called again at line 69 when the imageFs variable from line 50 could be reused for consistency and minor efficiency.

♻️ Suggested fix
-        val outFile = File(ImageFs.find(context).getRootDir(), "opt/$protonVersion")
+        val outFile = File(imageFs.getRootDir(), "opt/$protonVersion")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt`
at line 69, Replace the redundant ImageFs.find(context) call with the
already-obtained imageFs variable when building outFile: use
imageFs.getRootDir() (or the equivalent accessor used earlier) instead of
calling ImageFs.find(context) again so outFile is created with
File(imageFs.getRootDir(), "opt/$protonVersion"), referencing the existing
imageFs variable and protonVersion in BionicDefaultProtonDependency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt`:
- Line 69: Replace the redundant ImageFs.find(context) call with the
already-obtained imageFs variable when building outFile: use
imageFs.getRootDir() (or the equivalent accessor used earlier) instead of
calling ImageFs.find(context) again so outFile is created with
File(imageFs.getRootDir(), "opt/$protonVersion"), referencing the existing
imageFs variable and protonVersion in BionicDefaultProtonDependency.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1707fd8f-995c-447e-9790-96b3b7dd1b09

📥 Commits

Reviewing files that changed from the base of the PR and between 1cd84b4 and ec934cc.

📒 Files selected for processing (3)
  • app/src/main/java/app/gamenative/ui/PluviaMain.kt
  • app/src/main/java/app/gamenative/utils/LaunchDependencies.kt
  • app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt (1)

69-71: Reuse imageFs variable instead of calling ImageFs.find(context) again.

Line 50 already fetches imageFs, but line 69 calls ImageFs.find(context) a second time. Reuse the existing variable for consistency and to avoid redundant work.

♻️ Suggested fix
-        val outFile = File(ImageFs.find(context).getRootDir(), "opt/$protonVersion")
+        val outFile = File(imageFs.getRootDir(), "opt/$protonVersion")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt`
around lines 69 - 71, The code calls ImageFs.find(context) again when
constructing outFile; reuse the previously obtained imageFs variable instead.
Update the outFile and subsequent paths to use imageFs.getRootDir() (and any
other places using ImageFs.find(context)) so that the existing imageFs value is
used consistently in BionicDefaultProtonDependency (variables: imageFs, outFile,
binDir, needsExtract).
app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt (1)

99-169: Tests cover the download path well; consider adding extraction coverage.

The install tests correctly verify:

  • Unsupported Proton versions don't trigger downloads
  • Download is invoked with correct archive name when file isn't installable
  • Progress callback is properly forwarded

Note: install_downloadsArchive_andForwardsProgress creates binDir (line 130), so the extraction path is intentionally skipped. Consider adding a separate test for the extraction logic (e.g., verifying TarCompressorUtils.extract is called when binDir doesn't exist) for more complete coverage.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt`
around lines 99 - 169, Add a new test alongside
install_downloadsArchive_andForwardsProgress that exercises the extraction path
of BionicDefaultProtonDependency.install: do not create the binDir (use
ImageFs.find(context).rootDir to compute the expected
"opt/proton-9.0-arm64ec/bin" path and ensure it does not exist), mock
SteamService.downloadFile to return a Deferred whose await completes,
mockkStatic(TarCompressorUtils::class) and stub/isolate
TarCompressorUtils.extract, call BionicDefaultProtonDependency.install with the
same parameters, then verify TarCompressorUtils.extract(...) was invoked with
the downloaded archive and the expected destination and that
SteamService.downloadFile was called; reference functions/classes:
BionicDefaultProtonDependency.install, SteamService.downloadFile,
TarCompressorUtils.extract, ImageFs.find.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt`:
- Around line 69-71: The code calls ImageFs.find(context) again when
constructing outFile; reuse the previously obtained imageFs variable instead.
Update the outFile and subsequent paths to use imageFs.getRootDir() (and any
other places using ImageFs.find(context)) so that the existing imageFs value is
used consistently in BionicDefaultProtonDependency (variables: imageFs, outFile,
binDir, needsExtract).

In
`@app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt`:
- Around line 99-169: Add a new test alongside
install_downloadsArchive_andForwardsProgress that exercises the extraction path
of BionicDefaultProtonDependency.install: do not create the binDir (use
ImageFs.find(context).rootDir to compute the expected
"opt/proton-9.0-arm64ec/bin" path and ensure it does not exist), mock
SteamService.downloadFile to return a Deferred whose await completes,
mockkStatic(TarCompressorUtils::class) and stub/isolate
TarCompressorUtils.extract, call BionicDefaultProtonDependency.install with the
same parameters, then verify TarCompressorUtils.extract(...) was invoked with
the downloaded archive and the expected destination and that
SteamService.downloadFile was called; reference functions/classes:
BionicDefaultProtonDependency.install, SteamService.downloadFile,
TarCompressorUtils.extract, ImageFs.find.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a96c929a-66ea-4b37-89dd-546a610a1268

📥 Commits

Reviewing files that changed from the base of the PR and between ec934cc and ccf9a03.

📒 Files selected for processing (4)
  • app/src/main/java/app/gamenative/ui/PluviaMain.kt
  • app/src/main/java/app/gamenative/utils/LaunchDependencies.kt
  • app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt
  • app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/java/app/gamenative/utils/LaunchDependencies.kt

@unbelievableflavour unbelievableflavour changed the title Proton mirror previous behaviour in refactor Moved Proton downloading to launch deps (again, but mirroring original behaviour + tests) Apr 8, 2026
@unbelievableflavour unbelievableflavour changed the title Moved Proton downloading to launch deps (again, but mirroring original behaviour + tests) refactor: Moved Proton downloading to launch deps (again, but mirroring original behaviour + tests) Apr 8, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt (1)

69-69: Reuse the existing imageFs instance.

Line 69 does another ImageFs.find(context) despite already resolving imageFs on Line 50. Reusing the existing value improves clarity and avoids redundant lookup.

♻️ Proposed cleanup
-        val outFile = File(ImageFs.find(context).getRootDir(), "opt/$protonVersion")
+        val outFile = File(imageFs.getRootDir(), "opt/$protonVersion")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt`
at line 69, The code calls ImageFs.find(context) again when creating outFile
even though imageFs was already resolved earlier; change the outFile creation to
reuse the existing imageFs instance (use imageFs.getRootDir() when constructing
outFile) so you avoid the redundant lookup—update the expression that sets
outFile in BionicDefaultProtonDependency.kt to reference the imageFs variable
instead of calling ImageFs.find(context) again.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt`:
- Around line 16-19: The KDoc in BionicDefaultProtonDependency.kt is out of
sync: it claims extraction to imagefs_shared/proton but the implementation
writes to opt/<wineVersion> (see usage of wineVersion and the destination path
construction); update the KDoc to describe the real behavior (that Proton is
downloaded/extracted into opt/<wineVersion> for the BIONIC container variant and
only for proton-9.0-arm64ec or proton-9.0-x86_64), or alternatively change the
extraction target in the code to match the comment—choose and make one source of
truth so the KDoc and the extraction path (where opt/<wineVersion> is
constructed) are consistent.
- Around line 60-65: The call to SteamService.downloadFile uses named arguments
followed by a positional argument (archiveName), which is invalid Kotlin; update
the call site in BionicDefaultProtonDependency (inside the coroutineScope block
where callbacks.setLoadingProgress is used) to pass the file name as a named
parameter (fileName = archiveName) so all parameters are named consistently and
the code compiles.

---

Nitpick comments:
In
`@app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt`:
- Line 69: The code calls ImageFs.find(context) again when creating outFile even
though imageFs was already resolved earlier; change the outFile creation to
reuse the existing imageFs instance (use imageFs.getRootDir() when constructing
outFile) so you avoid the redundant lookup—update the expression that sets
outFile in BionicDefaultProtonDependency.kt to reference the imageFs variable
instead of calling ImageFs.find(context) again.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 93b5c082-0f78-473d-8457-46770e174357

📥 Commits

Reviewing files that changed from the base of the PR and between ccf9a03 and 7f9c0d2.

📒 Files selected for processing (4)
  • app/src/main/java/app/gamenative/ui/PluviaMain.kt
  • app/src/main/java/app/gamenative/utils/LaunchDependencies.kt
  • app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt
  • app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt
  • app/src/main/java/app/gamenative/ui/PluviaMain.kt

@unbelievableflavour unbelievableflavour force-pushed the proton-mirror-previous branch 2 times, most recently from 2243517 to 548e845 Compare April 9, 2026 17:14
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt (1)

74-77: Isolate filesystem side effects between tests.

These tests create real opt/proton-9.0-arm64ec paths but tearDown() doesn’t remove them, which can introduce order-dependent behavior over time.

♻️ Proposed cleanup patch
 class BionicDefaultProtonDependencyTest {
     private lateinit var context: Context
     private lateinit var container: Container
+    private val createdPaths = mutableSetOf<File>()
@@
     `@After`
     fun tearDown() {
+        createdPaths.forEach { it.deleteRecursively() }
         unmockkAll()
     }
@@
         val imageFsRoot = ImageFs.find(context).rootDir
         val binDir = File(imageFsRoot, "opt/proton-9.0-arm64ec/bin")
         binDir.mkdirs()
+        createdPaths += File(imageFsRoot, "opt/proton-9.0-arm64ec")
@@
         val imageFsRoot = ImageFs.find(context).rootDir
         val binDir = File(imageFsRoot, "opt/proton-9.0-arm64ec/bin")
         binDir.mkdirs()
+        createdPaths += File(imageFsRoot, "opt/proton-9.0-arm64ec")

Also applies to: 128-130, 41-44

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt`
around lines 74 - 77, Tests are creating real filesystem paths via
ImageFs.find(context).rootDir and binDir.mkdirs() (in
BionicDefaultProtonDependencyTest) without cleanup; modify the test to isolate
side effects by creating a temporary ImageFs root (or temporary directory) and
point ImageFs to it for the test, or ensure tearDown() deletes the created
"opt/proton-9.0-arm64ec" subtree (remove binDir and parent dirs) after each
test; update the code paths that call ImageFs.find(context).rootDir and
binDir.mkdirs() (and the other occurrences at the indicated lines) to use the
temp root or add removal logic in tearDown() so tests don't leave persistent
files.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt`:
- Around line 74-77: Tests are creating real filesystem paths via
ImageFs.find(context).rootDir and binDir.mkdirs() (in
BionicDefaultProtonDependencyTest) without cleanup; modify the test to isolate
side effects by creating a temporary ImageFs root (or temporary directory) and
point ImageFs to it for the test, or ensure tearDown() deletes the created
"opt/proton-9.0-arm64ec" subtree (remove binDir and parent dirs) after each
test; update the code paths that call ImageFs.find(context).rootDir and
binDir.mkdirs() (and the other occurrences at the indicated lines) to use the
temp root or add removal logic in tearDown() so tests don't leave persistent
files.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 81c479eb-bcc3-459e-b8eb-ba781b566687

📥 Commits

Reviewing files that changed from the base of the PR and between 7f9c0d2 and 548e845.

📒 Files selected for processing (2)
  • app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt
  • app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt (1)

74-77: Isolate filesystem side effects to keep tests order-independent.

These tests create real directories under ImageFs root but never clean them up, which can leak state into other tests.

♻️ Suggested cleanup pattern
 class BionicDefaultProtonDependencyTest {
     private lateinit var context: Context
     private lateinit var container: Container
+    private val createdPaths = mutableListOf<File>()

@@
     `@After`
     fun tearDown() {
+        createdPaths
+            .distinct()
+            .sortedByDescending { it.absolutePath.length }
+            .forEach { it.deleteRecursively() }
         unmockkAll()
     }

@@
         val binDir = File(imageFsRoot, "opt/proton-9.0-arm64ec/bin")
         binDir.mkdirs()
+        createdPaths += File(imageFsRoot, "opt/proton-9.0-arm64ec")

@@
         val binDir = File(imageFsRoot, "opt/proton-9.0-arm64ec/bin")
         binDir.mkdirs()
+        createdPaths += File(imageFsRoot, "opt/proton-9.0-arm64ec")

Also applies to: 128-130, 41-44

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt`
around lines 74 - 77, The test mutates the real ImageFs by creating directories
(using ImageFs.find(context).rootDir and binDir.mkdirs()) and never cleans them
up; modify BionicDefaultProtonDependencyTest to isolate filesystem side effects
by either (a) creating a temporary directory and redirecting
ImageFs.find(context).rootDir to that temp before the test and restoring it
after, or (b) explicitly deleting the created directories (the binDir and any
parent directories you create) in an `@After/`@AfterEach cleanup method; update
all similar uses (lines around 41-44 and 128-130) so tests are order-independent
and leave no state behind.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt`:
- Around line 74-77: The test mutates the real ImageFs by creating directories
(using ImageFs.find(context).rootDir and binDir.mkdirs()) and never cleans them
up; modify BionicDefaultProtonDependencyTest to isolate filesystem side effects
by either (a) creating a temporary directory and redirecting
ImageFs.find(context).rootDir to that temp before the test and restoring it
after, or (b) explicitly deleting the created directories (the binDir and any
parent directories you create) in an `@After/`@AfterEach cleanup method; update
all similar uses (lines around 41-44 and 128-130) so tests are order-independent
and leave no state behind.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 07676269-0ed1-4c75-9ebb-01ebfa80ed88

📥 Commits

Reviewing files that changed from the base of the PR and between 548e845 and 2c604d1.

📒 Files selected for processing (4)
  • app/src/main/java/app/gamenative/ui/PluviaMain.kt
  • app/src/main/java/app/gamenative/utils/LaunchDependencies.kt
  • app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt
  • app/src/test/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependencyTest.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/java/app/gamenative/utils/launchdependencies/BionicDefaultProtonDependency.kt

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