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
d1085ef8
Commit
d1085ef8
authored
Jan 18, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-01-18
# Conflicts: # app/models/hooks/project_hook.rb [ci skip]
parents
4431246d
8e9c073a
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
182 additions
and
19 deletions
+182
-19
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+5
-0
app/assets/javascripts/pages/admin/jobs/index/components/stop_jobs_modal.vue
...pts/pages/admin/jobs/index/components/stop_jobs_modal.vue
+47
-0
app/assets/javascripts/pages/admin/jobs/index/index.js
app/assets/javascripts/pages/admin/jobs/index/index.js
+29
-0
app/assets/stylesheets/framework/modal.scss
app/assets/stylesheets/framework/modal.scss
+1
-0
app/controllers/admin/jobs_controller.rb
app/controllers/admin/jobs_controller.rb
+1
-1
app/models/hooks/project_hook.rb
app/models/hooks/project_hook.rb
+5
-0
app/views/admin/jobs/index.html.haml
app/views/admin/jobs/index.html.haml
+6
-1
doc/api/project_snippets.md
doc/api/project_snippets.md
+5
-4
doc/ci/examples/test-phoenix-application.md
doc/ci/examples/test-phoenix-application.md
+0
-1
doc/install/requirements.md
doc/install/requirements.md
+1
-0
doc/user/admin_area/monitoring/img/convdev_index.png
doc/user/admin_area/monitoring/img/convdev_index.png
+0
-0
lib/api/project_snippets.rb
lib/api/project_snippets.rb
+1
-1
spec/features/admin/admin_builds_spec.rb
spec/features/admin/admin_builds_spec.rb
+8
-8
spec/javascripts/pages/admin/jobs/index/components/stop_jobs_modal_spec.js
...pages/admin/jobs/index/components/stop_jobs_modal_spec.js
+63
-0
spec/requests/api/project_snippets_spec.rb
spec/requests/api/project_snippets_spec.rb
+10
-3
No files found.
app/assets/javascripts/dispatcher.js
View file @
d1085ef8
...
...
@@ -180,6 +180,11 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
case
'
dashboard:todos:index
'
:
import
(
'
./pages/dashboard/todos/index
'
).
then
(
callDefault
).
catch
(
fail
);
break
;
case
'
admin:jobs:index
'
:
import
(
'
./pages/admin/jobs/index
'
)
.
then
(
callDefault
)
.
catch
(
fail
);
break
;
case
'
dashboard:projects:index
'
:
case
'
dashboard:projects:starred
'
:
import
(
'
./pages/dashboard/projects
'
)
...
...
app/assets/javascripts/pages/admin/jobs/index/components/stop_jobs_modal.vue
0 → 100644
View file @
d1085ef8
<
script
>
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
Flash
from
'
~/flash
'
;
import
modal
from
'
~/vue_shared/components/modal.vue
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
redirectTo
}
from
'
~/lib/utils/url_utility
'
;
export
default
{
components
:
{
modal
,
},
props
:
{
url
:
{
type
:
String
,
required
:
true
,
},
},
computed
:
{
text
()
{
return
s__
(
'
AdminArea|You’re about to stop all jobs. This will halt all current jobs that are running.
'
);
},
},
methods
:
{
onSubmit
()
{
return
axios
.
post
(
this
.
url
)
.
then
((
response
)
=>
{
// follow the rediect to refresh the page
redirectTo
(
response
.
request
.
responseURL
);
})
.
catch
((
error
)
=>
{
Flash
(
s__
(
'
AdminArea|Stopping jobs failed
'
));
throw
error
;
});
},
},
};
</
script
>
<
template
>
<modal
id=
"stop-jobs-modal"
:title=
"s__('AdminArea|Stop all jobs?')"
:text=
"text"
kind=
"danger"
:primary-button-label=
"s__('AdminArea|Stop jobs')"
@
submit=
"onSubmit"
/>
</
template
>
app/assets/javascripts/pages/admin/jobs/index/index.js
0 → 100644
View file @
d1085ef8
import
Vue
from
'
vue
'
;
import
Translate
from
'
~/vue_shared/translate
'
;
import
stopJobsModal
from
'
./components/stop_jobs_modal.vue
'
;
Vue
.
use
(
Translate
);
export
default
()
=>
{
const
stopJobsButton
=
document
.
getElementById
(
'
stop-jobs-button
'
);
// eslint-disable-next-line no-new
new
Vue
({
el
:
'
#stop-jobs-modal
'
,
components
:
{
stopJobsModal
,
},
mounted
()
{
stopJobsButton
.
classList
.
remove
(
'
disabled
'
);
},
render
(
createElement
)
{
return
createElement
(
'
stop-jobs-modal
'
,
{
props
:
{
url
:
stopJobsButton
.
dataset
.
url
,
},
});
},
});
};
app/assets/stylesheets/framework/modal.scss
View file @
d1085ef8
...
...
@@ -12,6 +12,7 @@
min-height
:
$modal-body-height
;
position
:
relative
;
padding
:
#{
3
*
$grid-size
}
#{
2
*
$grid-size
}
;
text-align
:
left
;
.form-actions
{
margin
:
#{
2
*
$grid-size
}
#{
-2
*
$grid-size
}
#{
-2
*
$grid-size
}
;
...
...
app/controllers/admin/jobs_controller.rb
View file @
d1085ef8
...
...
@@ -20,6 +20,6 @@ class Admin::JobsController < Admin::ApplicationController
def
cancel_all
Ci
::
Build
.
running_or_pending
.
each
(
&
:cancel
)
redirect_to
admin_jobs_path
redirect_to
admin_jobs_path
,
status:
303
end
end
app/models/hooks/project_hook.rb
View file @
d1085ef8
class
ProjectHook
<
WebHook
<<<<<<<
HEAD
include
CustomModelNaming
include
TriggerableHooks
self
.
singular_route_key
=
:hook
=======
include
TriggerableHooks
>>>>>>>
upstream
/
master
triggerable_hooks
[
:push_hooks
,
:tag_push_hooks
,
...
...
app/views/admin/jobs/index.html.haml
View file @
d1085ef8
...
...
@@ -9,7 +9,12 @@
.nav-controls
-
if
@all_builds
.
running_or_pending
.
any?
=
link_to
'Cancel all'
,
cancel_all_admin_jobs_path
,
data:
{
confirm:
'Are you sure?'
},
class:
'btn btn-danger'
,
method: :post
#stop-jobs-modal
%button
#stop-jobs-button
.btn.btn-danger
{
data:
{
toggle:
'modal'
,
target:
'#stop-jobs-modal'
,
url:
cancel_all_admin_jobs_path
}
}
=
s_
(
'AdminArea|Stop all jobs'
)
.row-content-block.second-block
#{
(
@scope
||
'all'
).
capitalize
}
jobs
...
...
doc/api/project_snippets.md
View file @
d1085ef8
...
...
@@ -132,11 +132,12 @@ GET /projects/:id/snippets/:snippet_id/user_agent_detail
```
| Attribute | Type | Required | Description |
|-------------|---------|----------|--------------------------------------|
|
`id`
| Integer | yes | The ID of a snippet |
|---------------|---------|----------|--------------------------------------|
|
`id`
| Integer | yes | The ID of a project |
|
`snippet_id`
| Integer | yes | The ID of a snippet |
```
bash
curl
--request
GET
--header
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
https://gitlab.example.com/api/v4/projects/1/snippets/
1
/user_agent_detail
curl
--request
GET
--header
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
https://gitlab.example.com/api/v4/projects/1/snippets/
2
/user_agent_detail
```
Example response:
...
...
doc/ci/examples/test-phoenix-application.md
View file @
d1085ef8
...
...
@@ -53,4 +53,3 @@ If you do not have any migrations yet, you will need to create an empty
## Sources
-
https://medium.com/@nahtnam/using-phoenix-on-gitlab-ci-5a51eec81142
-
https://davejlong.com/ci-with-phoenix-and-gitlab/
doc/install/requirements.md
View file @
d1085ef8
...
...
@@ -7,6 +7,7 @@
-
Ubuntu
-
Debian
-
CentOS
-
openSUSE
-
Red Hat Enterprise Linux (please use the CentOS packages and instructions)
-
Scientific Linux (please use the CentOS packages and instructions)
-
Oracle Linux (please use the CentOS packages and instructions)
...
...
doc/user/admin_area/monitoring/img/convdev_index.png
View replaced file @
4431246d
View file @
d1085ef8
113 KB
|
W:
|
H:
117 KB
|
W:
|
H:
2-up
Swipe
Onion skin
lib/api/project_snippets.rb
View file @
d1085ef8
...
...
@@ -143,7 +143,7 @@ module API
get
":id/snippets/:snippet_id/user_agent_detail"
do
authenticated_as_admin!
snippet
=
Snippet
.
find_by!
(
id:
params
[
:id
])
snippet
=
Snippet
.
find_by!
(
id:
params
[
:
snippet_id
],
project_id:
params
[
:
id
])
return
not_found!
(
'UserAgentDetail'
)
unless
snippet
.
user_agent_detail
...
...
spec/features/admin/admin_builds_spec.rb
View file @
d1085ef8
...
...
@@ -21,7 +21,7 @@ describe 'Admin Builds' do
expect
(
page
).
to
have_selector
(
'.nav-links li.active'
,
text:
'All'
)
expect
(
page
).
to
have_selector
(
'.row-content-block'
,
text:
'All jobs'
)
expect
(
page
.
all
(
'.build-link'
).
size
).
to
eq
(
4
)
expect
(
page
).
to
have_
link
'Cancel all
'
expect
(
page
).
to
have_
button
'Stop all jobs
'
end
end
...
...
@@ -31,7 +31,7 @@ describe 'Admin Builds' do
expect
(
page
).
to
have_selector
(
'.nav-links li.active'
,
text:
'All'
)
expect
(
page
).
to
have_content
'No jobs to show'
expect
(
page
).
not_to
have_
link
'Cancel all
'
expect
(
page
).
not_to
have_
button
'Stop all jobs
'
end
end
end
...
...
@@ -51,7 +51,7 @@ describe 'Admin Builds' do
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build2
.
id
)
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build3
.
id
)
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build4
.
id
)
expect
(
page
).
to
have_
link
'Cancel all
'
expect
(
page
).
to
have_
button
'Stop all jobs
'
end
end
...
...
@@ -63,7 +63,7 @@ describe 'Admin Builds' do
expect
(
page
).
to
have_selector
(
'.nav-links li.active'
,
text:
'Pending'
)
expect
(
page
).
to
have_content
'No jobs to show'
expect
(
page
).
not_to
have_
link
'Cancel all
'
expect
(
page
).
not_to
have_
button
'Stop all jobs
'
end
end
end
...
...
@@ -83,7 +83,7 @@ describe 'Admin Builds' do
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build2
.
id
)
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build3
.
id
)
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build4
.
id
)
expect
(
page
).
to
have_
link
'Cancel all
'
expect
(
page
).
to
have_
button
'Stop all jobs
'
end
end
...
...
@@ -95,7 +95,7 @@ describe 'Admin Builds' do
expect
(
page
).
to
have_selector
(
'.nav-links li.active'
,
text:
'Running'
)
expect
(
page
).
to
have_content
'No jobs to show'
expect
(
page
).
not_to
have_
link
'Cancel all
'
expect
(
page
).
not_to
have_
button
'Stop all jobs
'
end
end
end
...
...
@@ -113,7 +113,7 @@ describe 'Admin Builds' do
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build1
.
id
)
expect
(
page
.
find
(
'.build-link'
)).
not_to
have_content
(
build2
.
id
)
expect
(
page
.
find
(
'.build-link'
)).
to
have_content
(
build3
.
id
)
expect
(
page
).
to
have_
link
'Cancel all
'
expect
(
page
).
to
have_
button
'Stop all jobs
'
end
end
...
...
@@ -125,7 +125,7 @@ describe 'Admin Builds' do
expect
(
page
).
to
have_selector
(
'.nav-links li.active'
,
text:
'Finished'
)
expect
(
page
).
to
have_content
'No jobs to show'
expect
(
page
).
to
have_
link
'Cancel all
'
expect
(
page
).
to
have_
button
'Stop all jobs
'
end
end
end
...
...
spec/javascripts/pages/admin/jobs/index/components/stop_jobs_modal_spec.js
0 → 100644
View file @
d1085ef8
import
Vue
from
'
vue
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
stopJobsModal
from
'
~/pages/admin/jobs/index/components/stop_jobs_modal.vue
'
;
import
*
as
urlUtility
from
'
~/lib/utils/url_utility
'
;
import
mountComponent
from
'
../../../../../helpers/vue_mount_component_helper
'
;
describe
(
'
stop_jobs_modal.vue
'
,
()
=>
{
const
props
=
{
url
:
`
${
gl
.
TEST_HOST
}
/stop_jobs_modal.vue/stopAll`
,
};
let
vm
;
afterEach
(()
=>
{
vm
.
$destroy
();
});
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
stopJobsModal
);
vm
=
mountComponent
(
Component
,
props
);
});
describe
(
'
onSubmit
'
,
()
=>
{
it
(
'
stops jobs and redirects to overview page
'
,
(
done
)
=>
{
const
responseURL
=
`
${
gl
.
TEST_HOST
}
/stop_jobs_modal.vue/jobs`
;
const
redirectSpy
=
spyOn
(
urlUtility
,
'
redirectTo
'
);
spyOn
(
axios
,
'
post
'
).
and
.
callFake
((
url
)
=>
{
expect
(
url
).
toBe
(
props
.
url
);
return
Promise
.
resolve
({
request
:
{
responseURL
,
},
});
});
vm
.
onSubmit
()
.
then
(()
=>
{
expect
(
redirectSpy
).
toHaveBeenCalledWith
(
responseURL
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'
displays error if stopping jobs failed
'
,
(
done
)
=>
{
const
dummyError
=
new
Error
(
'
stopping jobs failed
'
);
const
redirectSpy
=
spyOn
(
urlUtility
,
'
redirectTo
'
);
spyOn
(
axios
,
'
post
'
).
and
.
callFake
((
url
)
=>
{
expect
(
url
).
toBe
(
props
.
url
);
return
Promise
.
reject
(
dummyError
);
});
vm
.
onSubmit
()
.
then
(
done
.
fail
)
.
catch
((
error
)
=>
{
expect
(
error
).
toBe
(
dummyError
);
expect
(
redirectSpy
).
not
.
toHaveBeenCalled
();
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
});
spec/requests/api/project_snippets_spec.rb
View file @
d1085ef8
require
'rails_helper'
describe
API
::
ProjectSnippets
do
l
et
(
:project
)
{
create
(
:project
,
:public
)
}
l
et
(
:user
)
{
create
(
:user
)
}
l
et
(
:admin
)
{
create
(
:admin
)
}
s
et
(
:project
)
{
create
(
:project
,
:public
)
}
s
et
(
:user
)
{
create
(
:user
)
}
s
et
(
:admin
)
{
create
(
:admin
)
}
describe
"GET /projects/:project_id/snippets/:id/user_agent_detail"
do
let
(
:snippet
)
{
create
(
:project_snippet
,
:public
,
project:
project
)
}
...
...
@@ -18,6 +18,13 @@ describe API::ProjectSnippets do
expect
(
json_response
[
'akismet_submitted'
]).
to
eq
(
user_agent_detail
.
submitted
)
end
it
'respects project scoping'
do
other_project
=
create
(
:project
)
get
api
(
"/projects/
#{
other_project
.
id
}
/snippets/
#{
snippet
.
id
}
/user_agent_detail"
,
admin
)
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
it
"returns unautorized for non-admin users"
do
get
api
(
"/projects/
#{
snippet
.
project
.
id
}
/snippets/
#{
snippet
.
id
}
/user_agent_detail"
,
user
)
...
...
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