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
63360ade
Commit
63360ade
authored
Mar 15, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `requirements: { id: %r{[^/]+} }` for all projects and groups namespaced API routes
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
c9abdadd
Changes
61
Hide whitespace changes
Inline
Side-by-side
Showing
61 changed files
with
91 additions
and
77 deletions
+91
-77
changelogs/unreleased/27988-fix-transient-failure-in-commits-api.yml
...unreleased/27988-fix-transient-failure-in-commits-api.yml
+5
-0
lib/api/access_requests.rb
lib/api/access_requests.rb
+1
-1
lib/api/award_emoji.rb
lib/api/award_emoji.rb
+4
-2
lib/api/boards.rb
lib/api/boards.rb
+1
-1
lib/api/branches.rb
lib/api/branches.rb
+1
-1
lib/api/commit_statuses.rb
lib/api/commit_statuses.rb
+4
-3
lib/api/commits.rb
lib/api/commits.rb
+1
-1
lib/api/deploy_keys.rb
lib/api/deploy_keys.rb
+1
-1
lib/api/deployments.rb
lib/api/deployments.rb
+1
-1
lib/api/environments.rb
lib/api/environments.rb
+1
-1
lib/api/files.rb
lib/api/files.rb
+1
-1
lib/api/groups.rb
lib/api/groups.rb
+2
-2
lib/api/issues.rb
lib/api/issues.rb
+2
-2
lib/api/jobs.rb
lib/api/jobs.rb
+1
-1
lib/api/labels.rb
lib/api/labels.rb
+1
-1
lib/api/members.rb
lib/api/members.rb
+1
-1
lib/api/merge_request_diffs.rb
lib/api/merge_request_diffs.rb
+4
-3
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+1
-1
lib/api/milestones.rb
lib/api/milestones.rb
+1
-1
lib/api/notes.rb
lib/api/notes.rb
+1
-1
lib/api/notification_settings.rb
lib/api/notification_settings.rb
+4
-5
lib/api/pipelines.rb
lib/api/pipelines.rb
+1
-1
lib/api/project_hooks.rb
lib/api/project_hooks.rb
+1
-1
lib/api/project_snippets.rb
lib/api/project_snippets.rb
+1
-1
lib/api/projects.rb
lib/api/projects.rb
+1
-1
lib/api/repositories.rb
lib/api/repositories.rb
+1
-1
lib/api/runners.rb
lib/api/runners.rb
+1
-1
lib/api/services.rb
lib/api/services.rb
+5
-2
lib/api/subscriptions.rb
lib/api/subscriptions.rb
+1
-1
lib/api/tags.rb
lib/api/tags.rb
+1
-1
lib/api/todos.rb
lib/api/todos.rb
+1
-1
lib/api/triggers.rb
lib/api/triggers.rb
+1
-1
lib/api/v3/award_emoji.rb
lib/api/v3/award_emoji.rb
+1
-1
lib/api/v3/boards.rb
lib/api/v3/boards.rb
+1
-1
lib/api/v3/branches.rb
lib/api/v3/branches.rb
+1
-1
lib/api/v3/commits.rb
lib/api/v3/commits.rb
+1
-1
lib/api/v3/deploy_keys.rb
lib/api/v3/deploy_keys.rb
+1
-1
lib/api/v3/deployments.rb
lib/api/v3/deployments.rb
+1
-1
lib/api/v3/environments.rb
lib/api/v3/environments.rb
+1
-1
lib/api/v3/files.rb
lib/api/v3/files.rb
+1
-1
lib/api/v3/groups.rb
lib/api/v3/groups.rb
+2
-2
lib/api/v3/issues.rb
lib/api/v3/issues.rb
+2
-2
lib/api/v3/labels.rb
lib/api/v3/labels.rb
+1
-1
lib/api/v3/members.rb
lib/api/v3/members.rb
+1
-1
lib/api/v3/merge_request_diffs.rb
lib/api/v3/merge_request_diffs.rb
+4
-3
lib/api/v3/merge_requests.rb
lib/api/v3/merge_requests.rb
+1
-1
lib/api/v3/milestones.rb
lib/api/v3/milestones.rb
+1
-1
lib/api/v3/notes.rb
lib/api/v3/notes.rb
+1
-1
lib/api/v3/pipelines.rb
lib/api/v3/pipelines.rb
+1
-1
lib/api/v3/project_hooks.rb
lib/api/v3/project_hooks.rb
+1
-1
lib/api/v3/project_snippets.rb
lib/api/v3/project_snippets.rb
+1
-1
lib/api/v3/projects.rb
lib/api/v3/projects.rb
+1
-1
lib/api/v3/repositories.rb
lib/api/v3/repositories.rb
+1
-1
lib/api/v3/runners.rb
lib/api/v3/runners.rb
+1
-1
lib/api/v3/services.rb
lib/api/v3/services.rb
+5
-2
lib/api/v3/subscriptions.rb
lib/api/v3/subscriptions.rb
+1
-1
lib/api/v3/tags.rb
lib/api/v3/tags.rb
+1
-1
lib/api/v3/triggers.rb
lib/api/v3/triggers.rb
+1
-1
lib/api/v3/variables.rb
lib/api/v3/variables.rb
+1
-1
lib/api/variables.rb
lib/api/variables.rb
+1
-1
spec/requests/api/commits_spec.rb
spec/requests/api/commits_spec.rb
+0
-1
No files found.
changelogs/unreleased/27988-fix-transient-failure-in-commits-api.yml
0 → 100644
View file @
63360ade
---
title
:
'
Add
`requirements:
{
id:
/.+/
}`
for
all
projects
and
groups
namespaced
API
routes'
merge_request
:
9944
author
:
lib/api/access_requests.rb
View file @
63360ade
...
@@ -10,7 +10,7 @@ module API
...
@@ -10,7 +10,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
"The
#{
source_type
}
ID"
requires
:id
,
type:
String
,
desc:
"The
#{
source_type
}
ID"
end
end
resource
source_type
.
pluralize
do
resource
source_type
.
pluralize
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
"Gets a list of access requests for a
#{
source_type
}
."
do
desc
"Gets a list of access requests for a
#{
source_type
}
."
do
detail
'This feature was introduced in GitLab 8.11.'
detail
'This feature was introduced in GitLab 8.11.'
success
Entities
::
AccessRequester
success
Entities
::
AccessRequester
...
...
lib/api/award_emoji.rb
View file @
63360ade
...
@@ -9,13 +9,15 @@ module API
...
@@ -9,13 +9,15 @@ module API
{
type:
'snippet'
,
find_by: :id
}
{
type:
'snippet'
,
find_by: :id
}
].
freeze
].
freeze
resource
:projects
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
AWARDABLES
.
each
do
|
awardable_params
|
AWARDABLES
.
each
do
|
awardable_params
|
awardable_string
=
awardable_params
[
:type
].
pluralize
awardable_string
=
awardable_params
[
:type
].
pluralize
awardable_id_string
=
"
#{
awardable_params
[
:type
]
}
_
#{
awardable_params
[
:find_by
]
}
"
awardable_id_string
=
"
#{
awardable_params
[
:type
]
}
_
#{
awardable_params
[
:find_by
]
}
"
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:"
#{
awardable_id_string
}
"
,
type:
Integer
,
desc:
"The ID of an Issue, Merge Request or Snippet"
requires
:"
#{
awardable_id_string
}
"
,
type:
Integer
,
desc:
"The ID of an Issue, Merge Request or Snippet"
end
end
...
...
lib/api/boards.rb
View file @
63360ade
...
@@ -7,7 +7,7 @@ module API
...
@@ -7,7 +7,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all project boards'
do
desc
'Get all project boards'
do
detail
'This feature was introduced in 8.13'
detail
'This feature was introduced in 8.13'
success
Entities
::
Board
success
Entities
::
Board
...
...
lib/api/branches.rb
View file @
63360ade
...
@@ -10,7 +10,7 @@ module API
...
@@ -10,7 +10,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository branches'
do
desc
'Get a project repository branches'
do
success
Entities
::
RepoBranch
success
Entities
::
RepoBranch
end
end
...
...
lib/api/commit_statuses.rb
View file @
63360ade
...
@@ -2,7 +2,10 @@ require 'mime/types'
...
@@ -2,7 +2,10 @@ require 'mime/types'
module
API
module
API
class
CommitStatuses
<
Grape
::
API
class
CommitStatuses
<
Grape
::
API
resource
:projects
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
include
PaginationParams
include
PaginationParams
before
{
authenticate!
}
before
{
authenticate!
}
...
@@ -11,7 +14,6 @@ module API
...
@@ -11,7 +14,6 @@ module API
success
Entities
::
CommitStatus
success
Entities
::
CommitStatus
end
end
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:sha
,
type:
String
,
desc:
'The commit hash'
requires
:sha
,
type:
String
,
desc:
'The commit hash'
optional
:ref
,
type:
String
,
desc:
'The ref'
optional
:ref
,
type:
String
,
desc:
'The ref'
optional
:stage
,
type:
String
,
desc:
'The stage'
optional
:stage
,
type:
String
,
desc:
'The stage'
...
@@ -37,7 +39,6 @@ module API
...
@@ -37,7 +39,6 @@ module API
success
Entities
::
CommitStatus
success
Entities
::
CommitStatus
end
end
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:sha
,
type:
String
,
desc:
'The commit hash'
requires
:sha
,
type:
String
,
desc:
'The commit hash'
requires
:state
,
type:
String
,
desc:
'The state of the status'
,
requires
:state
,
type:
String
,
desc:
'The state of the status'
,
values:
%w(pending running success failed canceled)
values:
%w(pending running success failed canceled)
...
...
lib/api/commits.rb
View file @
63360ade
...
@@ -10,7 +10,7 @@ module API
...
@@ -10,7 +10,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
,
requirements:
{
id:
/.+/
}
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository commits'
do
desc
'Get a project repository commits'
do
success
Entities
::
RepoCommit
success
Entities
::
RepoCommit
end
end
...
...
lib/api/deploy_keys.rb
View file @
63360ade
...
@@ -17,7 +17,7 @@ module API
...
@@ -17,7 +17,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of the project'
requires
:id
,
type:
String
,
desc:
'The ID of the project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
before
{
authorize_admin_project
}
before
{
authorize_admin_project
}
desc
"Get a specific project's deploy keys"
do
desc
"Get a specific project's deploy keys"
do
...
...
lib/api/deployments.rb
View file @
63360ade
...
@@ -8,7 +8,7 @@ module API
...
@@ -8,7 +8,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all deployments of the project'
do
desc
'Get all deployments of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
detail
'This feature was introduced in GitLab 8.11.'
success
Entities
::
Deployment
success
Entities
::
Deployment
...
...
lib/api/environments.rb
View file @
63360ade
...
@@ -9,7 +9,7 @@ module API
...
@@ -9,7 +9,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all environments of the project'
do
desc
'Get all environments of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
detail
'This feature was introduced in GitLab 8.11.'
success
Entities
::
Environment
success
Entities
::
Environment
...
...
lib/api/files.rb
View file @
63360ade
...
@@ -52,7 +52,7 @@ module API
...
@@ -52,7 +52,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get raw file contents from the repository'
desc
'Get raw file contents from the repository'
params
do
params
do
requires
:file_path
,
type:
String
,
desc:
'The url encoded path to the file. Ex. lib%2Fclass%2Erb'
requires
:file_path
,
type:
String
,
desc:
'The url encoded path to the file. Ex. lib%2Fclass%2Erb'
...
...
lib/api/groups.rb
View file @
63360ade
...
@@ -84,7 +84,7 @@ module API
...
@@ -84,7 +84,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
end
resource
:groups
do
resource
:groups
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Update a group. Available only for users who can administrate groups.'
do
desc
'Update a group. Available only for users who can administrate groups.'
do
success
Entities
::
Group
success
Entities
::
Group
end
end
...
@@ -154,7 +154,7 @@ module API
...
@@ -154,7 +154,7 @@ module API
params
do
params
do
requires
:project_id
,
type:
String
,
desc:
'The ID or path of the project'
requires
:project_id
,
type:
String
,
desc:
'The ID or path of the project'
end
end
post
":id/projects/:project_id"
do
post
":id/projects/:project_id"
,
requirements:
{
project_id:
/.+/
}
do
authenticated_as_admin!
authenticated_as_admin!
group
=
find_group!
(
params
[
:id
])
group
=
find_group!
(
params
[
:id
])
project
=
find_project!
(
params
[
:project_id
])
project
=
find_project!
(
params
[
:project_id
])
...
...
lib/api/issues.rb
View file @
63360ade
...
@@ -58,7 +58,7 @@ module API
...
@@ -58,7 +58,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
end
resource
:groups
do
resource
:groups
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a list of group issues'
do
desc
'Get a list of group issues'
do
success
Entities
::
IssueBasic
success
Entities
::
IssueBasic
end
end
...
@@ -79,7 +79,7 @@ module API
...
@@ -79,7 +79,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
include
TimeTrackingEndpoints
include
TimeTrackingEndpoints
desc
'Get a list of project issues'
do
desc
'Get a list of project issues'
do
...
...
lib/api/jobs.rb
View file @
63360ade
...
@@ -7,7 +7,7 @@ module API
...
@@ -7,7 +7,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
helpers
do
helpers
do
params
:optional_scope
do
params
:optional_scope
do
optional
:scope
,
types:
[
String
,
Array
[
String
]],
desc:
'The scope of builds to show'
,
optional
:scope
,
types:
[
String
,
Array
[
String
]],
desc:
'The scope of builds to show'
,
...
...
lib/api/labels.rb
View file @
63360ade
...
@@ -7,7 +7,7 @@ module API
...
@@ -7,7 +7,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all labels of the project'
do
desc
'Get all labels of the project'
do
success
Entities
::
Label
success
Entities
::
Label
end
end
...
...
lib/api/members.rb
View file @
63360ade
...
@@ -10,7 +10,7 @@ module API
...
@@ -10,7 +10,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
"The
#{
source_type
}
ID"
requires
:id
,
type:
String
,
desc:
"The
#{
source_type
}
ID"
end
end
resource
source_type
.
pluralize
do
resource
source_type
.
pluralize
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Gets a list of group or project members viewable by the authenticated user.'
do
desc
'Gets a list of group or project members viewable by the authenticated user.'
do
success
Entities
::
Member
success
Entities
::
Member
end
end
...
...
lib/api/merge_request_diffs.rb
View file @
63360ade
...
@@ -5,14 +5,16 @@ module API
...
@@ -5,14 +5,16 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
resource
:projects
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a list of merge request diff versions'
do
desc
'Get a list of merge request diff versions'
do
detail
'This feature was introduced in GitLab 8.12.'
detail
'This feature was introduced in GitLab 8.12.'
success
Entities
::
MergeRequestDiff
success
Entities
::
MergeRequestDiff
end
end
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:merge_request_iid
,
type:
Integer
,
desc:
'The IID of a merge request'
requires
:merge_request_iid
,
type:
Integer
,
desc:
'The IID of a merge request'
use
:pagination
use
:pagination
end
end
...
@@ -28,7 +30,6 @@ module API
...
@@ -28,7 +30,6 @@ module API
end
end
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:merge_request_iid
,
type:
Integer
,
desc:
'The IID of a merge request'
requires
:merge_request_iid
,
type:
Integer
,
desc:
'The IID of a merge request'
requires
:version_id
,
type:
Integer
,
desc:
'The ID of a merge request diff version'
requires
:version_id
,
type:
Integer
,
desc:
'The ID of a merge request diff version'
end
end
...
...
lib/api/merge_requests.rb
View file @
63360ade
...
@@ -7,7 +7,7 @@ module API
...
@@ -7,7 +7,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
include
TimeTrackingEndpoints
include
TimeTrackingEndpoints
helpers
do
helpers
do
...
...
lib/api/milestones.rb
View file @
63360ade
...
@@ -23,7 +23,7 @@ module API
...
@@ -23,7 +23,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a list of project milestones'
do
desc
'Get a list of project milestones'
do
success
Entities
::
Milestone
success
Entities
::
Milestone
end
end
...
...
lib/api/notes.rb
View file @
63360ade
...
@@ -9,7 +9,7 @@ module API
...
@@ -9,7 +9,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
NOTEABLE_TYPES
.
each
do
|
noteable_type
|
NOTEABLE_TYPES
.
each
do
|
noteable_type
|
noteables_str
=
noteable_type
.
to_s
.
underscore
.
pluralize
noteables_str
=
noteable_type
.
to_s
.
underscore
.
pluralize
...
...
lib/api/notification_settings.rb
View file @
63360ade
...
@@ -48,14 +48,14 @@ module API
...
@@ -48,14 +48,14 @@ module API
end
end
%w[group project]
.
each
do
|
source_type
|
%w[group project]
.
each
do
|
source_type
|
resource
source_type
.
pluralize
do
params
do
requires
:id
,
type:
String
,
desc:
"The
#{
source_type
}
ID"
end
resource
source_type
.
pluralize
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
"Get
#{
source_type
}
level notification level settings, defaults to Global"
do
desc
"Get
#{
source_type
}
level notification level settings, defaults to Global"
do
detail
'This feature was introduced in GitLab 8.12'
detail
'This feature was introduced in GitLab 8.12'
success
Entities
::
NotificationSetting
success
Entities
::
NotificationSetting
end
end
params
do
requires
:id
,
type:
String
,
desc:
'The group ID or project ID or project NAMESPACE/PROJECT_NAME'
end
get
":id/notification_settings"
do
get
":id/notification_settings"
do
source
=
find_source
(
source_type
,
params
[
:id
])
source
=
find_source
(
source_type
,
params
[
:id
])
...
@@ -69,7 +69,6 @@ module API
...
@@ -69,7 +69,6 @@ module API
success
Entities
::
NotificationSetting
success
Entities
::
NotificationSetting
end
end
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The group ID or project ID or project NAMESPACE/PROJECT_NAME'
optional
:level
,
type:
String
,
desc:
"The
#{
source_type
}
notification level"
optional
:level
,
type:
String
,
desc:
"The
#{
source_type
}
notification level"
NotificationSetting
::
EMAIL_EVENTS
.
each
do
|
event
|
NotificationSetting
::
EMAIL_EVENTS
.
each
do
|
event
|
optional
event
,
type:
Boolean
,
desc:
'Enable/disable this notification'
optional
event
,
type:
Boolean
,
desc:
'Enable/disable this notification'
...
...
lib/api/pipelines.rb
View file @
63360ade
...
@@ -7,7 +7,7 @@ module API
...
@@ -7,7 +7,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all Pipelines of the project'
do
desc
'Get all Pipelines of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
detail
'This feature was introduced in GitLab 8.11.'
success
Entities
::
PipelineBasic
success
Entities
::
PipelineBasic
...
...
lib/api/project_hooks.rb
View file @
63360ade
...
@@ -24,7 +24,7 @@ module API
...
@@ -24,7 +24,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get project hooks'
do
desc
'Get project hooks'
do
success
Entities
::
ProjectHook
success
Entities
::
ProjectHook
end
end
...
...
lib/api/project_snippets.rb
View file @
63360ade
...
@@ -7,7 +7,7 @@ module API
...
@@ -7,7 +7,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
helpers
do
helpers
do
def
handle_project_member_errors
(
errors
)
def
handle_project_member_errors
(
errors
)
if
errors
[
:project_access
].
any?
if
errors
[
:project_access
].
any?
...
...
lib/api/projects.rb
View file @
63360ade
...
@@ -142,7 +142,7 @@ module API
...
@@ -142,7 +142,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
,
requirements:
{
id:
/[^\/]+/
}
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a single project'
do
desc
'Get a single project'
do
success
Entities
::
ProjectWithAccess
success
Entities
::
ProjectWithAccess
end
end
...
...
lib/api/repositories.rb
View file @
63360ade
...
@@ -9,7 +9,7 @@ module API
...
@@ -9,7 +9,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
helpers
do
helpers
do
def
handle_project_member_errors
(
errors
)
def
handle_project_member_errors
(
errors
)
if
errors
[
:project_access
].
any?
if
errors
[
:project_access
].
any?
...
...
lib/api/runners.rb
View file @
63360ade
...
@@ -86,7 +86,7 @@ module API
...
@@ -86,7 +86,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
before
{
authorize_admin_project
}
before
{
authorize_admin_project
}
desc
'Get runners available for project'
do
desc
'Get runners available for project'
do
...
...
lib/api/services.rb
View file @
63360ade
...
@@ -604,7 +604,10 @@ module API
...
@@ -604,7 +604,10 @@ module API
]
]
}.
freeze
}.
freeze
resource
:projects
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
before
{
authenticate!
}
before
{
authenticate!
}
before
{
authorize_admin_project
}
before
{
authorize_admin_project
}
...
@@ -692,7 +695,7 @@ module API
...
@@ -692,7 +695,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
"Trigger a slash command for
#{
service_slug
}
"
do
desc
"Trigger a slash command for
#{
service_slug
}
"
do
detail
'Added in GitLab 8.13'
detail
'Added in GitLab 8.13'
end
end
...
...
lib/api/subscriptions.rb
View file @
63360ade
...
@@ -12,7 +12,7 @@ module API
...
@@ -12,7 +12,7 @@ module API
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:subscribable_id
,
type:
String
,
desc:
'The ID of a resource'
requires
:subscribable_id
,
type:
String
,
desc:
'The ID of a resource'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
subscribable_types
.
each
do
|
type
,
finder
|
subscribable_types
.
each
do
|
type
,
finder
|
type_singularized
=
type
.
singularize
type_singularized
=
type
.
singularize
entity_class
=
Entities
.
const_get
(
type_singularized
.
camelcase
)
entity_class
=
Entities
.
const_get
(
type_singularized
.
camelcase
)
...
...
lib/api/tags.rb
View file @
63360ade
...
@@ -7,7 +7,7 @@ module API
...
@@ -7,7 +7,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository tags'
do
desc
'Get a project repository tags'
do
success
Entities
::
RepoTag
success
Entities
::
RepoTag
end
end
...
...
lib/api/todos.rb
View file @
63360ade
...
@@ -12,7 +12,7 @@ module API
...
@@ -12,7 +12,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
ISSUABLE_TYPES
.
each
do
|
type
,
finder
|
ISSUABLE_TYPES
.
each
do
|
type
,
finder
|
type_id_str
=
"
#{
type
.
singularize
}
_iid"
.
to_sym
type_id_str
=
"
#{
type
.
singularize
}
_iid"
.
to_sym
...
...
lib/api/triggers.rb
View file @
63360ade
...
@@ -5,7 +5,7 @@ module API
...
@@ -5,7 +5,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Trigger a GitLab project pipeline'
do
desc
'Trigger a GitLab project pipeline'
do
success
Entities
::
Pipeline
success
Entities
::
Pipeline
end
end
...
...
lib/api/v3/award_emoji.rb
View file @
63360ade
...
@@ -6,7 +6,7 @@ module API
...
@@ -6,7 +6,7 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
AWARDABLES
=
%w[issue merge_request snippet]
.
freeze
AWARDABLES
=
%w[issue merge_request snippet]
.
freeze
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
AWARDABLES
.
each
do
|
awardable_type
|
AWARDABLES
.
each
do
|
awardable_type
|
awardable_string
=
awardable_type
.
pluralize
awardable_string
=
awardable_type
.
pluralize
awardable_id_string
=
"
#{
awardable_type
}
_id"
awardable_id_string
=
"
#{
awardable_type
}
_id"
...
...
lib/api/v3/boards.rb
View file @
63360ade
...
@@ -6,7 +6,7 @@ module API
...
@@ -6,7 +6,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all project boards'
do
desc
'Get all project boards'
do
detail
'This feature was introduced in 8.13'
detail
'This feature was introduced in 8.13'
success
::
API
::
Entities
::
Board
success
::
API
::
Entities
::
Board
...
...
lib/api/v3/branches.rb
View file @
63360ade
...
@@ -9,7 +9,7 @@ module API
...
@@ -9,7 +9,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository branches'
do
desc
'Get a project repository branches'
do
success
::
API
::
Entities
::
RepoBranch
success
::
API
::
Entities
::
RepoBranch
end
end
...
...
lib/api/v3/commits.rb
View file @
63360ade
...
@@ -11,7 +11,7 @@ module API
...
@@ -11,7 +11,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
,
requirements:
{
id:
/.+/
}
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository commits'
do
desc
'Get a project repository commits'
do
success
::
API
::
Entities
::
RepoCommit
success
::
API
::
Entities
::
RepoCommit
end
end
...
...
lib/api/v3/deploy_keys.rb
View file @
63360ade
...
@@ -13,7 +13,7 @@ module API
...
@@ -13,7 +13,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of the project'
requires
:id
,
type:
String
,
desc:
'The ID of the project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
before
{
authorize_admin_project
}
before
{
authorize_admin_project
}
%w(keys deploy_keys)
.
each
do
|
path
|
%w(keys deploy_keys)
.
each
do
|
path
|
...
...
lib/api/v3/deployments.rb
View file @
63360ade
...
@@ -9,7 +9,7 @@ module API
...
@@ -9,7 +9,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all deployments of the project'
do
desc
'Get all deployments of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
detail
'This feature was introduced in GitLab 8.11.'
success
::
API
::
V3
::
Deployments
success
::
API
::
V3
::
Deployments
...
...
lib/api/v3/environments.rb
View file @
63360ade
...
@@ -9,7 +9,7 @@ module API
...
@@ -9,7 +9,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all environments of the project'
do
desc
'Get all environments of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
detail
'This feature was introduced in GitLab 8.11.'
success
Entities
::
Environment
success
Entities
::
Environment
...
...
lib/api/v3/files.rb
View file @
63360ade
...
@@ -40,7 +40,7 @@ module API
...
@@ -40,7 +40,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a file from repository'
desc
'Get a file from repository'
params
do
params
do
requires
:file_path
,
type:
String
,
desc:
'The path to the file. Ex. lib/class.rb'
requires
:file_path
,
type:
String
,
desc:
'The path to the file. Ex. lib/class.rb'
...
...
lib/api/v3/groups.rb
View file @
63360ade
...
@@ -93,7 +93,7 @@ module API
...
@@ -93,7 +93,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
end
resource
:groups
do
resource
:groups
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Update a group. Available only for users who can administrate groups.'
do
desc
'Update a group. Available only for users who can administrate groups.'
do
success
Entities
::
Group
success
Entities
::
Group
end
end
...
@@ -163,7 +163,7 @@ module API
...
@@ -163,7 +163,7 @@ module API
params
do
params
do
requires
:project_id
,
type:
String
,
desc:
'The ID or path of the project'
requires
:project_id
,
type:
String
,
desc:
'The ID or path of the project'
end
end
post
":id/projects/:project_id"
do
post
":id/projects/:project_id"
,
requirements:
{
project_id:
/.+/
}
do
authenticated_as_admin!
authenticated_as_admin!
group
=
find_group!
(
params
[
:id
])
group
=
find_group!
(
params
[
:id
])
project
=
find_project!
(
params
[
:project_id
])
project
=
find_project!
(
params
[
:project_id
])
...
...
lib/api/v3/issues.rb
View file @
63360ade
...
@@ -68,7 +68,7 @@ module API
...
@@ -68,7 +68,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
end
resource
:groups
do
resource
:groups
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a list of group issues'
do
desc
'Get a list of group issues'
do
success
::
API
::
Entities
::
Issue
success
::
API
::
Entities
::
Issue
end
end
...
@@ -89,7 +89,7 @@ module API
...
@@ -89,7 +89,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
include
TimeTrackingEndpoints
include
TimeTrackingEndpoints
desc
'Get a list of project issues'
do
desc
'Get a list of project issues'
do
...
...
lib/api/v3/labels.rb
View file @
63360ade
...
@@ -6,7 +6,7 @@ module API
...
@@ -6,7 +6,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all labels of the project'
do
desc
'Get all labels of the project'
do
success
::
API
::
Entities
::
Label
success
::
API
::
Entities
::
Label
end
end
...
...
lib/api/v3/members.rb
View file @
63360ade
...
@@ -11,7 +11,7 @@ module API
...
@@ -11,7 +11,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
"The
#{
source_type
}
ID"
requires
:id
,
type:
String
,
desc:
"The
#{
source_type
}
ID"
end
end
resource
source_type
.
pluralize
do
resource
source_type
.
pluralize
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Gets a list of group or project members viewable by the authenticated user.'
do
desc
'Gets a list of group or project members viewable by the authenticated user.'
do
success
::
API
::
Entities
::
Member
success
::
API
::
Entities
::
Member
end
end
...
...
lib/api/v3/merge_request_diffs.rb
View file @
63360ade
...
@@ -4,14 +4,16 @@ module API
...
@@ -4,14 +4,16 @@ module API
class
MergeRequestDiffs
<
Grape
::
API
class
MergeRequestDiffs
<
Grape
::
API
before
{
authenticate!
}
before
{
authenticate!
}
resource
:projects
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a list of merge request diff versions'
do
desc
'Get a list of merge request diff versions'
do
detail
'This feature was introduced in GitLab 8.12.'
detail
'This feature was introduced in GitLab 8.12.'
success
::
API
::
Entities
::
MergeRequestDiff
success
::
API
::
Entities
::
MergeRequestDiff
end
end
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:merge_request_id
,
type:
Integer
,
desc:
'The ID of a merge request'
requires
:merge_request_id
,
type:
Integer
,
desc:
'The ID of a merge request'
end
end
...
@@ -27,7 +29,6 @@ module API
...
@@ -27,7 +29,6 @@ module API
end
end
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:merge_request_id
,
type:
Integer
,
desc:
'The ID of a merge request'
requires
:merge_request_id
,
type:
Integer
,
desc:
'The ID of a merge request'
requires
:version_id
,
type:
Integer
,
desc:
'The ID of a merge request diff version'
requires
:version_id
,
type:
Integer
,
desc:
'The ID of a merge request diff version'
end
end
...
...
lib/api/v3/merge_requests.rb
View file @
63360ade
...
@@ -10,7 +10,7 @@ module API
...
@@ -10,7 +10,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
include
TimeTrackingEndpoints
include
TimeTrackingEndpoints
helpers
do
helpers
do
...
...
lib/api/v3/milestones.rb
View file @
63360ade
...
@@ -18,7 +18,7 @@ module API
...
@@ -18,7 +18,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a list of project milestones'
do
desc
'Get a list of project milestones'
do
success
::
API
::
Entities
::
Milestone
success
::
API
::
Entities
::
Milestone
end
end
...
...
lib/api/v3/notes.rb
View file @
63360ade
...
@@ -10,7 +10,7 @@ module API
...
@@ -10,7 +10,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
NOTEABLE_TYPES
.
each
do
|
noteable_type
|
NOTEABLE_TYPES
.
each
do
|
noteable_type
|
noteables_str
=
noteable_type
.
to_s
.
underscore
.
pluralize
noteables_str
=
noteable_type
.
to_s
.
underscore
.
pluralize
...
...
lib/api/v3/pipelines.rb
View file @
63360ade
...
@@ -8,7 +8,7 @@ module API
...
@@ -8,7 +8,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all Pipelines of the project'
do
desc
'Get all Pipelines of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
detail
'This feature was introduced in GitLab 8.11.'
success
::
API
::
Entities
::
Pipeline
success
::
API
::
Entities
::
Pipeline
...
...
lib/api/v3/project_hooks.rb
View file @
63360ade
...
@@ -25,7 +25,7 @@ module API
...
@@ -25,7 +25,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get project hooks'
do
desc
'Get project hooks'
do
success
::
API
::
V3
::
Entities
::
ProjectHook
success
::
API
::
V3
::
Entities
::
ProjectHook
end
end
...
...
lib/api/v3/project_snippets.rb
View file @
63360ade
...
@@ -8,7 +8,7 @@ module API
...
@@ -8,7 +8,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
helpers
do
helpers
do
def
handle_project_member_errors
(
errors
)
def
handle_project_member_errors
(
errors
)
if
errors
[
:project_access
].
any?
if
errors
[
:project_access
].
any?
...
...
lib/api/v3/projects.rb
View file @
63360ade
...
@@ -234,7 +234,7 @@ module API
...
@@ -234,7 +234,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
,
requirements:
{
id:
/[^\/]+/
}
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a single project'
do
desc
'Get a single project'
do
success
::
API
::
V3
::
Entities
::
ProjectWithAccess
success
::
API
::
V3
::
Entities
::
ProjectWithAccess
end
end
...
...
lib/api/v3/repositories.rb
View file @
63360ade
...
@@ -8,7 +8,7 @@ module API
...
@@ -8,7 +8,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
helpers
do
helpers
do
def
handle_project_member_errors
(
errors
)
def
handle_project_member_errors
(
errors
)
if
errors
[
:project_access
].
any?
if
errors
[
:project_access
].
any?
...
...
lib/api/v3/runners.rb
View file @
63360ade
...
@@ -26,7 +26,7 @@ module API
...
@@ -26,7 +26,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
before
{
authorize_admin_project
}
before
{
authorize_admin_project
}
desc
"Disable project's runner"
do
desc
"Disable project's runner"
do
...
...
lib/api/v3/services.rb
View file @
63360ade
...
@@ -554,7 +554,10 @@ module API
...
@@ -554,7 +554,10 @@ module API
]
]
}.
freeze
}.
freeze
resource
:projects
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
before
{
authenticate!
}
before
{
authenticate!
}
before
{
authorize_admin_project
}
before
{
authorize_admin_project
}
...
@@ -609,7 +612,7 @@ module API
...
@@ -609,7 +612,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
"Trigger a slash command for
#{
service_slug
}
"
do
desc
"Trigger a slash command for
#{
service_slug
}
"
do
detail
'Added in GitLab 8.13'
detail
'Added in GitLab 8.13'
end
end
...
...
lib/api/v3/subscriptions.rb
View file @
63360ade
...
@@ -14,7 +14,7 @@ module API
...
@@ -14,7 +14,7 @@ module API
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:subscribable_id
,
type:
String
,
desc:
'The ID of a resource'
requires
:subscribable_id
,
type:
String
,
desc:
'The ID of a resource'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
subscribable_types
.
each
do
|
type
,
finder
|
subscribable_types
.
each
do
|
type
,
finder
|
type_singularized
=
type
.
singularize
type_singularized
=
type
.
singularize
entity_class
=
::
API
::
Entities
.
const_get
(
type_singularized
.
camelcase
)
entity_class
=
::
API
::
Entities
.
const_get
(
type_singularized
.
camelcase
)
...
...
lib/api/v3/tags.rb
View file @
63360ade
...
@@ -6,7 +6,7 @@ module API
...
@@ -6,7 +6,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository tags'
do
desc
'Get a project repository tags'
do
success
::
API
::
Entities
::
RepoTag
success
::
API
::
Entities
::
RepoTag
end
end
...
...
lib/api/v3/triggers.rb
View file @
63360ade
...
@@ -6,7 +6,7 @@ module API
...
@@ -6,7 +6,7 @@ module API
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Trigger a GitLab project build'
do
desc
'Trigger a GitLab project build'
do
success
::
API
::
V3
::
Entities
::
TriggerRequest
success
::
API
::
V3
::
Entities
::
TriggerRequest
end
end
...
...
lib/api/v3/variables.rb
View file @
63360ade
...
@@ -10,7 +10,7 @@ module API
...
@@ -10,7 +10,7 @@ module API
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Delete an existing variable from a project'
do
desc
'Delete an existing variable from a project'
do
success
::
API
::
Entities
::
Variable
success
::
API
::
Entities
::
Variable
end
end
...
...
lib/api/variables.rb
View file @
63360ade
...
@@ -9,7 +9,7 @@ module API
...
@@ -9,7 +9,7 @@ module API
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get project variables'
do
desc
'Get project variables'
do
success
Entities
::
Variable
success
Entities
::
Variable
end
end
...
...
spec/requests/api/commits_spec.rb
View file @
63360ade
...
@@ -238,7 +238,6 @@ describe API::Commits, api: true do
...
@@ -238,7 +238,6 @@ describe API::Commits, api: true do
end
end
context
'with project path containing a dot in URL'
do
context
'with project path containing a dot in URL'
do
let!
(
:user
)
{
create
(
:user
,
username:
'foo.bar'
)
}
let
(
:url
)
{
"/projects/
#{
CGI
.
escape
(
project
.
full_path
)
}
/repository/commits"
}
let
(
:url
)
{
"/projects/
#{
CGI
.
escape
(
project
.
full_path
)
}
/repository/commits"
}
it
'a new file in project repo'
do
it
'a new file in project repo'
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