[#7] Accept YouTrack project keys starting with a digit - #8
Open
heitor-lassarote wants to merge 1 commit into
Conversation
heitor-lassarote
force-pushed
the
heitor-lassarote/#4-add-rspec-tests
branch
3 times, most recently
from
August 26, 2026 21:11
b5fa5e2 to
762b517
Compare
Problem: youtrack_issue's prefix pattern required the project key to start with an uppercase letter (/\[[A-Z][A-Z0-9]*-\d+\]/), but some real project keys start with a digit (e.g. 1IN, 21C, both confirmed via the YouTrack API). Commit subjects prefixed with such a key were not recognized as having a valid issue prefix. The same bug existed independently in check_merge_request's ticket_links default pattern, used to scan PR/MR titles and bodies for YouTrack ticket mentions. Solution: Extract the shared YOUTRACK_ISSUE_KEY_PATTERN sub-pattern into a constant used by both issue-prefix.rb and merge-request.rb, so there is only one place left to get this right, and widen it so the key can start with a digit or a letter. Add regression tests for both call sites and both example keys.
heitor-lassarote
force-pushed
the
heitor-lassarote/#7-fix-youtrack-issue-prefix-digit-keys
branch
from
August 26, 2026 21:25
0803429 to
e1cccad
Compare
heitor-lassarote
marked this pull request as ready for review
August 26, 2026 21:37
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.
Description
youtrack_issue's prefix pattern inissue-prefix.rbrequired aYouTrack project key to start with an uppercase letter, but some real
project keys start with a digit (e.g.
1IN,21C, both confirmed viathe YouTrack API). Commit subjects prefixed with such a key weren't
recognized as having a valid issue prefix.
Widens the pattern's character class so the key can start with a
digit or a letter, and adds regression tests for both examples.
Base branch note: this PR targets
heitor-lassarote/#4-add-rspec-testsrather thanmaster, sincemasterdoesn't have the RSpec suite yet and this fix needs aregression test. This PR depends on #6 landing first.
Related issue(s)
Fixed #7
✅ Checklist for your Pull Request
Related changes (conditional)
Tests
silently reappearing again.
Documentation
Agent instructions (conditional)
it followed the agent instructions in
.claude/settings.json(plugin) and
.github/copilot-instructions.md.Public contracts
of Public Contracts policy.
and
Stylistic guide (mandatory)