Skip to content

Commit 14985e5

Browse files
committed
ORC-2115: Improve create_orc_jira.py to support the component parameter
### What changes were proposed in this pull request? This PR aims to improve `create_orc_jira.py` to support the component parameter. ### Why are the changes needed? To help a developer to create JIRA issues more easily. ### How was this patch tested? Manually. ``` $ dev/create_orc_jira.py -c 'Java' 'Improve `create_orc_jira.py` to support the component parameter' Creating JIRA issue with title: Improve `create_orc_jira.py` to support the component parameter Created JIRA issue: ORC-2115 git checkout -b ORC-2115 Switched to a new branch 'ORC-2115' Created and checked out branch: ORC-2115 ['git', 'commit', '-a', '-m', 'ORC-2115: Improve `create_orc_jira.py` to support the component parameter'] Created a commit with message: ORC-2115: Improve `create_orc_jira.py` to support the component parameter ``` ### Was this patch authored or co-authored using generative AI tooling? Generated-by: `Gemini 3.1 Pro (High)` on `Antigravity` Closes #2563 from dongjoon-hyun/ORC-2115. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
1 parent cb15ed5 commit 14985e5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

dev/create_orc_jira.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def run_cmd(cmd):
5050

5151
import argparse
5252

53-
def create_jira_issue(title, parent_jira_id=None, issue_type=None, version=None):
53+
def create_jira_issue(title, parent_jira_id=None, issue_type=None, version=None, component=None):
5454
asf_jira = jira.client.JIRA(
5555
{"server": JIRA_API_BASE},
5656
token_auth=JIRA_ACCESS_TOKEN,
@@ -76,6 +76,9 @@ def create_jira_issue(title, parent_jira_id=None, issue_type=None, version=None)
7676
'versions': [{'name': affected_version}],
7777
}
7878

79+
if component:
80+
issue_dict['components'] = [{'name': component}]
81+
7982
if parent_jira_id:
8083
issue_dict['issuetype'] = {'name': 'Sub-task'}
8184
issue_dict['parent'] = {'key': parent_jira_id}
@@ -117,14 +120,15 @@ def main():
117120
parser.add_argument("-p", "--parent", help="Parent JIRA ID for subtasks")
118121
parser.add_argument("-t", "--type", help="Issue type to create when no parent is specified (e.g. Bug). Defaults to Improvement.")
119122
parser.add_argument("-v", "--version", help="Version to use for the issue")
123+
parser.add_argument("-c", "--component", help="Component for the issue")
120124
args = parser.parse_args()
121125

122126
if args.parent:
123127
print("Creating a subtask of %s with title: %s" % (args.parent, args.title))
124128
else:
125129
print("Creating JIRA issue with title: %s" % args.title)
126130

127-
jira_id = create_jira_issue(args.title, args.parent, args.type, args.version)
131+
jira_id = create_jira_issue(args.title, args.parent, args.type, args.version, args.component)
128132
print("Created JIRA issue: %s" % jira_id)
129133

130134
create_and_checkout_branch(jira_id)

0 commit comments

Comments
 (0)