From d94f15c2fd921722796a4cfdbbf266dd3017525c Mon Sep 17 00:00:00 2001 From: Andrew Imeson Date: Fri, 7 Oct 2022 08:49:30 -0400 Subject: Make external issue tracker regexp configurable via API (#21338) Fixes #21336 Signed-off-by: Andrew Imeson --- modules/convert/repository.go | 7 ++++--- modules/structs/repo.go | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/convert/repository.go b/modules/convert/repository.go index f853163848..09b84afa6c 100644 --- a/modules/convert/repository.go +++ b/modules/convert/repository.go @@ -56,9 +56,10 @@ func innerToRepo(repo *repo_model.Repository, mode perm.AccessMode, isParent boo config := unit.ExternalTrackerConfig() hasIssues = true externalTracker = &api.ExternalTracker{ - ExternalTrackerURL: config.ExternalTrackerURL, - ExternalTrackerFormat: config.ExternalTrackerFormat, - ExternalTrackerStyle: config.ExternalTrackerStyle, + ExternalTrackerURL: config.ExternalTrackerURL, + ExternalTrackerFormat: config.ExternalTrackerFormat, + ExternalTrackerStyle: config.ExternalTrackerStyle, + ExternalTrackerRegexpPattern: config.ExternalTrackerRegexpPattern, } } hasWiki := false diff --git a/modules/structs/repo.go b/modules/structs/repo.go index 27e7f4618c..cf6601704e 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -34,8 +34,10 @@ type ExternalTracker struct { ExternalTrackerURL string `json:"external_tracker_url"` // External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index. ExternalTrackerFormat string `json:"external_tracker_format"` - // External Issue Tracker Number Format, either `numeric` or `alphanumeric` + // External Issue Tracker Number Format, either `numeric`, `alphanumeric`, or `regexp` ExternalTrackerStyle string `json:"external_tracker_style"` + // External Issue Tracker issue regular expression + ExternalTrackerRegexpPattern string `json:"external_tracker_regexp_pattern"` } // ExternalWiki represents setting for external wiki -- cgit v1.2.3