Skip to content

Commit 36b2162

Browse files
menli820kostyanf14
authored andcommitted
Add --tag-suffix option to prevent tag name conflicts
1. Add new --tag-suffix CLI option to allow custom tag suffixes 2. Modify tag generation in HCKTest to append suffix when provided 3. Prevents naming conflicts when multiple users share a controller Signed-off-by: menli <menli@redhat.com>
1 parent 7aadb09 commit 36b2162

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

lib/cli.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class TestOptions
9595
attr_accessor :platform, :drivers, :driver_path, :commit, :svvp, :dump,
9696
:gthb_context_prefix, :gthb_context_suffix, :playlist, :select_test_names,
9797
:reject_test_names, :reject_report_sections, :boot_device,
98-
:allow_test_duplication, :manual, :package_with_playlist, :enable_vbs
98+
:allow_test_duplication, :manual, :package_with_playlist, :enable_vbs, :tag_suffix
9999

100100
def create_parser
101101
OptionParser.new do |parser|
@@ -195,6 +195,10 @@ def define_options(parser)
195195
parser.on('--package-with-playlist', TrueClass,
196196
'Load playlist into HLKX project package',
197197
&method(:package_with_playlist=))
198+
199+
parser.on('--tag-suffix <tag_suffix>', String,
200+
'Add custom suffix to HCK-CI tag to prevent name conflicts when using shared controller',
201+
&method(:tag_suffix=))
198202
end
199203
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
200204
end

lib/engines/hcktest/hcktest.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,18 @@ def upload_driver_package
216216
end
217217

218218
def self.tag(options)
219-
if options.test.svvp
220-
"svvp-#{options.test.platform}"
219+
base_tag = if options.test.svvp
220+
"svvp-#{options.test.platform}"
221+
else
222+
"#{options.test.drivers.sort.join('-')}-#{options.test.platform}"
223+
end
224+
225+
# Append tag_suffix if provided to prevent name conflicts when using shared controller
226+
suffix = options.test.tag_suffix&.strip
227+
if suffix && !suffix.empty?
228+
"#{base_tag}-#{suffix}"
221229
else
222-
"#{options.test.drivers.sort.join('-')}-#{options.test.platform}"
230+
base_tag
223231
end
224232
end
225233

0 commit comments

Comments
 (0)