This is an automated email from the ASF dual-hosted git repository.

MaxGekk pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.x by this push:
     new 9b00e557286c [SPARK-57862][INFRA] Allow create_spark_jira.py to set 
the issue description
9b00e557286c is described below

commit 9b00e557286c457aee10a61a6a74333529106862
Author: Maxim Gekk <[email protected]>
AuthorDate: Thu Jul 2 12:36:15 2026 +0200

    [SPARK-57862][INFRA] Allow create_spark_jira.py to set the issue description
    
    ### What changes were proposed in this pull request?
    This PR extends `dev/create_spark_jira.py` (and its helper 
`dev/spark_jira_utils.py`) so the JIRA description can be set at creation time:
    - Add `-d`/`--description` and `--description-file` options (mutually 
exclusive) to `create_spark_jira.py`.
    - Add a `description` parameter to `create_jira_issue` and use it in the 
issue payload (previously hardcoded to an empty string).
    
    Backward compatible: without the new flags the behavior is unchanged.
    
    ### Why are the changes needed?
    `create_jira_issue` hardcoded `"description": ""`, so **tickets created via 
the script had no body** and the description had to be added manually 
afterwards. When creating many issues at once (e.g. a batch of sub-tasks under 
an umbrella), populating the description at creation time is much more 
efficient.
    
    ### Does this PR introduce _any_ user-facing change?
    No. This is a developer tooling change; without the new flags the behavior 
is unchanged.
    
    ### How was this patch tested?
    Manually created JIRA sub-tasks with `--description-file` and verified the 
description on the resulting issues.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    Generated-by: Cursor
    
    Closes #56938 from MaxGekk/SPARK-57862.
    
    Authored-by: Maxim Gekk <[email protected]>
    Signed-off-by: Max Gekk <[email protected]>
    (cherry picked from commit d20a8ec37ed90551e4afa2f511c1536a9c071f41)
    Signed-off-by: Max Gekk <[email protected]>
---
 dev/create_spark_jira.py | 28 +++++++++++++++++++++++++++-
 dev/spark_jira_utils.py  |  6 ++++--
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/dev/create_spark_jira.py b/dev/create_spark_jira.py
index 287a2d2e3a27..907f9243092e 100755
--- a/dev/create_spark_jira.py
+++ b/dev/create_spark_jira.py
@@ -38,6 +38,16 @@ def main():
         help="Issue type (e.g. Bug, Improvement)",
     )
     parser.add_argument("-c", "--component", help="Component for the issue")
+    parser.add_argument(
+        "-d",
+        "--description",
+        help="Description text for the issue.",
+    )
+    parser.add_argument(
+        "--description-file",
+        help="Path to a file whose contents are used as the issue description "
+        "(mutually exclusive with --description).",
+    )
     parser.add_argument(
         "--list-components", action="store_true", help="List available 
components and exit"
     )
@@ -60,9 +70,25 @@ def main():
     if not args.parent and not args.type:
         parser.error("-t/--type is required when not creating a subtask")
 
+    if args.description and args.description_file:
+        parser.error("--description and --description-file cannot be used 
together")
+
+    description = args.description or ""
+    if args.description_file:
+        try:
+            with open(args.description_file, encoding="utf-8") as f:
+                description = f.read()
+        except OSError as e:
+            parser.error("cannot read --description-file: %s" % e)
+
     asf_jira = get_jira_client()
     jira_id = create_jira_issue(
-        asf_jira, args.title, args.component, parent=args.parent, 
issue_type=args.type
+        asf_jira,
+        args.title,
+        args.component,
+        parent=args.parent,
+        issue_type=args.type,
+        description=description,
     )
     print(jira_id)
 
diff --git a/dev/spark_jira_utils.py b/dev/spark_jira_utils.py
index 4fc8dd5f5497..67d205dbf263 100644
--- a/dev/spark_jira_utils.py
+++ b/dev/spark_jira_utils.py
@@ -78,14 +78,16 @@ def list_components(asf_jira):
         print(c.name)
 
 
-def create_jira_issue(asf_jira, title, component, parent=None, 
issue_type=None, version=None):
+def create_jira_issue(
+    asf_jira, title, component, parent=None, issue_type=None, version=None, 
description=""
+):
     """Create a JIRA issue and return the issue key (e.g. SPARK-12345)."""
     affected_version = version if version else 
detect_affected_version(asf_jira)
 
     issue_dict = {
         "project": {"key": "SPARK"},
         "summary": title,
-        "description": "",
+        "description": description or "",
         "versions": [{"name": affected_version}],
         "components": [{"name": component}],
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to