Redirect issue if repo has configured external tracker. (#9247)

* Redirect issue if repo has configured external tracker.

* Handle error

* Add tests for redirect

* Fix test consistency
This commit is contained in:
David Svantesson 2019-12-07 05:21:18 +01:00 committed by techknowlogick
parent 82e0383d21
commit 9cb418e623
91 changed files with 2150 additions and 8 deletions

View file

@ -97,3 +97,15 @@
is_pull: true
created_unix: 946684820
updated_unix: 978307180
-
id: 9
repo_id: 48
index: 1
poster_id: 11
name: pr1
content: a pull request
is_closed: false
is_pull: true
created_unix: 946684820
updated_unix: 978307180

View file

@ -36,4 +36,17 @@
head_branch: branch2
base_branch: master
merge_base: 0abcb056019adb83
has_merged: false
-
id: 4
type: 0 # gitea pull request
status: 2 # mergable
issue_id: 9
index: 1
head_repo_id: 48
base_repo_id: 48
head_branch: branch1
base_branch: master
merge_base: abcdef1234567890
has_merged: false

View file

@ -452,3 +452,24 @@
type: 1
config: "{}"
created_unix: 946684810
-
id: 66
repo_id: 46
type: 7
config: "{\"ExternalTrackerURL\":\"https://tracker.com\",\"ExternalTrackerFormat\":\"https://tracker.com/{user}/{repo}/issues/{index}\",\"ExternalTrackerStyle\":\"\"}"
created_unix: 946684810
-
id: 67
repo_id: 47
type: 7
config: "{\"ExternalTrackerURL\":\"https://tracker.com\",\"ExternalTrackerFormat\":\"https://tracker.com/{user}/{repo}/issues/{index}\",\"ExternalTrackerStyle\":\"numeric\"}"
created_unix: 946684810
-
id: 68
repo_id: 48
type: 7
config: "{\"ExternalTrackerURL\":\"https://tracker.com\",\"ExternalTrackerFormat\":\"https://tracker.com/{user}/{repo}/issues/{index}\",\"ExternalTrackerStyle\":\"alphanumeric\"}"
created_unix: 946684810

View file

@ -587,3 +587,40 @@
num_issues: 0
is_mirror: false
status: 0
-
id: 46
owner_id: 26
lower_name: repo_external_tracker
name: repo_external_tracker
is_private: false
num_stars: 0
num_forks: 0
num_issues: 0
is_mirror: false
status: 0
-
id: 47
owner_id: 26
lower_name: repo_external_tracker_numeric
name: repo_external_tracker_numeric
is_private: false
num_stars: 0
num_forks: 0
num_issues: 0
is_mirror: false
status: 0
-
id: 48
owner_id: 26
lower_name: repo_external_tracker_alpha
name: repo_external_tracker_alpha
is_private: false
num_stars: 0
num_forks: 0
num_issues: 0
num_pulls: 1
is_mirror: false
status: 0

View file

@ -424,7 +424,7 @@
is_admin: false
avatar: avatar26
avatar_email: org26@example.com
num_repos: 1
num_repos: 4
num_members: 0
num_teams: 1
repo_admin_change_team_access: true

View file

@ -175,10 +175,10 @@ func TestSearchRepository(t *testing.T) {
count: 14},
{name: "AllPublic/PublicRepositoriesOfUserIncludingCollaborative",
opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 15, AllPublic: true, Template: util.OptionalBoolFalse},
count: 22},
count: 25},
{name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborative",
opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 15, Private: true, AllPublic: true, Template: util.OptionalBoolFalse},
count: 28},
count: 31},
{name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborativeByName",
opts: &SearchRepoOptions{Keyword: "test", Page: 1, PageSize: 10, OwnerID: 15, Private: true, AllPublic: true},
count: 15},
@ -187,7 +187,7 @@ func TestSearchRepository(t *testing.T) {
count: 13},
{name: "AllPublic/PublicRepositoriesOfOrganization",
opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 17, AllPublic: true, Collaborate: util.OptionalBoolFalse, Template: util.OptionalBoolFalse},
count: 22},
count: 25},
{name: "AllTemplates",
opts: &SearchRepoOptions{Page: 1, PageSize: 10, Template: util.OptionalBoolTrue},
count: 2},