Skip to content

[SPARK-56415][INFRA] Simplify create_spark_jira.py for LLM-driven JIRA ticket creation#55281

Open
cloud-fan wants to merge 6 commits intoapache:masterfrom
cloud-fan:improve-create-jira-script
Open

[SPARK-56415][INFRA] Simplify create_spark_jira.py for LLM-driven JIRA ticket creation#55281
cloud-fan wants to merge 6 commits intoapache:masterfrom
cloud-fan:improve-create-jira-script

Conversation

@cloud-fan
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Simplifies dev/create_spark_jira.py to focus on JIRA ticket creation only, making it suitable for use by LLM agents. Also updates AGENTS.md with instructions for automated ticket creation.

Changes to the script:

  • Removed create_and_checkout_branch(), create_commit(), run_cmd(), and interactive choose_components() — the script now only creates a JIRA ticket and prints the ticket key.
  • Made -c (component) required instead of falling back to an interactive prompt.
  • Added --list-components flag to query valid component names from JIRA.
  • Improved pre-flight check: when the jira library or JIRA_ACCESS_TOKEN is missing, the script prints a helpful message directing the user to create the ticket manually, instead of a raw error.
  • Added guard for empty versions list.

Changes to AGENTS.md:

  • Updated Pull Request Workflow section to instruct LLM agents to create JIRA tickets using the script.
  • Inlined the valid issue types and common component names so agents can pick the right values without an extra API call.

Why are the changes needed?

Previously, AGENTS.md told LLM agents to ask the user to create JIRA tickets manually. The create_spark_jira.py script existed but included interactive prompts and git side effects (branch creation, committing) that made it unsuitable for automated use. This change makes the script LLM-friendly so agents can create tickets as part of the PR workflow.

Does this PR introduce any user-facing change?

No. The script's CLI interface is simplified but the core JIRA creation functionality is preserved.

How was this patch tested?

Manually tested --list-components and JIRA ticket creation against the ASF JIRA instance.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code

- Remove CLI version flag; auto-detect latest unreleased version instead
- Split preflight into check_jira_access() and detect_affected_version()
- Hint in AGENTS.md to review versions after ticket creation

Co-authored-by: Isaac
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can add back the old script if people still need it, but with a different name, as create_spark_jira.py should only create ticket.

@cloud-fan
Copy link
Copy Markdown
Contributor Author

cc @dongjoon-hyun @HyukjinKwon

@dongjoon-hyun
Copy link
Copy Markdown
Member

Thank you for pinging me. Let me try today.


parser = argparse.ArgumentParser(description="Create a Spark JIRA issue.")
parser.add_argument("title", nargs="?", help="Title of the JIRA issue")
parser.add_argument("-p", "--parent", help="Parent JIRA ID for subtasks")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm alway using this parent JIRA ID feature. Please recover this, @cloud-fan .

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