godot(-mono): Persist user data#17407
Conversation
WalkthroughAdds portable/self-contained handling to Godot manifests: both manifests declare Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Installer
participant PreInstall as "pre_install script"
participant AppData as "AppData\\Godot"
participant Persist as "persist_dir\\editor_data"
participant InstallDir as "Package directory"
Installer->>PreInstall: invoke pre_install
PreInstall->>AppData: Test-Path AppData\\Godot?
PreInstall->>Persist: Test-Path persist_dir\\editor_data?
alt editor_data missing and AppData exists
PreInstall->>Installer: info "[Portable Mode]: Copying user data..."
PreInstall->>Persist: Ensure persist_dir exists
PreInstall->>AppData: Copy-Item AppData\\Godot -> persist_dir\\editor_data
PreInstall->>Installer: warn "godot and godot-mono now use separate persistent stores"
end
PreInstall->>InstallDir: New-Item ._sc_ (create marker)
Installer->>PreInstall: pre_install complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
|
All changes look good. Wait for review from human collaborators. godot-mono
godot
|
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 `@bucket/godot-mono.json`:
- Around line 29-34: The wildcard Copy-Item from "$env:AppData\\Godot\\*" can
fail when the source folder exists but is empty; change the migration to first
enumerate the source with Get-ChildItem (e.g., $items = Get-ChildItem -Path
"$env:AppData\\Godot" -Force -ErrorAction SilentlyContinue) and only call
Copy-Item (or loop Copy-Item per item) if $items has any entries; update the
block around ensure "$persist_dir\\editor_data" and the Copy-Item invocation so
the copy is skipped when the source contains no items to avoid the
non-terminating error.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 22563162-0c65-41a1-b0aa-2040a7299e11
📒 Files selected for processing (2)
bucket/godot-mono.jsonbucket/godot.json
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
bucket/godot.json (1)
23-27:⚠️ Potential issue | 🟠 MajorApply the same non-destructive migration here.
Line 27 has the same first-package-wins behavior as
bucket/godot-mono.json: oncegodotmoves$env:AppData\Godot, the companion manifest or any other Godot install no longer sees the existing editor state. Please switch this block to the same copy-based migration.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bucket/godot.json` around lines 23 - 27, The migration block currently performs a destructive Move-Item of "$env:AppData\Godot" into $persist_dir\editor_data (first-package-wins); change it to a non-destructive copy-based migration like the one used in the companion manifest (godot-mono.json): instead of Move-Item, use a copy operation that preserves the source (ensuring $persist_dir exists with ensure $persist_dir) and merge contents into $persist_dir\editor_data (e.g., Copy-Item with recursion/overwrite semantics and appropriate checks so files are copied only when destination files are absent or intentionally overwritten), keeping the same log messages and variables ($persist_dir, editor_data) and removing the destructive Move-Item call.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@bucket/godot-mono.json`:
- Around line 35-39: The current pre_install uses Move-Item to migrate
$env:AppData\Godot into the package's persist ($persist_dir) which is
destructive; change the migration in the block that references ensure
$persist_dir and Move-Item to instead copy the contents (e.g., use Copy-Item
-Path "$env:AppData\Godot\*" -Destination "$persist_dir\editor_data" -Recurse
-Force) so the original AppData folder remains intact, and remove any redundant
pre-copy item-count guard since copying with wildcard and -Recurse -Force is
sufficient.
---
Duplicate comments:
In `@bucket/godot.json`:
- Around line 23-27: The migration block currently performs a destructive
Move-Item of "$env:AppData\Godot" into $persist_dir\editor_data
(first-package-wins); change it to a non-destructive copy-based migration like
the one used in the companion manifest (godot-mono.json): instead of Move-Item,
use a copy operation that preserves the source (ensuring $persist_dir exists
with ensure $persist_dir) and merge contents into $persist_dir\editor_data
(e.g., Copy-Item with recursion/overwrite semantics and appropriate checks so
files are copied only when destination files are absent or intentionally
overwritten), keeping the same log messages and variables ($persist_dir,
editor_data) and removing the destructive Move-Item call.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 68e99617-fc32-41ea-ad37-9b646503a4d6
📒 Files selected for processing (2)
bucket/godot-mono.jsonbucket/godot.json
|
/verify |
|
All changes look good. Wait for review from human collaborators. godot-mono
godot
|
|
Please also sync these changes to the following manifests in the Versions bucket:
|
Converts
godotandgodot-monomanifests to use the portable mode (self-contained feature in godot)Closes #13483
Relates to #13484
Changes:
._sc_file to activate the portable mode of godot(-mono) according to https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html#self-contained-mode$env:AppData\\Godotto the persisted direditor_datathe first time the manifest is installed/updated only.NET SDKruntime dependency as a suggestion togodot-monoIssues
⚠️ Currently both manifests
godotandgodot-monouse the same$env:AppData\\Godotfolder. By implementing these changes the current behavior for users using both packages is changed. They will have separate setting stores. According to their documentation "The Steam release of Godot uses self-contained mode by default.", so this type of separated storage behavior betweengodotandgodot-monoseems to be acceptable.Tests
✅Tested clean install of both packages
✅Tested update procedure
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
Improvements