BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7ef26c7e
Commit
7ef26c7e
authored
Nov 17, 2016
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jira_service_simplify' into 'master'
JiraService: simplify url generation Fixes #24085 See merge request !7307
parents
aea8baed
7cc9d0f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
jira_service.rb
app/models/project_services/jira_service.rb
+8
-10
jira_service_simplify.yml
changelogs/unreleased/jira_service_simplify.yml
+4
-0
jira_service_spec.rb
spec/models/project_services/jira_service_spec.rb
+4
-1
No files found.
app/models/project_services/jira_service.rb
View file @
7ef26c7e
...
...
@@ -256,16 +256,14 @@ class JiraService < IssueTrackerService
end
def
build_entity_url
(
entity_name
,
entity_id
)
resource_url
(
polymorphic_url
(
[
self
.
project
.
namespace
.
becomes
(
Namespace
),
self
.
project
,
entity_name
],
id:
entity_id
,
routing_type: :path
)
polymorphic_url
(
[
self
.
project
.
namespace
.
becomes
(
Namespace
),
self
.
project
,
entity_name
],
id:
entity_id
,
host:
Settings
.
gitlab
.
base_url
)
end
end
changelogs/unreleased/jira_service_simplify.yml
0 → 100644
View file @
7ef26c7e
---
title
:
simplify url generation
merge_request
:
author
:
Jarka Kadlecova
spec/models/project_services/jira_service_spec.rb
View file @
7ef26c7e
...
...
@@ -69,6 +69,7 @@ describe JiraService, models: true do
end
describe
"Execute"
do
let
(
:custom_base_url
)
{
'http://custom_url'
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
)
}
...
...
@@ -107,10 +108,12 @@ describe JiraService, models: true do
end
it
"references the GitLab commit/merge request"
do
stub_config_setting
(
base_url:
custom_base_url
)
@jira_service
.
execute
(
merge_request
,
ExternalIssue
.
new
(
"JIRA-123"
,
project
))
expect
(
WebMock
).
to
have_requested
(
:post
,
@comment_url
).
with
(
body:
/
#{
Gitlab
.
config
.
gitlab
.
url
}
\/
#{
project
.
path_with_namespace
}
\/commit\/
#{
merge_request
.
diff_head_sha
}
/
body:
/
#{
custom_base_
url
}
\/
#{
project
.
path_with_namespace
}
\/commit\/
#{
merge_request
.
diff_head_sha
}
/
).
once
end
...
...
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