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
c2eb23e1
Commit
c2eb23e1
authored
Dec 13, 2019
by
Tetiana Chupryna
Committed by
Bob Van Landuyt
Dec 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "API Dependency List - usage ping"
parent
1ec12b73
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
ee/lib/api/dependencies.rb
ee/lib/api/dependencies.rb
+2
-0
ee/spec/requests/api/dependencies_spec.rb
ee/spec/requests/api/dependencies_spec.rb
+4
-1
No files found.
ee/lib/api/dependencies.rb
View file @
c2eb23e1
...
@@ -35,6 +35,8 @@ module API
...
@@ -35,6 +35,8 @@ module API
get
':id/dependencies'
do
get
':id/dependencies'
do
authorize!
:read_dependencies
,
user_project
authorize!
:read_dependencies
,
user_project
track_event
(
'view_dependencies'
)
dependencies
=
dependencies_by
(
declared_params
.
merge
(
project:
user_project
))
dependencies
=
dependencies_by
(
declared_params
.
merge
(
project:
user_project
))
present
dependencies
,
with:
::
EE
::
API
::
Entities
::
Dependency
,
user:
current_user
,
project:
user_project
present
dependencies
,
with:
::
EE
::
API
::
Entities
::
Dependency
,
user:
current_user
,
project:
user_project
...
...
ee/spec/requests/api/dependencies_spec.rb
View file @
c2eb23e1
...
@@ -7,13 +7,16 @@ describe API::Dependencies do
...
@@ -7,13 +7,16 @@ describe API::Dependencies do
set
(
:user
)
{
create
(
:user
)
}
set
(
:user
)
{
create
(
:user
)
}
describe
"GET /projects/:id/dependencies"
do
describe
"GET /projects/:id/dependencies"
do
let
(
:request
)
{
get
api
(
"/projects/
#{
project
.
id
}
/dependencies"
,
user
),
params:
params
}
subject
(
:request
)
{
get
api
(
"/projects/
#{
project
.
id
}
/dependencies"
,
user
),
params:
params
}
let
(
:params
)
{
{}
}
let
(
:params
)
{
{}
}
before
do
before
do
stub_licensed_features
(
dependency_scanning:
true
,
security_dashboard:
true
)
stub_licensed_features
(
dependency_scanning:
true
,
security_dashboard:
true
)
end
end
it_behaves_like
'a gitlab tracking event'
,
described_class
.
name
,
'view_dependencies'
context
'with an authorized user with proper permissions'
do
context
'with an authorized user with proper permissions'
do
before
do
before
do
create
(
:ee_ci_pipeline
,
:with_dependency_list_report
,
project:
project
)
create
(
:ee_ci_pipeline
,
:with_dependency_list_report
,
project:
project
)
...
...
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