Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
e8683efe
Commit
e8683efe
authored
Jun 03, 2019
by
Matthias Baur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow lowercase prefix for Youtrack issue ids
Relates to #42595. Fixes #62661.
parent
205f0d0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
app/models/project_services/youtrack_service.rb
app/models/project_services/youtrack_service.rb
+3
-3
doc/user/project/integrations/youtrack.md
doc/user/project/integrations/youtrack.md
+2
-2
spec/lib/banzai/filter/external_issue_reference_filter_spec.rb
...lib/banzai/filter/external_issue_reference_filter_spec.rb
+7
-0
No files found.
app/models/project_services/youtrack_service.rb
View file @
e8683efe
...
...
@@ -5,12 +5,12 @@ class YoutrackService < IssueTrackerService
prop_accessor
:description
,
:project_url
,
:issues_url
# {PROJECT-KEY}-{NUMBER} Examples: YT-1, PRJ-1
# {PROJECT-KEY}-{NUMBER} Examples: YT-1, PRJ-1
, gl-030
def
self
.
reference_pattern
(
only_long:
false
)
if
only_long
/(?<issue>\b[A-Z][A-Za-z0-9_]*-\d+)/
/(?<issue>\b[A-Z
a-z
][A-Za-z0-9_]*-\d+)/
else
/(?<issue>\b[A-Z][A-Za-z0-9_]*-\d+)|(
#{
Issue
.
reference_prefix
}
(?<issue>\d+))/
/(?<issue>\b[A-Z
a-z
][A-Za-z0-9_]*-\d+)|(
#{
Issue
.
reference_prefix
}
(?<issue>\d+))/
end
end
...
...
doc/user/project/integrations/youtrack.md
View file @
e8683efe
...
...
@@ -31,8 +31,8 @@ To disable the internal issue tracker in a project:
## Referencing YouTrack issues in GitLab
Issues in YouTrack can be referenced as
`<PROJECT>-<ID>`
.
`<PROJECT>`
must start with a
capital
letter and can then be followed by capital or lower case
letters, numbers or underscores.
`<ID>`
is a number. An example reference is
`YT-101`
or
`Api_32-143
`
.
must start with a letter and can then be followed by capital or lower case
letters, numbers or underscores.
`<ID>`
is a number. An example reference is
`YT-101`
,
`Api_32-143`
or
`gl-030
`
.
References to
`<PROJECT>-<ID>`
in merge requests, commits, or comments are automatically linked to the YouTrack issue URL.
For more information, see the
[
External Issue Tracker
](
../../../integration/external-issue-tracker.md
)
documentation.
spec/lib/banzai/filter/external_issue_reference_filter_spec.rb
View file @
e8683efe
...
...
@@ -155,6 +155,13 @@ describe Banzai::Filter::ExternalIssueReferenceFilter do
it_behaves_like
"external issue tracker"
end
context
"with a lowercase prefix"
do
let
(
:issue
)
{
ExternalIssue
.
new
(
"gl-030"
,
project
)
}
let
(
:reference
)
{
issue
.
to_reference
}
it_behaves_like
"external issue tracker"
end
end
context
"jira project"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment