Repository navigation
Conversation
ISSUE_ID_CORE let the issue number backtrack to a shorter prefix, so the (?!\.\d) version lookahead could be skipped: "Fix ios-17.4 keyboard crash" extracted IOS-1, and "Fix node-20.11 build" extracted NODE-2. Require the number to end on a non-digit before checking the version suffix.
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.
The magic-word path can link the wrong issue when the token after the keyword is a version. On main:
ISSUE_ID_COREhas the(?!\.\d)version lookahead, but nothing stops[0-9]{1,9}from backtracking:17fails the lookahead, so the regex retries with1, which is followed by7and passes. The capturedios-1then goes throughmatchAllIdentifiersand becomesIOS-1. Branch names don't have this problem becauseISSUE_IDENTIFIER_REGEXhas an end boundary.The fix adds
(?![0-9])before the version lookahead so the number can't end mid-digit. Real identifiers likeFixes IOS-1641and lists likeFixes LIN-123, LIN-456 and ENG-789are unchanged.Testing: added the cases above to the version suffix tests (all 5 fail on main, pass with the change).
vitest --run(473 tests),tsc --noEmit,oxlintandoxfmt --checkpass.