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
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.
Please view this file on the master branch, on stable branches it's out of date.
v 8.3.0 (unreleased)
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)
- Add open_issues_count to project API (Stan Hu)
- Expand character set of usernames created by Omniauth (Corey Hinshaw)
- 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)
- 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 @@
...
@@ -23,15 +23,15 @@
=
link_to
url_for
(
params
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
=
link_to
url_for
(
params
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
Commits
Commits
%span
.badge
=
@commits
.
size
%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
-
if
@ci_commit
%li
.builds-tab.active
%li
.builds-tab.active
=
link_to
url_for
(
params
),
data:
{
target:
'div#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
=
link_to
url_for
(
params
),
data:
{
target:
'div#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
Builds
Builds
%span
.badge
=
@statuses
.
size
%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
.tab-content
#commits
.commits.tab-pane
#commits
.commits.tab-pane
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
bfb31a2a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
.merge-request
{
'data-url'
=>
merge_request_path
(
@merge_request
)}
.merge-request
{
'data-url'
=>
merge_request_path
(
@merge_request
)}
=
render
"projects/merge_requests/show/mr_title"
=
render
"projects/merge_requests/show/mr_title"
.merge-request-details.issuable-details
.merge-request-details.issuable-details
.row
.row
%section
.col-md-9
%section
.col-md-9
...
@@ -53,25 +53,25 @@
...
@@ -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
=
link_to
commits_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
Commits
Commits
%span
.badge
=
@commits
.
size
%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
-
if
@ci_commit
%li
.builds-tab
%li
.builds-tab
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
Builds
Builds
%span
.badge
=
@statuses
.
size
%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
.tab-content
#notes
.notes.tab-pane.voting_notes
#notes
.notes.tab-pane.voting_notes
=
render
"projects/merge_requests/discussion"
=
render
"projects/merge_requests/discussion"
#commits
.commits.tab-pane
#commits
.commits.tab-pane
-
# This tab is always loaded via AJAX
-
# This tab is always loaded via AJAX
#diffs
.diffs.tab-pane
-
# This tab is always loaded via AJAX
#builds
.builds.tab-pane
#builds
.builds.tab-pane
-
# This tab is always loaded via AJAX
-
# This tab is always loaded via AJAX
#diffs
.diffs.tab-pane
-
# This tab is always loaded via AJAX
.mr-loading-status
.mr-loading-status
=
spinner
=
spinner
...
...
app/views/projects/merge_requests/widget/open/_accept.html.haml
View file @
bfb31a2a
...
@@ -7,13 +7,13 @@
...
@@ -7,13 +7,13 @@
.accept-action
.accept-action
-
if
@ci_commit
&&
@ci_commit
.
active?
-
if
@ci_commit
&&
@ci_commit
.
active?
%span
.btn-group
%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
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
.caret
%span
.sr-only
%span
.sr-only
Select Merge Moment
Select Merge Moment
%ul
.dropdown-menu.dropdown-menu-right
{
role:
'menu'
}
%ul
.
js-merge-dropdown.
dropdown-menu.dropdown-menu-right
{
role:
'menu'
}
%li
%li
=
link_to
"#"
,
class:
"merge_when_build_succeeds"
do
=
link_to
"#"
,
class:
"merge_when_build_succeeds"
do
=
icon
(
'check fw'
)
=
icon
(
'check fw'
)
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
=
icon
(
'warning fw'
)
=
icon
(
'warning fw'
)
Merge Immediately
Merge Immediately
-
else
-
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
Accept Merge Request
-
if
@merge_request
.
can_remove_source_branch?
(
current_user
)
-
if
@merge_request
.
can_remove_source_branch?
(
current_user
)
.accept-control.checkbox
.accept-control.checkbox
...
@@ -42,21 +42,19 @@
...
@@ -42,21 +42,19 @@
=
hidden_field_tag
:merge_when_build_succeeds
,
""
,
autocomplete:
"off"
=
hidden_field_tag
:merge_when_build_succeeds
,
""
,
autocomplete:
"off"
:javascript
: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
'
).
on
(
'
ajax:send
'
,
function
()
{
$
(
"
.accept-mr-form :input
"
).
disable
();
$
(
"
.accept-mr-form :input
"
).
disable
();
});
});
$
(
'
a.accept_merge_request
'
).
on
(
'
click
'
,
function
(
e
)
{
$
(
'
.accept_merge_request
'
).
on
(
'
click
'
,
function
()
{
e
.
preventDefault
();
$
(
'
.js-merge-button
'
).
html
(
"
<i class='fa fa-spinner fa-spin'></i> Merge in progress
"
);
$
(
this
).
closest
(
"
form
"
).
submit
();
});
});
$
(
'
a.merge_when_build_succeeds
'
).
on
(
'
click
'
,
function
(
e
)
{
$
(
'
.merge_when_build_succeeds
'
).
on
(
'
click
'
,
function
()
{
e
.
preventDefault
();
$
(
"
#merge_when_build_succeeds
"
).
val
(
"
1
"
);
$
(
"
#merge_when_build_succeeds
"
).
val
(
"
1
"
);
});
$
(
'
.js-merge-dropdown a
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
closest
(
"
form
"
).
submit
();
$
(
this
).
closest
(
"
form
"
).
submit
();
});
});
doc/api/projects.md
View file @
bfb31a2a
...
@@ -139,6 +139,21 @@ Parameters:
...
@@ -139,6 +139,21 @@ Parameters:
-
`sort`
(optional) - Return requests sorted in
`asc`
or
`desc`
order. Default is
`desc`
-
`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
-
`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
### List ALL projects
Get a list of all GitLab projects (admin only).
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
...
@@ -70,7 +70,7 @@ module API
expose
:forked_from_project
,
using:
Entities
::
ForkedFromProject
,
if:
lambda
{
|
project
,
options
|
project
.
forked?
}
expose
:forked_from_project
,
using:
Entities
::
ForkedFromProject
,
if:
lambda
{
|
project
,
options
|
project
.
forked?
}
expose
:avatar_url
expose
:avatar_url
expose
:star_count
,
:forks_count
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
end
class
ProjectMember
<
UserBasic
class
ProjectMember
<
UserBasic
...
...
lib/api/projects.rb
View file @
bfb31a2a
...
@@ -39,6 +39,17 @@ module API
...
@@ -39,6 +39,17 @@ module API
present
@projects
,
with:
Entities
::
Project
present
@projects
,
with:
Entities
::
Project
end
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
# Get all projects for admin user
#
#
# Example Request:
# 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
...
@@ -21,12 +21,12 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
end
it
'displays the Merge When Build Succeeds button'
do
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
end
context
"Merge When Build succeeds enabled"
do
context
"Merge When Build succeeds enabled"
do
before
do
before
do
click_
link
"Merge When Build Succeeds"
click_
button
"Merge When Build Succeeds"
end
end
it
'activates Merge When Build Succeeds feature'
do
it
'activates Merge When Build Succeeds feature'
do
...
@@ -58,7 +58,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
...
@@ -58,7 +58,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
it
'cancels the automatic merge'
do
it
'cancels the automatic merge'
do
click_link
"Cancel Automatic Merge"
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
visit_merge_request
(
merge_request
)
# Needed to refresh the page
expect
(
page
).
to
have_content
"Canceled the automatic merge"
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
...
@@ -139,6 +139,25 @@ describe API::API, api: true do
end
end
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
describe
'POST /projects'
do
context
'maximum number of projects reached'
do
context
'maximum number of projects reached'
do
it
'should not create new project and respond with 403'
do
it
'should not create new project and respond with 403'
do
...
@@ -471,7 +490,7 @@ describe API::API, api: true do
...
@@ -471,7 +490,7 @@ describe API::API, api: true do
end
end
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
it
'should update an existing project snippet'
do
put
api
(
"/projects/
#{
project
.
id
}
/snippets/
#{
snippet
.
id
}
"
,
user
),
put
api
(
"/projects/
#{
project
.
id
}
/snippets/
#{
snippet
.
id
}
"
,
user
),
code:
'updated code'
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