Repository navigation
Add HLKX package merge support - #84
elizashurov wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces functionality to merge multiple HLKX packages into a single package. It adds the merge_hlkx_packages method in Ruby and the corresponding mergehlkxpackages PowerShell function, which handles merging and re-adding extracted drivers and supplemental files. Feedback recommends validating input and escaping single quotes in the Ruby method to prevent command injection, as well as ensuring that $PackageWriter is properly disposed of in the PowerShell script's finally block to avoid resource leaks.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Add a new mergehlkxpackages command that merges two or more HLKX packages into one using the HLK API. Also re-add drivers and supplemental files after the merge, since Merge() alone does not copy them. Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
d2048f3 to
8d43db4
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Command injection risk and incorrect package metadata or partial outputs must be addressed.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (5)
Unescaped paths enable PowerShell command injection · New Driver target and locale associations are incorrectly merged · New Mixed-case failure prefix causes AddDriver errors to be ignored · New Continue after merge failure creates incomplete output package · New Merge command is missing from the Usage action list · New
What changed in this PR
Adds HLKX package merging through the HLK API.
Changes:
- Adds
mergehlkxpackageswith driver and supplemental-file restoration. - Exposes merging through the Ruby client API.
| File | Description |
|---|---|
tools/toolsHCK.ps1 |
Implements and registers package merging. |
lib/rtoolsHCK.rb |
Adds the Ruby merge wrapper. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| cmd_line << "-output '#{output}'" unless output.nil? | ||
| packages.each { |p| cmd_line << "'#{p}'" } |
| foreach ($driverDir in $driverDirs) { | ||
| $ErrorMessages = New-Object System.Collections.Specialized.StringCollection | ||
| $WarningMessages = New-Object System.Collections.Specialized.StringCollection | ||
| $AddDriverResult = $PackageWriter.AddDriver($driverDir.FullName, $symbolsRoot, $TargetList, $LocaleList, [ref]$ErrorMessages, [ref]$WarningMessages) |
| if ($AddDriverResult) { | ||
| Write-Output "Driver re-added from $($driverDir.FullName)" | ||
| } else { | ||
| Write-Output "Warning: driver signability check did not pass for $($driverDir.FullName)" |
| if (-not $MergeResult) { | ||
| $iserror = $true | ||
| foreach ($err in $MergeErrors) { | ||
| if (-Not $json) { | ||
| Write-Output "Warning: $err" | ||
| } else { | ||
| $actionMessages += "Warning: $err" | ||
| } | ||
| } | ||
| } |
| "createprojectpackage", | ||
| "loadplaylist" | ||
| "loadplaylist", | ||
| "mergehlkxpackages" |



Add a new mergehlkxpackages command that merges two or more HLKX packages into one using the HLK API. Also re-add drivers and supplemental files after the merge, since Merge() alone does not copy them.