-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: https://github.com/wailsapp/wails/issues/4636 #4682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3-alpha
Are you sure you want to change the base?
Conversation
WalkthroughThe build assets extraction process has been refactored to use a two-stage workflow: assets are first extracted into a temporary directory, then plist files are merged with existing target plists and non-plist files are copied over. This includes new plist parsing and merging helper functions. Test coverage for plist merging has been added. Changes
Sequence DiagramsequenceDiagram
participant Caller
participant BuildAssets as BuildAssets<br/>(UpdateBuildAssets)
participant TempDir as Temp Directory
participant PlistMerge as Plist Merge<br/>Workflow
participant FileCopy as File Copy<br/>Workflow
participant Target as Target Directory
Caller->>BuildAssets: UpdateBuildAssets(opts)
BuildAssets->>TempDir: Create temp directory
BuildAssets->>TempDir: Extract all assets
BuildAssets->>PlistMerge: Walk temp dir for plist files
loop For each plist file
PlistMerge->>PlistMerge: Parse new plist content
PlistMerge->>Target: Read existing plist (if exists)
PlistMerge->>PlistMerge: Merge content
PlistMerge->>Target: Write merged plist with indentation
end
BuildAssets->>FileCopy: Walk temp dir for non-plist files
loop For each non-plist file
FileCopy->>Target: Copy file (preserve mode & path)
end
BuildAssets->>TempDir: Cleanup temp directory
BuildAssets-->>Caller: Complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
✨ 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
v3/internal/commands/build-assets_test.go (1)
270-352: Consider expanding test coverage for edge cases.The test effectively verifies basic plist merging (updated keys and preserved keys), but additional test cases would strengthen confidence:
- New plist file creation (when target doesn't exist)
- Multiple plist files in nested directories
- Non-plist file copying (files other than .plist)
- Nested dictionary handling
- Array value merging
- Error scenarios (malformed plist, I/O errors)
These additions would help catch regressions and clarify expected behavior for edge cases.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
v3/internal/commands/build-assets.go(3 hunks)v3/internal/commands/build-assets_test.go(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
v3/internal/commands/build-assets_test.go (1)
v3/internal/commands/build-assets.go (2)
UpdateBuildAssetsOptions(63-76)UpdateBuildAssets(194-281)
⏰ 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). (4)
- GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
- GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
- GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (6)
v3/internal/commands/build-assets.go (5)
16-16: LGTM!The plist library import is appropriate for the new merge functionality.
255-274: Well-structured two-phase extraction workflow.The temporary directory approach cleanly separates extraction from merging, allowing plist files to be merged while other files are copied directly. Error handling and cleanup are properly implemented.
287-324: Verify shallow merge behavior meets requirements.The merge logic performs a shallow (non-recursive) merge where each key from the new plist completely overwrites the corresponding key in the existing plist. If a key's value is a nested dictionary, the entire nested dictionary is replaced, not merged recursively.
Example:
- Existing:
{"LSApplicationQueriesSchemes": ["http", "https", "custom"]}- New:
{"LSApplicationQueriesSchemes": ["http"]}- Result:
{"LSApplicationQueriesSchemes": ["http"]}←"https"and"custom"are lostConfirm this aligns with the intended merge semantics for build assets. If users have custom nested configurations they want to preserve while updating top-level keys, a recursive merge would be needed.
326-362: LGTM!The directory walk, filtering, path computation, and merge invocation are all correctly implemented with proper error handling.
364-400: LGTM!The function correctly copies non-plist files while preserving file modes and directory structure. The inverse filtering logic (.plist files excluded) properly complements
mergePlistFiles.v3/internal/commands/build-assets_test.go (1)
9-9: LGTM!The plist import is necessary for unmarshaling and validating the merged plist content in the test.
|



Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #4636
Type of change
Please select the option that is relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using
wails doctor.If you checked Linux, please specify the distro and version.
Test Configuration
Please paste the output of
wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.Checklist:
website/src/pages/changelog.mdxwith details of this PRSummary by CodeRabbit
New Features
Bug Fixes
Tests