Skip to content

Fix ReleaseTools issue matcher regex #3549

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

Merged
merged 1 commit into from
Sep 8, 2021
Merged

Conversation

andyleejordan
Copy link
Member

The simpler "anything but a digit" logic failed on an edge case with a recent PR that had another URL with digits in it after the word "Fix" so we had to make this more explicit.

The simpler "anything but a digit" logic failed on an edge case with a
recent PR that had another URL with digits in it after the word "Fix" so
we had to make this more explicit.
@andyleejordan andyleejordan added the Ignore Exclude from the changelog. label Sep 7, 2021
@andyleejordan
Copy link
Member Author

I had to work at this a little more to fix it 😅 My first guess was wrong once I started testing with real API data.

$IssueRegex = '(' + ($CloseKeywords -join '|') + ')\s+(?<repo>\D+)(?<number>\d+)'
# NOTE: The URL matcher must be explicit because the body of a PR may
# contain other URLs with digits (like an image asset).
$IssueRegex = '(' + ($CloseKeywords -join '|') + ')\s+((https://github.com/PowerShell/(?<repo>(' + ([RepoNames]::Values -join '|') + '))/issues/)|#)(?<number>\d+)'
Copy link
Contributor

Choose a reason for hiding this comment

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

what case does the |# account for after the /issues/?

Copy link
Member Author

Choose a reason for hiding this comment

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

The case where a URL was not used an instead just #1234. So it's either the/url/issues/1234 OR #1234.

@andyleejordan andyleejordan enabled auto-merge (squash) September 7, 2021 23:32
@andyleejordan andyleejordan merged commit 2aa6651 into master Sep 8, 2021
@andyleejordan andyleejordan deleted the andschwa/issue-regex branch September 8, 2021 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ignore Exclude from the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants