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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d35463bf
Commit
d35463bf
authored
Jul 16, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
f81c35d2
aec9bf9e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
38 deletions
+21
-38
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+1
-1
spec/factories/projects.rb
spec/factories/projects.rb
+3
-19
spec/factories/services.rb
spec/factories/services.rb
+2
-4
spec/factories/services_data.rb
spec/factories/services_data.rb
+1
-7
spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
+3
-3
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+1
-1
spec/requests/api/services_spec.rb
spec/requests/api/services_spec.rb
+10
-3
No files found.
app/models/project_services/jira_service.rb
View file @
d35463bf
...
...
@@ -250,7 +250,7 @@ class JiraService < IssueTrackerService
end
log_info
(
"Successfully posted"
,
client_url:
client_url
)
"SUCCESS: Successfully posted to
http://jira.example.net
."
"SUCCESS: Successfully posted to
#{
client_url
}
."
end
end
...
...
spec/factories/projects.rb
View file @
d35463bf
...
...
@@ -306,34 +306,18 @@ FactoryBot.define do
factory
:redmine_project
,
parent: :project
do
has_external_issue_tracker
true
after
:create
do
|
project
|
project
.
create_redmine_service
(
active:
true
,
properties:
{
'project_url'
=>
'http://redmine/projects/project_name_in_redmine'
,
'issues_url'
=>
'http://redmine/projects/project_name_in_redmine/issues/:id'
,
'new_issue_url'
=>
'http://redmine/projects/project_name_in_redmine/issues/new'
}
)
end
redmine_service
end
factory
:youtrack_project
,
parent: :project
do
has_external_issue_tracker
true
after
:create
do
|
project
|
project
.
create_youtrack_service
(
active:
true
,
properties:
{
'project_url'
=>
'http://youtrack/projects/project_guid_in_youtrack'
,
'issues_url'
=>
'http://youtrack/issues/:id'
}
)
end
youtrack_service
end
factory
:jira_project
,
parent: :project
do
has_external_issue_tracker
true
jira_service
end
...
...
spec/factories/services.rb
View file @
d35463bf
...
...
@@ -79,14 +79,12 @@ FactoryBot.define do
trait
:issue_tracker
do
properties
(
project_url:
'http://issue-tracker.example.com'
,
issues_url:
'http://issue-tracker.example.com'
,
issues_url:
'http://issue-tracker.example.com
/issues/:id
'
,
new_issue_url:
'http://issue-tracker.example.com'
)
end
factory
:jira_cloud_service
,
class:
JiraService
do
project
active
true
trait
:jira_cloud_service
do
properties
(
url:
'https://mysite.atlassian.net'
,
username:
'jira_user'
,
...
...
spec/factories/services_data.rb
View file @
d35463bf
# frozen_string_literal: true
# these factories should never be called directly, they are used when creating services
FactoryBot
.
define
do
factory
:jira_tracker_data
do
service
url
'http://jira.example.com'
api_url
'http://api-jira.example.com'
username
'jira_username'
password
'jira_password'
end
factory
:issue_tracker_data
do
service
project_url
'http://issuetracker.example.com'
issues_url
'http://issues.example.com'
new_issue_url
'http://new-issue.example.com'
end
end
spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
View file @
d35463bf
...
...
@@ -32,7 +32,7 @@ describe Banzai::Pipeline::GfmPipeline do
result
=
described_class
.
call
(
markdown
,
project:
project
)[
:output
]
link
=
result
.
css
(
'a'
).
first
expect
(
link
[
'href'
]).
to
eq
'http://
redmine/projects/project_name_in_redmine
/issues/12'
expect
(
link
[
'href'
]).
to
eq
'http://
issue-tracker.example.com
/issues/12'
end
it
'parses cross-project references to regular issues'
do
...
...
@@ -61,7 +61,7 @@ describe Banzai::Pipeline::GfmPipeline do
result
=
described_class
.
call
(
markdown
,
project:
project
)[
:output
]
link
=
result
.
css
(
'a'
).
first
expect
(
link
[
'href'
]).
to
eq
'http://
redmine/projects/project_name_in_redmine
/issues/12'
expect
(
link
[
'href'
]).
to
eq
'http://
issue-tracker.example.com
/issues/12'
end
it
'allows to use long external reference syntax for Redmine'
do
...
...
@@ -70,7 +70,7 @@ describe Banzai::Pipeline::GfmPipeline do
result
=
described_class
.
call
(
markdown
,
project:
project
)[
:output
]
link
=
result
.
css
(
'a'
).
first
expect
(
link
[
'href'
]).
to
eq
'http://
redmine/projects/project_name_in_redmine
/issues/12'
expect
(
link
[
'href'
]).
to
eq
'http://
issue-tracker.example.com
/issues/12'
end
it
'parses cross-project references to regular issues'
do
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
d35463bf
...
...
@@ -8,7 +8,7 @@ describe Gitlab::UsageData do
before
do
create
(
:jira_service
,
project:
projects
[
0
])
create
(
:jira_service
,
project:
projects
[
1
])
create
(
:jira_cloud_service
,
project:
projects
[
2
])
create
(
:jira_
service
,
:jira_
cloud_service
,
project:
projects
[
2
])
create
(
:prometheus_service
,
project:
projects
[
1
])
create
(
:service
,
project:
projects
[
0
],
type:
'SlackSlashCommandsService'
,
active:
true
)
create
(
:service
,
project:
projects
[
1
],
type:
'SlackService'
,
active:
true
)
...
...
spec/requests/api/services_spec.rb
View file @
d35463bf
...
...
@@ -85,9 +85,7 @@ describe API::Services do
include_context
service
# inject some properties into the service
before
do
initialize_service
(
service
)
end
let!
(
:initialized_service
)
{
initialize_service
(
service
)
}
it
'returns authentication error when unauthenticated'
do
get
api
(
"/projects/
#{
project
.
id
}
/services/
#{
dashed_service
}
"
)
...
...
@@ -108,6 +106,15 @@ describe API::Services do
expect
(
json_response
[
'properties'
].
keys
).
to
match_array
(
service_instance
.
api_field_names
)
end
it
"returns empty hash if properties are empty"
do
# deprecated services are not valid for update
initialized_service
.
update_attribute
(
:properties
,
{})
get
api
(
"/projects/
#{
project
.
id
}
/services/
#{
dashed_service
}
"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'properties'
].
keys
).
to
be_empty
end
it
"returns error when authenticated but not a project owner"
do
project
.
add_developer
(
user2
)
get
api
(
"/projects/
#{
project
.
id
}
/services/
#{
dashed_service
}
"
,
user2
)
...
...
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