Skip to content

Conversation

@fahim-ahmed05
Copy link
Contributor

@fahim-ahmed05 fahim-ahmed05 commented Nov 4, 2025

Summary

  • Migrate userdata from previous non scoop installation.
  • Create a junction link to userdata in localappdata, so that if the browser is started from its exe it don't create new userdata folder.
  • Removes the junction link when browser is uninstalled.
  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

Summary by CodeRabbit

  • New Features
    • Automated user-data migration during installation to preserve existing settings and files by relocating data to the app’s persistent directory, ensuring continuity after upgrade and handling migration errors gracefully.
    • Automatic cleanup during uninstallation to remove legacy filesystem links and reduce residual artifacts, resulting in a cleaner system state after removal.

@coderabbitai
Copy link

coderabbitai bot commented Nov 4, 2025

Warning

Rate limit exceeded

@fahim-ahmed05 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 6c90f5e and fc58dbb.

📒 Files selected for processing (1)
  • bucket/helium.json (1 hunks)

Walkthrough

Added two top-level public manifest fields to bucket/helium.json: post_install (PowerShell script to migrate User Data from AppData to the persist directory, manage directories and junctions) and post_uninstall (PowerShell script to remove the AppData junction if present).

Changes

Cohort / File(s) Summary
Manifest configuration
bucket/helium.json
Added top-level post_install PowerShell script to migrate User Data from AppData to the persist directory (create dirs, create junction if missing, move files) and post_uninstall script to remove the AppData junction if it exists and is a junction.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Installer
    participant Manifest as "helium.json"
    participant PowerShell
    participant FS as "File System"

    rect rgb(230,245,255)
    Installer->>Manifest: invoke post_install
    Manifest->>PowerShell: run migration script
    end

    rect rgb(235,255,230)
    PowerShell->>FS: ensure persist dir exists
    PowerShell->>FS: ensure AppData dir exists
    PowerShell->>FS: check/create junction (AppData -> persist)
    PowerShell->>FS: move user files to persist
    end

    rect rgb(255,240,240)
    Installer->>Manifest: invoke post_uninstall
    Manifest->>PowerShell: run uninstall script
    PowerShell->>FS: if junction exists and is junction -> remove junction
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review PowerShell quoting and edge-case checks.
  • Verify junction creation/removal idempotency and correct use of persist path variables.

Possibly related PRs

Suggested reviewers

  • aliesbelik
  • z-Fng

Poem

🐰 I hopped through folders, soft and bright,
I braided paths from AppData to light,
A tiny junction stitched old home to new,
I moved the carrots and tidied the queue,
Now bytes sleep sound beneath the moonlight. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'helium@0.5.8.1: Add data migration' clearly and concisely describes the main change: adding data migration functionality to the helium package version 0.5.8.1.
Description check ✅ Passed The description includes a summary section explaining the migration objectives, and the author checked both checkboxes confirming use of conventional PR title format and reading the Contributing Guide, meeting template requirements.

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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Your changes did not pass all checks.

Please address the issues in the manifest and comment starting with /verify to rerun the checks.

helium

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

Copy link

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a281ec2 and ee8b107.

📒 Files selected for processing (1)
  • bucket/helium.json (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:24:17.524Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Capture and Playlist folders are created at runtime (after running the application), not included in the installer, so they should only be in the persist list and not in post_install scripts.
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:15:55.229Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Model and Engine folders are created at runtime (not included in the installer), so they should only be in the persist list and not in post_install scripts that handle .original directories.
📚 Learning: 2025-10-14T11:24:17.524Z
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:24:17.524Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Capture and Playlist folders are created at runtime (after running the application), not included in the installer, so they should only be in the persist list and not in post_install scripts.

Applied to files:

  • bucket/helium.json
📚 Learning: 2025-10-14T11:15:55.229Z
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:15:55.229Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Model and Engine folders are created at runtime (not included in the installer), so they should only be in the persist list and not in post_install scripts that handle .original directories.

Applied to files:

  • bucket/helium.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: WindowsPowerShell
🔇 Additional comments (1)
bucket/helium.json (1)

47-51: Safe implementation of post_uninstall script.

The script correctly checks that the path is a junction before attempting removal, with proper error suppression. This avoids accidentally deleting a real directory.

@fahim-ahmed05
Copy link
Contributor Author

/verify

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

All changes look good.

Wait for review from human collaborators.

helium

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

Copy link

@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: 1

🧹 Nitpick comments (1)
bucket/helium.json (1)

57-62: Verify PowerShell version compatibility of ?. operator syntax.

Line 59 uses the null-coalescing member access operator (?.), which was introduced in PowerShell 6.0. However, Windows 10 (the typical target platform for Scoop) ships with PowerShell 5.1 by default, which does not support this syntax. This could cause a runtime error when post_uninstall executes on systems with PowerShell 5.1.

Consider using a more compatible alternative:

$item = Get-Item $appdata -ErrorAction SilentlyContinue
if ($item -and $item.LinkType -eq 'Junction') {
    Remove-Item $appdata -Force
}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce127dd and 6c90f5e.

📒 Files selected for processing (1)
  • bucket/helium.json (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:24:17.524Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Capture and Playlist folders are created at runtime (after running the application), not included in the installer, so they should only be in the persist list and not in post_install scripts.
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:15:55.229Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Model and Engine folders are created at runtime (not included in the installer), so they should only be in the persist list and not in post_install scripts that handle .original directories.
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:15:55.229Z
Learning: In PotPlayer manifests (bucket/potplayer.json), PotPlayer*.ini files (PotPlayer.ini, PotPlayer64.ini, PotPlayerMini.ini, PotPlayerMini64.ini) work correctly with Scoop's hard links and don't need special handling in post_install scripts.
📚 Learning: 2025-10-14T11:15:55.229Z
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:15:55.229Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Model and Engine folders are created at runtime (not included in the installer), so they should only be in the persist list and not in post_install scripts that handle .original directories.

Applied to files:

  • bucket/helium.json
📚 Learning: 2025-10-14T11:24:17.524Z
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:24:17.524Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Capture and Playlist folders are created at runtime (after running the application), not included in the installer, so they should only be in the persist list and not in post_install scripts.

Applied to files:

  • bucket/helium.json
📚 Learning: 2025-10-13T09:37:06.093Z
Learnt from: o-l-a-v
Repo: ScoopInstaller/Extras PR: 16328
File: bucket/winutil.json:0-0
Timestamp: 2025-10-13T09:37:06.093Z
Learning: When reviewing code in Scoop manifests, always verify the actual file content if the diff appears incomplete or unusual, as diff context can be truncated or displayed incorrectly. The pattern `[string[]](...).ForEach{...}` is commonly used in post_uninstall scripts across the Extras repository.

Applied to files:

  • bucket/helium.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: WindowsPowerShell
🔇 Additional comments (1)
bucket/helium.json (1)

33-56: Post_install migration logic successfully addresses previous data loss concerns.

The updated code handles migration safely with proper error handling (try-catch), verifies the source directory is empty before removal (line 45), and creates the junction only after successful source removal. Redundant checks have been eliminated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant