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
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
params
do
requires
:id
,
type:
String
,
desc:
"The
#{
source_type
}
ID"
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
detail
'This feature was introduced in GitLab 8.11.'
success
Entities
::
AccessRequester
...
...
lib/api/award_emoji.rb
View file @
63360ade
...
...
@@ -9,13 +9,15 @@ module API
{
type:
'snippet'
,
find_by: :id
}
].
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
|
awardable_string
=
awardable_params
[
:type
].
pluralize
awardable_id_string
=
"
#{
awardable_params
[
:type
]
}
_
#{
awardable_params
[
:find_by
]
}
"
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"
end
...
...
lib/api/boards.rb
View file @
63360ade
...
...
@@ -7,7 +7,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all project boards'
do
detail
'This feature was introduced in 8.13'
success
Entities
::
Board
...
...
lib/api/branches.rb
View file @
63360ade
...
...
@@ -10,7 +10,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository branches'
do
success
Entities
::
RepoBranch
end
...
...
lib/api/commit_statuses.rb
View file @
63360ade
...
...
@@ -2,7 +2,10 @@ require 'mime/types'
module
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
before
{
authenticate!
}
...
...
@@ -11,7 +14,6 @@ module API
success
Entities
::
CommitStatus
end
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:sha
,
type:
String
,
desc:
'The commit hash'
optional
:ref
,
type:
String
,
desc:
'The ref'
optional
:stage
,
type:
String
,
desc:
'The stage'
...
...
@@ -37,7 +39,6 @@ module API
success
Entities
::
CommitStatus
end
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:sha
,
type:
String
,
desc:
'The commit hash'
requires
:state
,
type:
String
,
desc:
'The state of the status'
,
values:
%w(pending running success failed canceled)
...
...
lib/api/commits.rb
View file @
63360ade
...
...
@@ -10,7 +10,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
{
id:
/.+/
}
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository commits'
do
success
Entities
::
RepoCommit
end
...
...
lib/api/deploy_keys.rb
View file @
63360ade
...
...
@@ -17,7 +17,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of the project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
before
{
authorize_admin_project
}
desc
"Get a specific project's deploy keys"
do
...
...
lib/api/deployments.rb
View file @
63360ade
...
...
@@ -8,7 +8,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all deployments of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
success
Entities
::
Deployment
...
...
lib/api/environments.rb
View file @
63360ade
...
...
@@ -9,7 +9,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all environments of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
success
Entities
::
Environment
...
...
lib/api/files.rb
View file @
63360ade
...
...
@@ -52,7 +52,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get raw file contents from the repository'
params
do
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
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
resource
:groups
do
resource
:groups
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Update a group. Available only for users who can administrate groups.'
do
success
Entities
::
Group
end
...
...
@@ -154,7 +154,7 @@ module API
params
do
requires
:project_id
,
type:
String
,
desc:
'The ID or path of the project'
end
post
":id/projects/:project_id"
do
post
":id/projects/:project_id"
,
requirements:
{
project_id:
/.+/
}
do
authenticated_as_admin!
group
=
find_group!
(
params
[
:id
])
project
=
find_project!
(
params
[
:project_id
])
...
...
lib/api/issues.rb
View file @
63360ade
...
...
@@ -58,7 +58,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
resource
:groups
do
resource
:groups
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a list of group issues'
do
success
Entities
::
IssueBasic
end
...
...
@@ -79,7 +79,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
include
TimeTrackingEndpoints
desc
'Get a list of project issues'
do
...
...
lib/api/jobs.rb
View file @
63360ade
...
...
@@ -7,7 +7,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
helpers
do
params
:optional_scope
do
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
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all labels of the project'
do
success
Entities
::
Label
end
...
...
lib/api/members.rb
View file @
63360ade
...
...
@@ -10,7 +10,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
"The
#{
source_type
}
ID"
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
success
Entities
::
Member
end
...
...
lib/api/merge_request_diffs.rb
View file @
63360ade
...
...
@@ -5,14 +5,16 @@ module API
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
detail
'This feature was introduced in GitLab 8.12.'
success
Entities
::
MergeRequestDiff
end
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'
use
:pagination
end
...
...
@@ -28,7 +30,6 @@ module API
end
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
:version_id
,
type:
Integer
,
desc:
'The ID of a merge request diff version'
end
...
...
lib/api/merge_requests.rb
View file @
63360ade
...
...
@@ -7,7 +7,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
include
TimeTrackingEndpoints
helpers
do
...
...
lib/api/milestones.rb
View file @
63360ade
...
...
@@ -23,7 +23,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a list of project milestones'
do
success
Entities
::
Milestone
end
...
...
lib/api/notes.rb
View file @
63360ade
...
...
@@ -9,7 +9,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
NOTEABLE_TYPES
.
each
do
|
noteable_type
|
noteables_str
=
noteable_type
.
to_s
.
underscore
.
pluralize
...
...
lib/api/notification_settings.rb
View file @
63360ade
...
...
@@ -48,14 +48,14 @@ module API
end
%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
detail
'This feature was introduced in GitLab 8.12'
success
Entities
::
NotificationSetting
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
source
=
find_source
(
source_type
,
params
[
:id
])
...
...
@@ -69,7 +69,6 @@ module API
success
Entities
::
NotificationSetting
end
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"
NotificationSetting
::
EMAIL_EVENTS
.
each
do
|
event
|
optional
event
,
type:
Boolean
,
desc:
'Enable/disable this notification'
...
...
lib/api/pipelines.rb
View file @
63360ade
...
...
@@ -7,7 +7,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all Pipelines of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
success
Entities
::
PipelineBasic
...
...
lib/api/project_hooks.rb
View file @
63360ade
...
...
@@ -24,7 +24,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get project hooks'
do
success
Entities
::
ProjectHook
end
...
...
lib/api/project_snippets.rb
View file @
63360ade
...
...
@@ -7,7 +7,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
helpers
do
def
handle_project_member_errors
(
errors
)
if
errors
[
:project_access
].
any?
...
...
lib/api/projects.rb
View file @
63360ade
...
...
@@ -142,7 +142,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
{
id:
/[^\/]+/
}
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a single project'
do
success
Entities
::
ProjectWithAccess
end
...
...
lib/api/repositories.rb
View file @
63360ade
...
...
@@ -9,7 +9,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
helpers
do
def
handle_project_member_errors
(
errors
)
if
errors
[
:project_access
].
any?
...
...
lib/api/runners.rb
View file @
63360ade
...
...
@@ -86,7 +86,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
before
{
authorize_admin_project
}
desc
'Get runners available for project'
do
...
...
lib/api/services.rb
View file @
63360ade
...
...
@@ -604,7 +604,10 @@ module API
]
}.
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
{
authorize_admin_project
}
...
...
@@ -692,7 +695,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
"Trigger a slash command for
#{
service_slug
}
"
do
detail
'Added in GitLab 8.13'
end
...
...
lib/api/subscriptions.rb
View file @
63360ade
...
...
@@ -12,7 +12,7 @@ module API
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:subscribable_id
,
type:
String
,
desc:
'The ID of a resource'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
subscribable_types
.
each
do
|
type
,
finder
|
type_singularized
=
type
.
singularize
entity_class
=
Entities
.
const_get
(
type_singularized
.
camelcase
)
...
...
lib/api/tags.rb
View file @
63360ade
...
...
@@ -7,7 +7,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository tags'
do
success
Entities
::
RepoTag
end
...
...
lib/api/todos.rb
View file @
63360ade
...
...
@@ -12,7 +12,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
ISSUABLE_TYPES
.
each
do
|
type
,
finder
|
type_id_str
=
"
#{
type
.
singularize
}
_iid"
.
to_sym
...
...
lib/api/triggers.rb
View file @
63360ade
...
...
@@ -5,7 +5,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Trigger a GitLab project pipeline'
do
success
Entities
::
Pipeline
end
...
...
lib/api/v3/award_emoji.rb
View file @
63360ade
...
...
@@ -6,7 +6,7 @@ module API
before
{
authenticate!
}
AWARDABLES
=
%w[issue merge_request snippet]
.
freeze
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
AWARDABLES
.
each
do
|
awardable_type
|
awardable_string
=
awardable_type
.
pluralize
awardable_id_string
=
"
#{
awardable_type
}
_id"
...
...
lib/api/v3/boards.rb
View file @
63360ade
...
...
@@ -6,7 +6,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all project boards'
do
detail
'This feature was introduced in 8.13'
success
::
API
::
Entities
::
Board
...
...
lib/api/v3/branches.rb
View file @
63360ade
...
...
@@ -9,7 +9,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository branches'
do
success
::
API
::
Entities
::
RepoBranch
end
...
...
lib/api/v3/commits.rb
View file @
63360ade
...
...
@@ -11,7 +11,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
{
id:
/.+/
}
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository commits'
do
success
::
API
::
Entities
::
RepoCommit
end
...
...
lib/api/v3/deploy_keys.rb
View file @
63360ade
...
...
@@ -13,7 +13,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of the project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
before
{
authorize_admin_project
}
%w(keys deploy_keys)
.
each
do
|
path
|
...
...
lib/api/v3/deployments.rb
View file @
63360ade
...
...
@@ -9,7 +9,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all deployments of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
success
::
API
::
V3
::
Deployments
...
...
lib/api/v3/environments.rb
View file @
63360ade
...
...
@@ -9,7 +9,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all environments of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
success
Entities
::
Environment
...
...
lib/api/v3/files.rb
View file @
63360ade
...
...
@@ -40,7 +40,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a file from repository'
params
do
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
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
resource
:groups
do
resource
:groups
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Update a group. Available only for users who can administrate groups.'
do
success
Entities
::
Group
end
...
...
@@ -163,7 +163,7 @@ module API
params
do
requires
:project_id
,
type:
String
,
desc:
'The ID or path of the project'
end
post
":id/projects/:project_id"
do
post
":id/projects/:project_id"
,
requirements:
{
project_id:
/.+/
}
do
authenticated_as_admin!
group
=
find_group!
(
params
[
:id
])
project
=
find_project!
(
params
[
:project_id
])
...
...
lib/api/v3/issues.rb
View file @
63360ade
...
...
@@ -68,7 +68,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
resource
:groups
do
resource
:groups
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a list of group issues'
do
success
::
API
::
Entities
::
Issue
end
...
...
@@ -89,7 +89,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
include
TimeTrackingEndpoints
desc
'Get a list of project issues'
do
...
...
lib/api/v3/labels.rb
View file @
63360ade
...
...
@@ -6,7 +6,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all labels of the project'
do
success
::
API
::
Entities
::
Label
end
...
...
lib/api/v3/members.rb
View file @
63360ade
...
...
@@ -11,7 +11,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
"The
#{
source_type
}
ID"
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
success
::
API
::
Entities
::
Member
end
...
...
lib/api/v3/merge_request_diffs.rb
View file @
63360ade
...
...
@@ -4,14 +4,16 @@ module API
class
MergeRequestDiffs
<
Grape
::
API
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
detail
'This feature was introduced in GitLab 8.12.'
success
::
API
::
Entities
::
MergeRequestDiff
end
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'
end
...
...
@@ -27,7 +29,6 @@ module API
end
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
:version_id
,
type:
Integer
,
desc:
'The ID of a merge request diff version'
end
...
...
lib/api/v3/merge_requests.rb
View file @
63360ade
...
...
@@ -10,7 +10,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
include
TimeTrackingEndpoints
helpers
do
...
...
lib/api/v3/milestones.rb
View file @
63360ade
...
...
@@ -18,7 +18,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a list of project milestones'
do
success
::
API
::
Entities
::
Milestone
end
...
...
lib/api/v3/notes.rb
View file @
63360ade
...
...
@@ -10,7 +10,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
NOTEABLE_TYPES
.
each
do
|
noteable_type
|
noteables_str
=
noteable_type
.
to_s
.
underscore
.
pluralize
...
...
lib/api/v3/pipelines.rb
View file @
63360ade
...
...
@@ -8,7 +8,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get all Pipelines of the project'
do
detail
'This feature was introduced in GitLab 8.11.'
success
::
API
::
Entities
::
Pipeline
...
...
lib/api/v3/project_hooks.rb
View file @
63360ade
...
...
@@ -25,7 +25,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get project hooks'
do
success
::
API
::
V3
::
Entities
::
ProjectHook
end
...
...
lib/api/v3/project_snippets.rb
View file @
63360ade
...
...
@@ -8,7 +8,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
helpers
do
def
handle_project_member_errors
(
errors
)
if
errors
[
:project_access
].
any?
...
...
lib/api/v3/projects.rb
View file @
63360ade
...
...
@@ -234,7 +234,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
{
id:
/[^\/]+/
}
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a single project'
do
success
::
API
::
V3
::
Entities
::
ProjectWithAccess
end
...
...
lib/api/v3/repositories.rb
View file @
63360ade
...
...
@@ -8,7 +8,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
helpers
do
def
handle_project_member_errors
(
errors
)
if
errors
[
:project_access
].
any?
...
...
lib/api/v3/runners.rb
View file @
63360ade
...
...
@@ -26,7 +26,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
before
{
authorize_admin_project
}
desc
"Disable project's runner"
do
...
...
lib/api/v3/services.rb
View file @
63360ade
...
...
@@ -554,7 +554,10 @@ module API
]
}.
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
{
authorize_admin_project
}
...
...
@@ -609,7 +612,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
"Trigger a slash command for
#{
service_slug
}
"
do
detail
'Added in GitLab 8.13'
end
...
...
lib/api/v3/subscriptions.rb
View file @
63360ade
...
...
@@ -14,7 +14,7 @@ module API
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:subscribable_id
,
type:
String
,
desc:
'The ID of a resource'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
subscribable_types
.
each
do
|
type
,
finder
|
type_singularized
=
type
.
singularize
entity_class
=
::
API
::
Entities
.
const_get
(
type_singularized
.
camelcase
)
...
...
lib/api/v3/tags.rb
View file @
63360ade
...
...
@@ -6,7 +6,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get a project repository tags'
do
success
::
API
::
Entities
::
RepoTag
end
...
...
lib/api/v3/triggers.rb
View file @
63360ade
...
...
@@ -6,7 +6,7 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Trigger a GitLab project build'
do
success
::
API
::
V3
::
Entities
::
TriggerRequest
end
...
...
lib/api/v3/variables.rb
View file @
63360ade
...
...
@@ -10,7 +10,7 @@ module API
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Delete an existing variable from a project'
do
success
::
API
::
Entities
::
Variable
end
...
...
lib/api/variables.rb
View file @
63360ade
...
...
@@ -9,7 +9,7 @@ module API
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
do
resource
:projects
,
requirements:
{
id:
%r{[^/]+}
}
do
desc
'Get project variables'
do
success
Entities
::
Variable
end
...
...
spec/requests/api/commits_spec.rb
View file @
63360ade
...
...
@@ -238,7 +238,6 @@ describe API::Commits, api: true do
end
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"
}
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