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
Tatuya Kamada
gitlab-ce
Commits
6419fe36
Commit
6419fe36
authored
Sep 01, 2016
by
Brian Kintz
Committed by
Rémy Coutable
Nov 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the server's base URL without relative URL part when creating links in JIRA
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
d7859912
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
CHANGELOG.md
CHANGELOG.md
+1
-0
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+1
-1
spec/models/project_services/jira_service_spec.rb
spec/models/project_services/jira_service_spec.rb
+22
-0
No files found.
CHANGELOG.md
View file @
6419fe36
...
...
@@ -29,6 +29,7 @@ Please view this file on the master branch, on stable branches it's out of date.
-
Do not show tooltip for active element !7105 (winniehell)
-
Escape ref and path for relative links !6050 (winniehell)
-
Fixed link typo on /help/ui to Alerts section. !6915 (Sam Rose)
-
Fix broken issue/merge request links in JIRA comments. !6143 (Brian Kintz)
-
Fix filtering of milestones with quotes in title (airatshigapov)
-
Refactor less readable existance checking code from CoffeeScript !6289 (jlogandavison)
-
Update mail_room and enable sentinel support to Reply By Email (!7101)
...
...
app/models/project_services/jira_service.rb
View file @
6419fe36
...
...
@@ -237,7 +237,7 @@ class JiraService < IssueTrackerService
end
def
resource_url
(
resource
)
"
#{
Settings
.
gitlab
[
'url'
]
.
chomp
(
"/"
)
}#{
resource
}
"
"
#{
Settings
.
gitlab
.
base_url
.
chomp
(
"/"
)
}#{
resource
}
"
end
def
build_entity_url
(
entity_name
,
entity_id
)
...
...
spec/models/project_services/jira_service_spec.rb
View file @
6419fe36
require
'spec_helper'
include
Gitlab
::
Routing
.
url_helpers
describe
JiraService
,
models:
true
do
describe
"Associations"
do
...
...
@@ -66,6 +67,27 @@ describe JiraService, models: true do
).
once
end
it
"references the GitLab commit/merge request"
do
@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
}
/
).
once
end
it
"references the GitLab commit/merge request (relative URL)"
do
stub_config_setting
(
relative_url_root:
'/gitlab'
)
stub_config_setting
(
url:
Settings
.
send
(
:build_gitlab_url
))
Project
.
default_url_options
[
:script_name
]
=
"/gitlab"
@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
}
/
).
once
end
it
"calls the api with jira_issue_transition_id"
do
@jira_service
.
jira_issue_transition_id
=
'this-is-a-custom-id'
@jira_service
.
execute
(
merge_request
,
ExternalIssue
.
new
(
"JIRA-123"
,
project
))
...
...
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