Merge branch 'fix/allow-lower-case-issue-ids' into 'master'
Allow lowercase prefix for Youtrack issue ids Closes #62661 See merge request gitlab-org/gitlab-ce!29057
This commit is contained in:
commit
c50eed5400
4 changed files with 17 additions and 5 deletions
|
@ -5,12 +5,12 @@ class YoutrackService < IssueTrackerService
|
||||||
|
|
||||||
prop_accessor :description, :project_url, :issues_url
|
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)
|
def self.reference_pattern(only_long: false)
|
||||||
if only_long
|
if only_long
|
||||||
/(?<issue>\b[A-Z][A-Za-z0-9_]*-\d+)/
|
/(?<issue>\b[A-Za-z][A-Za-z0-9_]*-\d+)/
|
||||||
else
|
else
|
||||||
/(?<issue>\b[A-Z][A-Za-z0-9_]*-\d+)|(#{Issue.reference_prefix}(?<issue>\d+))/
|
/(?<issue>\b[A-Za-z][A-Za-z0-9_]*-\d+)|(#{Issue.reference_prefix}(?<issue>\d+))/
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
5
changelogs/unreleased/fix-allow-lower-case-issue-ids.yml
Normal file
5
changelogs/unreleased/fix-allow-lower-case-issue-ids.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Allow lowercase prefix for Youtrack issue ids
|
||||||
|
merge_request: 29057
|
||||||
|
author: Matthias Baur
|
||||||
|
type: fixed
|
|
@ -31,8 +31,8 @@ To disable the internal issue tracker in a project:
|
||||||
## Referencing YouTrack issues in GitLab
|
## Referencing YouTrack issues in GitLab
|
||||||
|
|
||||||
Issues in YouTrack can be referenced as `<PROJECT>-<ID>`. `<PROJECT>`
|
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
|
must start with a letter and is followed by letters, numbers, or underscores.
|
||||||
letters, numbers or underscores. `<ID>` is a number. An example reference is `YT-101` or `Api_32-143`.
|
`<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.
|
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.
|
For more information, see the [External Issue Tracker](../../../integration/external-issue-tracker.md) documentation.
|
||||||
|
|
|
@ -155,6 +155,13 @@ describe Banzai::Filter::ExternalIssueReferenceFilter do
|
||||||
|
|
||||||
it_behaves_like "external issue tracker"
|
it_behaves_like "external issue tracker"
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
context "jira project" do
|
context "jira project" do
|
||||||
|
|
Loading…
Reference in a new issue