Skip to content

Pick words only when searching for Jira issues#4885

Open
psss wants to merge 1 commit into
mainfrom
psss-jira-sync-issue-search
Open

Pick words only when searching for Jira issues#4885
psss wants to merge 1 commit into
mainfrom
psss-jira-sync-issue-search

Conversation

@psss
Copy link
Copy Markdown
Member

@psss psss commented May 14, 2026

The issue / pull request summaries can contain various funny characters which can break the search, e.g. #4873. Let's pick just the words to prevent similar problems.

Pull Request Checklist

  • implement the feature

The issue / pull request summaries can contain various funny
characters which can break the search, e.g. #4873. Let's pick
just the words to prevent similar problems.
@psss psss added the area | automation Tools, actions and workflows automating our work label May 14, 2026
@psss psss added this to planning May 14, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning May 14, 2026
@psss psss moved this from backlog to review in planning May 14, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Jira issue search logic in scripts/sprint-sync to use regex for sanitizing GitHub item titles. Feedback indicates that titles without word characters could result in empty JQL queries and script crashes, suggesting a check to return early in such cases.

Comment thread scripts/sprint-sync

# Fall back to title search and verify via remote links
title = github_item.title.replace('\\', '\\\\').replace("'", "\\'").replace('"', '')
title = " ".join(re.findall(r'\w+', github_item.title))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Handle cases where the title contains no word characters (e.g., only symbols). An empty title string would result in an invalid JQL query (summary ~ "") and cause the script to crash.

Suggested change
title = " ".join(re.findall(r'\w+', github_item.title))
words = re.findall(r'\w+', github_item.title)
if not words:
return []
title = " ".join(words)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Question] should allow atleast '-' it will improve search accuracy ?

Comment thread scripts/sprint-sync

# Fall back to title search and verify via remote links
title = github_item.title.replace('\\', '\\\\').replace("'", "\\'").replace('"', '')
title = " ".join(re.findall(r'\w+', github_item.title))
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.

From the example given

Packaged helper scripts are using the #!/usr/bin/bash shebang

results into

Packaged helper scripts are using the usr bin bash shebang

That doesn't seem right. On the other hand using the quotation marks seems to work fine without much escaping
https://redhat.atlassian.net/issues?jql=project%20%3D%20%22Test%20Management%20Tool%22%20AND%20summary%20~%20%22%5C%22Packaged%20helper%20scripts%20are%20using%20the%20%60%23!%2Fusr%2Fbin%2Fbash%60%20shebang%5C%22%22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area | automation Tools, actions and workflows automating our work

Projects

Status: review

Development

Successfully merging this pull request may close these issues.

3 participants