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
Kazuhiko Shiozaki
gitlab-ce
Commits
bfb31a2a
Commit
bfb31a2a
authored
Dec 16, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 8-3-stable
parents
b6edaeba
9ede66f6
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
285 additions
and
162 deletions
+285
-162
CHANGELOG
CHANGELOG
+1
-0
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+4
-4
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+7
-7
app/views/projects/merge_requests/widget/open/_accept.html.haml
...ews/projects/merge_requests/widget/open/_accept.html.haml
+11
-13
doc/api/projects.md
doc/api/projects.md
+15
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+212
-133
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/api/projects.rb
lib/api/projects.rb
+11
-0
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
...features/merge_requests/merge_when_build_succeeds_spec.rb
+3
-3
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+20
-1
No files found.
CHANGELOG
View file @
bfb31a2a
Please view this file on the master branch, on stable branches it's out of date.
v 8.3.0 (unreleased)
- API support for starred projects for authorized user (Zeger-Jan van de Weg)
- Add open_issues_count to project API (Stan Hu)
- Expand character set of usernames created by Omniauth (Corey Hinshaw)
- Add button to automatically merge a merge request when the build succeeds (Zeger-Jan van de Weg)
...
...
app/views/projects/merge_requests/_new_submit.html.haml
View file @
bfb31a2a
...
...
@@ -23,15 +23,15 @@
=
link_to
url_for
(
params
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
Commits
%span
.badge
=
@commits
.
size
%li
.diffs-tab.active
=
link_to
url_for
(
params
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
Changes
%span
.badge
=
@diffs
.
size
-
if
@ci_commit
%li
.builds-tab.active
=
link_to
url_for
(
params
),
data:
{
target:
'div#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
Builds
%span
.badge
=
@statuses
.
size
%li
.diffs-tab.active
=
link_to
url_for
(
params
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
Changes
%span
.badge
=
@diffs
.
size
.tab-content
#commits
.commits.tab-pane
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
bfb31a2a
...
...
@@ -6,7 +6,7 @@
.merge-request
{
'data-url'
=>
merge_request_path
(
@merge_request
)}
=
render
"projects/merge_requests/show/mr_title"
.merge-request-details.issuable-details
.row
%section
.col-md-9
...
...
@@ -53,25 +53,25 @@
=
link_to
commits_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
Commits
%span
.badge
=
@commits
.
size
%li
.diffs-tab
=
link_to
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
Changes
%span
.badge
=
@merge_request
.
diffs
.
size
-
if
@ci_commit
%li
.builds-tab
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
Builds
%span
.badge
=
@statuses
.
size
%li
.diffs-tab
=
link_to
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
Changes
%span
.badge
=
@merge_request
.
diffs
.
size
.tab-content
#notes
.notes.tab-pane.voting_notes
=
render
"projects/merge_requests/discussion"
#commits
.commits.tab-pane
-
# This tab is always loaded via AJAX
#diffs
.diffs.tab-pane
-
# This tab is always loaded via AJAX
#builds
.builds.tab-pane
-
# This tab is always loaded via AJAX
#diffs
.diffs.tab-pane
-
# This tab is always loaded via AJAX
.mr-loading-status
=
spinner
...
...
app/views/projects/merge_requests/widget/open/_accept.html.haml
View file @
bfb31a2a
...
...
@@ -7,13 +7,13 @@
.accept-action
-
if
@ci_commit
&&
@ci_commit
.
active?
%span
.btn-group
=
link_to
"#"
,
class:
"btn btn-create
merge_when_build_succeeds"
do
=
button_tag
class:
"btn btn-create js-merge-button
merge_when_build_succeeds"
do
Merge When Build Succeeds
%a
.btn.btn-success.dropdown-toggle
{
'data-toggle'
=>
'dropdown'
}
=
button_tag
class:
"btn btn-success dropdown-toggle"
,
'data-toggle'
=>
'dropdown'
do
%span
.caret
%span
.sr-only
Select Merge Moment
%ul
.dropdown-menu.dropdown-menu-right
{
role:
'menu'
}
%ul
.
js-merge-dropdown.
dropdown-menu.dropdown-menu-right
{
role:
'menu'
}
%li
=
link_to
"#"
,
class:
"merge_when_build_succeeds"
do
=
icon
(
'check fw'
)
...
...
@@ -23,7 +23,7 @@
=
icon
(
'warning fw'
)
Merge Immediately
-
else
=
f
.
button
class:
"btn btn-create btn-grouped accept_merge_request
#{
status_class
}
"
do
=
f
.
button
class:
"btn btn-create btn-grouped
js-merge-button
accept_merge_request
#{
status_class
}
"
do
Accept Merge Request
-
if
@merge_request
.
can_remove_source_branch?
(
current_user
)
.accept-control.checkbox
...
...
@@ -42,21 +42,19 @@
=
hidden_field_tag
:merge_when_build_succeeds
,
""
,
autocomplete:
"off"
:javascript
$
(
'
.accept_merge_request
'
).
on
(
'
click
'
,
function
()
{
$
(
this
).
html
(
"
<i class='fa fa-spinner fa-spin'></i> Merge in progress
"
);
});
$
(
'
.accept-mr-form
'
).
on
(
'
ajax:send
'
,
function
()
{
$
(
"
.accept-mr-form :input
"
).
disable
();
});
$
(
'
a.accept_merge_request
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
closest
(
"
form
"
).
submit
();
$
(
'
.accept_merge_request
'
).
on
(
'
click
'
,
function
()
{
$
(
'
.js-merge-button
'
).
html
(
"
<i class='fa fa-spinner fa-spin'></i> Merge in progress
"
);
});
$
(
'
a.merge_when_build_succeeds
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
'
.merge_when_build_succeeds
'
).
on
(
'
click
'
,
function
()
{
$
(
"
#merge_when_build_succeeds
"
).
val
(
"
1
"
);
});
$
(
'
.js-merge-dropdown a
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
closest
(
"
form
"
).
submit
();
});
doc/api/projects.md
View file @
bfb31a2a
...
...
@@ -139,6 +139,21 @@ Parameters:
-
`sort`
(optional) - Return requests sorted in
`asc`
or
`desc`
order. Default is
`desc`
-
`search`
(optional) - Return list of authorized projects according to a search criteria
### List starred projects
Get a list of projects which are starred by the authenticated user.
```
GET /projects/starred
```
Parameters:
-
`archived`
(optional) - if passed, limit by archived status
-
`order_by`
(optional) - Return requests ordered by
`id`
,
`name`
,
`path`
,
`created_at`
,
`updated_at`
or
`last_activity_at`
fields. Default is
`created_at`
-
`sort`
(optional) - Return requests sorted in
`asc`
or
`desc`
order. Default is
`desc`
-
`search`
(optional) - Return list of authorized projects according to a search criteria
### List ALL projects
Get a list of all GitLab projects (admin only).
...
...
doc/ci/yaml/README.md
View file @
bfb31a2a
This diff is collapsed.
Click to expand it.
lib/api/entities.rb
View file @
bfb31a2a
...
...
@@ -70,7 +70,7 @@ module API
expose
:forked_from_project
,
using:
Entities
::
ForkedFromProject
,
if:
lambda
{
|
project
,
options
|
project
.
forked?
}
expose
:avatar_url
expose
:star_count
,
:forks_count
expose
:open_issues_count
,
if:
lambda
{
|
project
,
options
|
project
.
issues_enabled?
&&
project
.
default_issues_tracker?
}
expose
:open_issues_count
,
if:
lambda
{
|
project
,
options
|
project
.
issues_enabled?
&&
project
.
default_issues_tracker?
}
end
class
ProjectMember
<
UserBasic
...
...
lib/api/projects.rb
View file @
bfb31a2a
...
...
@@ -39,6 +39,17 @@ module API
present
@projects
,
with:
Entities
::
Project
end
# Gets starred project for the authenticated user
#
# Example Request:
# GET /projects/starred
get
'/starred'
do
@projects
=
current_user
.
starred_projects
@projects
=
filter_projects
(
@projects
)
@projects
=
paginate
@projects
present
@projects
,
with:
Entities
::
Project
end
# Get all projects for admin user
#
# Example Request:
...
...
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
View file @
bfb31a2a
...
...
@@ -21,12 +21,12 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
it
'displays the Merge When Build Succeeds button'
do
expect
(
page
).
to
have_
link
"Merge When Build Succeeds"
expect
(
page
).
to
have_
button
"Merge When Build Succeeds"
end
context
"Merge When Build succeeds enabled"
do
before
do
click_
link
"Merge When Build Succeeds"
click_
button
"Merge When Build Succeeds"
end
it
'activates Merge When Build Succeeds feature'
do
...
...
@@ -58,7 +58,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
it
'cancels the automatic merge'
do
click_link
"Cancel Automatic Merge"
expect
(
page
).
to
have_
link
"Merge When Build Succeeds"
expect
(
page
).
to
have_
button
"Merge When Build Succeeds"
visit_merge_request
(
merge_request
)
# Needed to refresh the page
expect
(
page
).
to
have_content
"Canceled the automatic merge"
...
...
spec/requests/api/projects_spec.rb
View file @
bfb31a2a
...
...
@@ -139,6 +139,25 @@ describe API::API, api: true do
end
end
describe
'GET /projects/starred'
do
before
do
admin
.
starred_projects
<<
project
admin
.
save!
end
it
'should return the starred projects'
do
get
api
(
'/projects/all'
,
admin
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
satisfy
do
|
response
|
response
.
one?
do
|
entry
|
entry
[
'name'
]
==
project
.
name
end
end
end
end
describe
'POST /projects'
do
context
'maximum number of projects reached'
do
it
'should not create new project and respond with 403'
do
...
...
@@ -471,7 +490,7 @@ describe API::API, api: true do
end
end
describe
'PUT /projects/:id/snippets/:s
h
ippet_id'
do
describe
'PUT /projects/:id/snippets/:s
n
ippet_id'
do
it
'should update an existing project snippet'
do
put
api
(
"/projects/
#{
project
.
id
}
/snippets/
#{
snippet
.
id
}
"
,
user
),
code:
'updated code'
...
...
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