Skip to content

Add HLKX package merge support - #84

Open
elizashurov wants to merge 1 commit into
HCK-CI:masterfrom
elizashurov:RHELMISC-35996
Open

elizashurov wants to merge 1 commit into
HCK-CI:masterfrom
elizashurov:RHELMISC-35996

Conversation

@elizashurov

Copy link
Copy Markdown
Contributor

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.

@elizashurov
elizashurov requested a review from kostyanf14 July 9, 2026 07:14

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread lib/rtoolsHCK.rb
Comment thread tools/toolsHCK.ps1
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 High severity · 3 Medium severity · 1 Low severity

Open (5)
What changed in this PR

Adds HLKX package merging through the HLK API.

Changes:

  • Adds mergehlkxpackages with 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.

Comment thread lib/rtoolsHCK.rb
Comment on lines +1132 to +1133
cmd_line << "-output '#{output}'" unless output.nil?
packages.each { |p| cmd_line << "'#{p}'" }
Comment thread tools/toolsHCK.ps1
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)
Comment thread tools/toolsHCK.ps1
if ($AddDriverResult) {
Write-Output "Driver re-added from $($driverDir.FullName)"
} else {
Write-Output "Warning: driver signability check did not pass for $($driverDir.FullName)"
Comment thread tools/toolsHCK.ps1
Comment on lines +2086 to +2095
if (-not $MergeResult) {
$iserror = $true
foreach ($err in $MergeErrors) {
if (-Not $json) {
Write-Output "Warning: $err"
} else {
$actionMessages += "Warning: $err"
}
}
}
Comment thread tools/toolsHCK.ps1
"createprojectpackage",
"loadplaylist"
"loadplaylist",
"mergehlkxpackages"
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.

2 participants