Skip to content

Commit ce4dc35

Browse files
committed
[CIQ HELPERS] Add Multiple Ticket processing
We have some kernel trees that have multiple products which can mean that we have more than one VULN ticket reference (they are per product at the moment). This change allows for us to be able to set multiple jira tickets to a single cherry-pick. This is in prep for additional automation.
1 parent b230a1c commit ce4dc35

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ciq-cherry-pick.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
print("CIQ custom cherry picker")
1313
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)
1414
parser.add_argument('--sha', help='Target SHA1 to cherry-pick')
15-
parser.add_argument('--ticket', help='Ticket associated to cherry-pick work')
15+
parser.add_argument('--ticket', help='Ticket associated to cherry-pick work, comma separated list is supported.')
1616
parser.add_argument('--ciq-tag', help="Tags for commit message <feature><-optional modifier> <identifier>.\n"
1717
"example: cve CVE-2022-45884 - A patch for a CVE Fix.\n"
1818
" cve-bf CVE-1974-0001 - A bug fix for a CVE currently being patched\n"

ciq_helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def CIQ_cherry_pick_commit_standardization(
112112
lines: Original SHAS commit message.
113113
commit: The commit SHA1 that was cherry-picked.
114114
tags: A list of tags to add to the commit message.
115-
jira: The JIRA number to add to the commit message.
115+
jira: The JIRA number to add to the commit message, this can be a comma separated list.
116116
optional_msg: An optional message to add to the commit message. Traditionally used for `upstream-diff`.
117117
118118
Return: The modified commit message passed in as lines.
@@ -127,7 +127,8 @@ def CIQ_cherry_pick_commit_standardization(
127127
for tag in tags[::-1]:
128128
lines.insert(2, f"{tag}\n")
129129
if jira:
130-
lines.insert(2, f"jira {jira}\n")
130+
for i in jira.split(","):
131+
lines.insert(2, f"jira {i.strip()}\n")
131132

132133
# We Need to indent lines that have email addresss as some tooling in the community
133134
# will atttempt to read these lines and email everyone on the list. We do not want

0 commit comments

Comments
 (0)