-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-54860][INFRA] Add JIRA Ticket Validating in GHA #53633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
### What changes were proposed in this pull request? This PR adds a new GitHub Action workflow that automatically validates pull request titles and extracts JIRA ticket information. ### Why are the changes needed? To improve contributor experience and streamline the review process by automatically displaying JIRA context in PRs. ### Does this PR introduce _any_ user-facing change? No. This is an infrastructure change that only affects the GitHub PR workflow. ### How was this patch tested? Tested locally using test-jira-action.py script with various PR title formats and JIRA API calls. ### Was this patch authored or co-authored using generative AI tooling? Copilot w/ Claude Sonnet 4.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds automated JIRA ticket validation to the pull request workflow. It extracts JIRA IDs from PR titles, fetches ticket information from Apache's JIRA API, and posts the details as a PR comment. PRs without JIRA IDs must be marked with [MINOR] or receive a reminder comment.
Key Changes:
- Adds a new
jira-infojob to the existing labeler workflow - Implements JIRA ID extraction using regex pattern matching
- Fetches and displays JIRA ticket metadata (type, summary, assignee, status, affected versions) via Apache JIRA REST API
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const prNumber = context.payload.pull_request.number; | ||
| // Extract JIRA IDs from PR title | ||
| const jiraIdRegex = /SPARK-\d+/g; |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JIRA ID regex pattern does not enforce position or word boundaries, which means it will match JIRA IDs anywhere in the title, including in URLs or as part of larger strings. For example, "SPARK-12345678" would incorrectly match as "SPARK-12345". Consider using word boundaries (\b) to ensure the JIRA ID is properly delimited: /\bSPARK-\d+\b/g
| const jiraIdRegex = /SPARK-\d+/g; | |
| const jiraIdRegex = /\bSPARK-\d+\b/g; |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
What changes were proposed in this pull request?
This PR adds a new GitHub Action workflow that automatically validates pull request titles and extracts JIRA ticket information. The workflow includes:
SPARK-12345) from PR titles[MINOR]for minor changesThe workflow runs on
pull_request_targetevents (opened, edited, reopened) and uses the public Apache JIRA API (no authentication required).Output Format Example:
Why are the changes needed?
Currently, Apache Spark PRs require manual verification of JIRA ticket associations. This automation:
This is particularly useful for new contributors who may not be familiar with Apache's PR conventions. It's very likely for them to make mistakes like #53445 (comment)
Does this PR introduce any user-facing change?
No. This is an infrastructure change that only affects the GitHub PR workflow.
How was this patch tested?
Local Testing: Validated the logic using
test-jira-action.pywhich simulates the GitHub Action behaviorTest Cases:
[SPARK-54859] Title→ Displays JIRA info (✓ tested successfully)[SPARK-111][SPARK-222] Multiple→ Displays multiple JIRA infos[MINOR] Fix typo→ Silently skips validationFix bug→ Posts reminder to add JIRA ID or [MINOR] tagReal JIRA Verification: Tested with actual Apache JIRA tickets (SPARK-54859, SPARK-50000) to confirm API responses, e.g. https://github.com/yaooqinn/spark/actions/runs/20567427354/job/59067970526?pr=4
Was this patch authored or co-authored using generative AI tooling?
Generated-by: GitHub Copilot (Claude Sonnet 4.5)