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
Boxiang Sun
gitlab-ce
Commits
5f2562df
Commit
5f2562df
authored
Aug 14, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:gitlabhq/gitlabhq
parents
d891b23e
f6f58cfb
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
110 additions
and
32 deletions
+110
-32
CHANGELOG
CHANGELOG
+8
-4
VERSION
VERSION
+1
-1
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+0
-5
app/controllers/projects/services_controller.rb
app/controllers/projects/services_controller.rb
+5
-2
app/models/note.rb
app/models/note.rb
+4
-0
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+10
-0
app/models/service.rb
app/models/service.rb
+7
-1
app/views/projects/_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+0
-5
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+9
-9
app/views/projects/merge_requests/widget/open/_accept.html.haml
...ews/projects/merge_requests/widget/open/_accept.html.haml
+0
-1
doc/api/notes.md
doc/api/notes.md
+8
-2
lib/api/entities.rb
lib/api/entities.rb
+3
-0
lib/gitlab/markup_helper.rb
lib/gitlab/markup_helper.rb
+1
-1
spec/controllers/projects/services_controller_spec.rb
spec/controllers/projects/services_controller_spec.rb
+35
-0
spec/lib/gitlab/markup_helper_spec.rb
spec/lib/gitlab/markup_helper_spec.rb
+1
-1
spec/models/project_services/hipchat_service_spec.rb
spec/models/project_services/hipchat_service_spec.rb
+8
-0
spec/models/service_spec.rb
spec/models/service_spec.rb
+10
-0
No files found.
CHANGELOG
View file @
5f2562df
Please view this file on the master branch, on stable branches it's out of date.
v 7.14.0 (unreleased)
- Provide more feedback what went wrong if HipChat service failed test (Stan Hu)
- Disable turbolinks when linking to Bitbucket import status (Stan Hu)
- Fix broken code import and display error messages if something went wrong with creating project (Stan Hu)
- Fix corrupted binary files when using API files endpoint (Stan Hu)
...
...
@@ -29,12 +30,8 @@ v 7.14.0 (unreleased)
- Return comments in created order in merge request API (Stan Hu)
- Expire Rails cache entries after two weeks to prevent endless Redis growth
- Add support for destroying project milestones (Stan Hu)
- Add fetch command to the MR page.
- Allow custom backup archive permissions
- Add fetch command to the MR page
- Add project star and fork count, group avatar URL and user/group web URL attributes to API
- Fix bug causing Bitbucket importer to crash when OAuth application had been removed.
- Add fetch command to the MR page.
- Show who last edited a comment if it wasn't the original author
- Send notification to all participants when MR is merged.
- Add ability to manage user email addresses via the API.
...
...
@@ -56,6 +53,13 @@ v 7.14.0 (unreleased)
- Include branch/tag name in archive file and directory name
- Add dropzone upload progress
- Add a label for merged branches on branches page (Florent Baldino)
- Detect .mkd and .mkdn files as markdown (Ben Boeckel)
v 7.13.5
- Satellites reverted
v 7.13.4
- Allow users to send abuse reports
v 7.13.3
- Fix bug causing Bitbucket importer to crash when OAuth application had been removed.
...
...
VERSION
View file @
5f2562df
7.1
3
.0.pre
7.1
4
.0.pre
app/assets/javascripts/project.js.coffee
View file @
5f2562df
...
...
@@ -24,8 +24,3 @@ class @Project
$
.
cookie
(
'hide_no_password_message'
,
'false'
,
{
path
:
path
})
$
(
@
).
parents
(
'.no-password-message'
).
remove
()
e
.
preventDefault
()
$
(
'.js-toggle-clone-holder'
).
on
'click'
,
(
e
)
->
cloneHolder
.
toggle
()
cloneHolder
.
hide
()
unless
$
(
'.empty-project'
).
length
app/controllers/projects/services_controller.rb
View file @
5f2562df
...
...
@@ -39,10 +39,13 @@ class Projects::ServicesController < Projects::ApplicationController
def
test
data
=
Gitlab
::
PushDataBuilder
.
build_sample
(
project
,
current_user
)
if
@service
.
execute
(
data
)
outcome
=
@service
.
test
(
data
)
if
outcome
[
:success
]
message
=
{
notice:
'We sent a request to the provided URL'
}
else
message
=
{
alert:
'We tried to send a request to the provided URL but an error occured'
}
error_message
=
"We tried to send a request to the provided URL but an error occurred"
error_message
<<
":
#{
outcome
[
:result
]
}
"
if
outcome
[
:result
].
present?
message
=
{
alert:
error_message
}
end
redirect_to
:back
,
message
...
...
app/models/note.rb
View file @
5f2562df
...
...
@@ -360,6 +360,10 @@ class Note < ActiveRecord::Base
create_new_cross_references!
(
project
,
author
)
end
def
system?
read_attribute
(
:system
)
end
def
editable?
!
read_attribute
(
:system
)
end
...
...
app/models/project_services/hipchat_service.rb
View file @
5f2562df
...
...
@@ -60,6 +60,16 @@ class HipchatService < Service
gate
[
room
].
send
(
'GitLab'
,
message
,
message_options
)
end
def
test
(
data
)
begin
result
=
execute
(
data
)
rescue
StandardError
=>
error
return
{
success:
false
,
result:
error
}
end
{
success:
true
,
result:
result
}
end
private
def
gate
...
...
app/models/service.rb
View file @
5f2562df
...
...
@@ -87,10 +87,16 @@ class Service < ActiveRecord::Base
%w(push tag_push issue merge_request)
end
def
execute
def
execute
(
data
)
# implement inside child
end
def
test
(
data
)
# default implementation
result
=
execute
(
data
)
{
success:
result
.
present?
,
result:
result
}
end
def
can_test?
!
project
.
empty_repo?
end
...
...
app/views/projects/_home_panel.html.haml
View file @
5f2562df
...
...
@@ -20,11 +20,6 @@
Forked from
=
forked_from_project
.
namespace
.
try
(
:name
)
-
if
can?
current_user
,
:download_code
,
@project
=
link_to
"#"
,
class:
'btn js-toggle-clone-holder'
do
=
icon
(
'cloud-download fw'
)
Clone
-
if
can?
current_user
,
:download_code
,
@project
=
link_to
archive_namespace_project_repository_path
(
@project
.
namespace
,
@project
,
ref:
@ref
,
format:
'zip'
),
class:
'btn'
,
rel:
'nofollow'
do
=
icon
(
'download fw'
)
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
5f2562df
...
...
@@ -22,19 +22,19 @@
%li
=
link_to
"Email Patches"
,
merge_request_path
(
@merge_request
,
format: :patch
)
%li
=
link_to
"Plain Diff"
,
merge_request_path
(
@merge_request
,
format: :diff
)
.light
%div
%span
Request to merge
%span
.label-branch
#{
source_branch_with_namespace
(
@merge_request
)
}
%span
into
%span
.label-branch
#{
@merge_request
.
target_branch
}
-
if
@merge_request
.
open?
&&
!
@merge_request
.
branch_missing?
%div
If you want to try or merge this request manually, you can use the
=
link_to
"command line"
,
"#modal_merge_info"
,
class:
"how_to_merge_link vlink"
,
title:
"How To Merge"
,
"data-toggle"
=>
"modal"
=
render
"projects/merge_requests/show/how_to_merge"
=
render
"projects/merge_requests/widget/show.html.haml"
-
if
@merge_request
.
open?
&&
@merge_request
.
can_be_merged?
.light
You can also accept this merge request manually using the
=
link_to
"command line"
,
"#modal_merge_info"
,
class:
"how_to_merge_link vlink"
,
title:
"How To Merge"
,
"data-toggle"
=>
"modal"
-
if
@commits
.
present?
%ul
.nav.nav-tabs.merge-request-tabs
%li
.notes-tab
...
...
app/views/projects/merge_requests/widget/open/_accept.html.haml
View file @
5f2562df
...
...
@@ -23,4 +23,3 @@
btn = $('.accept_merge_request')
btn.disable()
btn.html("<i class='fa fa-spinner fa-spin'></i> Merge in progress")
doc/api/notes.md
View file @
5f2562df
...
...
@@ -31,7 +31,10 @@ Parameters:
"state"
:
"active"
,
"created_at"
:
"2013-09-30T13:46:01Z"
},
"created_at"
:
"2013-10-02T09:22:45Z"
"created_at"
:
"2013-10-02T09:22:45Z"
,
"system"
:
true
,
"upvote"
:
false
,
"downvote"
:
false
},
{
"id"
:
305
,
...
...
@@ -45,7 +48,10 @@ Parameters:
"state"
:
"active"
,
"created_at"
:
"2013-09-30T13:46:01Z"
},
"created_at"
:
"2013-10-02T09:56:03Z"
"created_at"
:
"2013-10-02T09:56:03Z"
,
"system"
:
false
,
"upvote"
:
false
,
"downvote"
:
false
}
]
```
...
...
lib/api/entities.rb
View file @
5f2562df
...
...
@@ -205,6 +205,9 @@ module API
expose
:attachment_identifier
,
as: :attachment
expose
:author
,
using:
Entities
::
UserBasic
expose
:created_at
expose
:system?
,
as: :system
expose
:upvote?
,
as: :upvote
expose
:downvote?
,
as: :downvote
end
class
MRNote
<
Grape
::
Entity
...
...
lib/gitlab/markup_helper.rb
View file @
5f2562df
...
...
@@ -21,7 +21,7 @@ module Gitlab
#
# Returns boolean
def
gitlab_markdown?
(
filename
)
filename
.
downcase
.
end_with?
(
*
%w(.mdown .md .markdown)
)
filename
.
downcase
.
end_with?
(
*
%w(.mdown .m
kd .mkdn .m
d .markdown)
)
end
# Public: Determines if the given filename has AsciiDoc extension.
...
...
spec/controllers/projects/services_controller_spec.rb
0 → 100644
View file @
5f2562df
require
'spec_helper'
describe
Projects
::
ServicesController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:service
)
{
create
(
:service
,
project:
project
)
}
before
do
sign_in
(
user
)
project
.
team
<<
[
user
,
:master
]
controller
.
instance_variable_set
(
:@project
,
project
)
controller
.
instance_variable_set
(
:@service
,
service
)
request
.
env
[
"HTTP_REFERER"
]
=
"/"
end
describe
"#test"
do
context
'success'
do
it
"should redirect and show success message"
do
expect
(
service
).
to
receive
(
:test
).
and_return
({
success:
true
,
result:
'done'
})
get
:test
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
,
id:
service
.
id
,
format: :html
expect
(
response
.
status
).
to
redirect_to
(
'/'
)
expect
(
flash
[
:notice
]).
to
eq
(
'We sent a request to the provided URL'
)
end
end
context
'failure'
do
it
"should redirect and show failure message"
do
expect
(
service
).
to
receive
(
:test
).
and_return
({
success:
false
,
result:
'Bad test'
})
get
:test
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
,
id:
service
.
id
,
format: :html
expect
(
response
.
status
).
to
redirect_to
(
'/'
)
expect
(
flash
[
:alert
]).
to
eq
(
'We tried to send a request to the provided URL but an error occurred: Bad test'
)
end
end
end
end
spec/lib/gitlab/markup_helper_spec.rb
View file @
5f2562df
...
...
@@ -15,7 +15,7 @@ describe Gitlab::MarkupHelper do
end
describe
'#gitlab_markdown?'
do
%w(mdown md markdown)
.
each
do
|
type
|
%w(mdown m
kd mkdn m
d markdown)
.
each
do
|
type
|
it
"returns true for
#{
type
}
files"
do
expect
(
Gitlab
::
MarkupHelper
.
gitlab_markdown?
(
"README.
#{
type
}
"
)).
to
be_truthy
end
...
...
spec/models/project_services/hipchat_service_spec.rb
View file @
5f2562df
...
...
@@ -47,6 +47,14 @@ describe HipchatService do
WebMock
.
stub_request
(
:post
,
api_url
)
end
it
'should test and return errors'
do
allow
(
hipchat
).
to
receive
(
:execute
).
and_raise
(
StandardError
,
'no such room'
)
result
=
hipchat
.
test
(
push_sample_data
)
expect
(
result
[
:success
]).
to
be_falsey
expect
(
result
[
:result
].
to_s
).
to
eq
(
'no such room'
)
end
it
'should use v1 if version is provided'
do
allow
(
hipchat
).
to
receive
(
:api_version
).
and_return
(
'v1'
)
expect
(
HipChat
::
Client
).
to
receive
(
:new
).
...
...
spec/models/service_spec.rb
View file @
5f2562df
...
...
@@ -46,6 +46,16 @@ describe Service do
describe
:can_test
do
it
{
expect
(
@testable
).
to
eq
(
true
)
}
end
describe
:test
do
let
(
:data
)
{
'test'
}
it
'test runs execute'
do
expect
(
@service
).
to
receive
(
:execute
).
with
(
data
)
@service
.
test
(
data
)
end
end
end
describe
"With commits"
do
...
...
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