gha: backport — quote title to force exact-phrase search#30424
Open
gha: backport — quote title to force exact-phrase search#30424
Conversation
The existing-issue check in gh_issue_url() used GitHub's relevance-ranked
full-text search ("[$branch] $title in:title"), which tokenizes the
title and matches any open issue that shares the keywords. When an
unrelated backport issue for the same target branch was open with
overlapping tokens, the search returned that issue and the script
silently skipped creating a new tracking issue.
Wrap the title in double quotes so GitHub treats it as an exact phrase.
Fixes DEVPROD-4205.
When create_issue.sh takes the "issue already exists" branch, it only records the matched URL in $GITHUB_ENV. Nothing reaches the run log, which made the DEVPROD-4205 false-positive invisible — the step ran for under a second and produced no output, so the only sign that something went wrong was the missing tracking issue. Echo the message to stdout so the matched URL is visible in the workflow run log.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Actions backport workflow’s gh_issue_url() helper to reduce false positives when checking for an existing backport tracking issue by switching the issue-title search to an exact-phrase query.
Changes:
- Quote the backport issue title in the GitHub search query (
in:title) so GitHub uses phrase matching instead of token-based matching. - Prevent unrelated open backport issues on the same branch from being incorrectly treated as duplicates.
| shift $((OPTIND - 1)) | ||
|
|
||
| search=${search-"[$BACKPORT_BRANCH] $ORIG_TITLE in:title"} | ||
| search=${search-"\"[$BACKPORT_BRANCH] $ORIG_TITLE\" in:title"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The existing-issue check in
gh_issue_url()used GitHub's relevance-ranked full-text search:search="[$BACKPORT_BRANCH] $ORIG_TITLE in:title"That's not an exact title match — GitHub tokenizes the title (
v25.3.x,dcv,Remove,DCV, …) and matches any open issue with overlapping tokens. When an unrelated backport issue for the same target branch is open, it can be picked up as a "duplicate," and the script silently skips creating a real tracking issue.This actually happened on PR #30410: both v26.1.x and v25.3.x cherry-picks failed (expected), but only #30412 (v26.1.x) got a tracking issue. The v25.3.x search was matched by #30404 (
[v25.3.x] tests: Remove DCV DT support), which shares the tokensv25.3.x,Remove,DCV. See the DEVPROD-4205 analysis for the full root-cause walkthrough.The fix is to wrap the title in double quotes so GitHub treats it as an exact phrase.
Verification
DEVPROD-4205
Test plan
Release Notes