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
bfbb962b
Commit
bfbb962b
authored
Dec 08, 2021
by
Sincheol (David) Kim
Committed by
Bob Van Landuyt
Dec 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set 'Low' Custom Error Budget Thresholds - APIs
parent
78226340
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
19 deletions
+31
-19
lib/api/discussions.rb
lib/api/discussions.rb
+7
-0
lib/api/merge_request_diffs.rb
lib/api/merge_request_diffs.rb
+1
-1
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+13
-13
lib/api/notes.rb
lib/api/notes.rb
+5
-0
lib/api/resource_label_events.rb
lib/api/resource_label_events.rb
+1
-1
lib/api/resource_milestone_events.rb
lib/api/resource_milestone_events.rb
+1
-1
lib/api/resource_state_events.rb
lib/api/resource_state_events.rb
+1
-1
lib/api/suggestions.rb
lib/api/suggestions.rb
+2
-2
No files found.
lib/api/discussions.rb
View file @
bfbb962b
...
...
@@ -8,6 +8,13 @@ module API
before
{
authenticate!
}
urgency
:low
,
[
'/projects/:id/merge_requests/:noteable_id/discussions'
,
'/projects/:id/merge_requests/:noteable_id/discussions/:discussion_id'
,
'/projects/:id/merge_requests/:noteable_id/discussions/:discussion_id/notes'
,
'/projects/:id/merge_requests/:noteable_id/discussions/:discussion_id/notes/:note_id'
]
Helpers
::
DiscussionsHelpers
.
feature_category_per_noteable_type
.
each
do
|
noteable_type
,
feature_category
|
parent_type
=
noteable_type
.
parent_class
.
to_s
.
underscore
noteables_str
=
noteable_type
.
to_s
.
underscore
.
pluralize
...
...
lib/api/merge_request_diffs.rb
View file @
bfbb962b
...
...
@@ -38,7 +38,7 @@ module API
requires
:version_id
,
type:
Integer
,
desc:
'The ID of a merge request diff version'
end
get
":id/merge_requests/:merge_request_iid/versions/:version_id"
do
get
":id/merge_requests/:merge_request_iid/versions/:version_id"
,
urgency: :low
do
merge_request
=
find_merge_request_with_access
(
params
[
:merge_request_iid
])
present_cached
merge_request
.
merge_request_diffs
.
find
(
params
[
:version_id
]),
with:
Entities
::
MergeRequestDiffFull
,
cache_context:
nil
...
...
lib/api/merge_requests.rb
View file @
bfbb962b
...
...
@@ -134,7 +134,7 @@ module API
use
:merge_requests_params
use
:optional_scope_param
end
get
feature_category: :code_review
do
get
feature_category: :code_review
,
urgency: :low
do
authenticate!
unless
params
[
:scope
]
==
'all'
validate_anonymous_search_access!
if
params
[
:search
].
present?
merge_requests
=
find_merge_requests
...
...
@@ -155,7 +155,7 @@ module API
optional
:non_archived
,
type:
Boolean
,
desc:
'Return merge requests from non archived projects'
,
default:
true
end
get
":id/merge_requests"
,
feature_category: :code_review
do
get
":id/merge_requests"
,
feature_category: :code_review
,
urgency: :low
do
validate_anonymous_search_access!
if
declared_params
[
:search
].
present?
merge_requests
=
find_merge_requests
(
group_id:
user_group
.
id
,
include_subgroups:
true
)
...
...
@@ -195,7 +195,7 @@ module API
use
:merge_requests_params
optional
:iids
,
type:
Array
[
Integer
],
coerce_with:
::
API
::
Validations
::
Types
::
CommaSeparatedToIntegerArray
.
coerce
,
desc:
'The IID array of merge requests'
end
get
":id/merge_requests"
,
feature_category: :code_review
do
get
":id/merge_requests"
,
feature_category: :code_review
,
urgency: :low
do
authorize!
:read_merge_request
,
user_project
validate_anonymous_search_access!
if
declared_params
[
:search
].
present?
...
...
@@ -222,7 +222,7 @@ module API
desc:
'The target project of the merge request defaults to the :id of the project'
use
:optional_params
end
post
":id/merge_requests"
,
feature_category: :code_review
do
post
":id/merge_requests"
,
feature_category: :code_review
,
urgency: :low
do
Gitlab
::
QueryLimiting
.
disable!
(
'https://gitlab.com/gitlab-org/gitlab/-/issues/20770'
)
authorize!
:create_merge_request_from
,
user_project
...
...
@@ -244,7 +244,7 @@ module API
params
do
requires
:merge_request_iid
,
type:
Integer
,
desc:
'The IID of a merge request'
end
delete
":id/merge_requests/:merge_request_iid"
,
feature_category: :code_review
do
delete
":id/merge_requests/:merge_request_iid"
,
feature_category: :code_review
,
urgency: :low
do
merge_request
=
find_project_merge_request
(
params
[
:merge_request_iid
])
authorize!
(
:destroy_merge_request
,
merge_request
)
...
...
@@ -263,7 +263,7 @@ module API
desc
'Get a single merge request'
do
success
Entities
::
MergeRequest
end
get
':id/merge_requests/:merge_request_iid'
,
feature_category: :code_review
do
get
':id/merge_requests/:merge_request_iid'
,
feature_category: :code_review
,
urgency: :low
do
merge_request
=
find_merge_request_with_access
(
params
[
:merge_request_iid
])
present
merge_request
,
...
...
@@ -279,7 +279,7 @@ module API
desc
'Get the participants of a merge request'
do
success
Entities
::
UserBasic
end
get
':id/merge_requests/:merge_request_iid/participants'
,
feature_category: :code_review
do
get
':id/merge_requests/:merge_request_iid/participants'
,
feature_category: :code_review
,
urgency: :low
do
merge_request
=
find_merge_request_with_access
(
params
[
:merge_request_iid
])
participants
=
::
Kaminari
.
paginate_array
(
merge_request
.
participants
)
...
...
@@ -290,7 +290,7 @@ module API
desc
'Get the commits of a merge request'
do
success
Entities
::
Commit
end
get
':id/merge_requests/:merge_request_iid/commits'
,
feature_category: :code_review
do
get
':id/merge_requests/:merge_request_iid/commits'
,
feature_category: :code_review
,
urgency: :low
do
merge_request
=
find_merge_request_with_access
(
params
[
:merge_request_iid
])
commits
=
...
...
@@ -371,7 +371,7 @@ module API
desc
'Show the merge request changes'
do
success
Entities
::
MergeRequestChanges
end
get
':id/merge_requests/:merge_request_iid/changes'
,
feature_category: :code_review
do
get
':id/merge_requests/:merge_request_iid/changes'
,
feature_category: :code_review
,
urgency: :low
do
merge_request
=
find_merge_request_with_access
(
params
[
:merge_request_iid
])
present
merge_request
,
...
...
@@ -422,7 +422,7 @@ module API
use
:optional_params
at_least_one_of
(
*::
API
::
MergeRequests
.
update_params_at_least_one_of
)
end
put
':id/merge_requests/:merge_request_iid'
,
feature_category: :code_review
do
put
':id/merge_requests/:merge_request_iid'
,
feature_category: :code_review
,
urgency: :low
do
Gitlab
::
QueryLimiting
.
disable!
(
'https://gitlab.com/gitlab-org/gitlab/-/issues/20772'
)
merge_request
=
find_merge_request_with_access
(
params
.
delete
(
:merge_request_iid
),
:update_merge_request
)
...
...
@@ -454,7 +454,7 @@ module API
optional
:sha
,
type:
String
,
desc:
'When present, must have the HEAD SHA of the source branch'
optional
:squash
,
type:
Grape
::
API
::
Boolean
,
desc:
'When true, the commits will be squashed into a single commit on merge'
end
put
':id/merge_requests/:merge_request_iid/merge'
,
feature_category: :code_review
do
put
':id/merge_requests/:merge_request_iid/merge'
,
feature_category: :code_review
,
urgency: :low
do
Gitlab
::
QueryLimiting
.
disable!
(
'https://gitlab.com/gitlab-org/gitlab/-/issues/4796'
)
merge_request
=
find_project_merge_request
(
params
[
:merge_request_iid
])
...
...
@@ -524,7 +524,7 @@ module API
params
do
optional
:skip_ci
,
type:
Boolean
,
desc:
'Do not create CI pipeline'
end
put
':id/merge_requests/:merge_request_iid/rebase'
,
feature_category: :code_review
do
put
':id/merge_requests/:merge_request_iid/rebase'
,
feature_category: :code_review
,
urgency: :low
do
merge_request
=
find_project_merge_request
(
params
[
:merge_request_iid
])
authorize_push_to_merge_request!
(
merge_request
)
...
...
@@ -543,7 +543,7 @@ module API
params
do
use
:pagination
end
get
':id/merge_requests/:merge_request_iid/closes_issues'
,
feature_category: :code_review
do
get
':id/merge_requests/:merge_request_iid/closes_issues'
,
feature_category: :code_review
,
urgency: :low
do
merge_request
=
find_merge_request_with_access
(
params
[
:merge_request_iid
])
issues
=
::
Kaminari
.
paginate_array
(
merge_request
.
visible_closing_issues_for
(
current_user
))
issues
=
paginate
(
issues
)
...
...
lib/api/notes.rb
View file @
bfbb962b
...
...
@@ -7,6 +7,11 @@ module API
before
{
authenticate!
}
urgency
:low
,
[
'/projects/:id/merge_requests/:noteable_id/notes'
,
'/projects/:id/merge_requests/:noteable_id/notes/:note_id'
]
Helpers
::
NotesHelpers
.
feature_category_per_noteable_type
.
each
do
|
noteable_type
,
feature_category
|
parent_type
=
noteable_type
.
parent_class
.
to_s
.
underscore
noteables_str
=
noteable_type
.
to_s
.
underscore
.
pluralize
...
...
lib/api/resource_label_events.rb
View file @
bfbb962b
...
...
@@ -24,7 +24,7 @@ module API
use
:pagination
end
get
":id/
#{
eventables_str
}
/:eventable_id/resource_label_events"
,
feature_category:
feature_category
do
get
":id/
#{
eventables_str
}
/:eventable_id/resource_label_events"
,
feature_category:
feature_category
,
urgency: :low
do
eventable
=
find_noteable
(
eventable_type
,
params
[
:eventable_id
])
events
=
eventable
.
resource_label_events
.
inc_relations
...
...
lib/api/resource_milestone_events.rb
View file @
bfbb962b
...
...
@@ -26,7 +26,7 @@ module API
use
:pagination
end
get
":id/
#{
eventables_str
}
/:eventable_id/resource_milestone_events"
,
feature_category:
feature_category
do
get
":id/
#{
eventables_str
}
/:eventable_id/resource_milestone_events"
,
feature_category:
feature_category
,
urgency: :low
do
eventable
=
find_noteable
(
eventable_type
,
params
[
:eventable_id
])
events
=
ResourceMilestoneEventFinder
.
new
(
current_user
,
eventable
).
execute
...
...
lib/api/resource_state_events.rb
View file @
bfbb962b
...
...
@@ -25,7 +25,7 @@ module API
use
:pagination
end
get
":id/
#{
eventable_name
.
pluralize
}
/:eventable_iid/resource_state_events"
,
feature_category:
feature_category
do
get
":id/
#{
eventable_name
.
pluralize
}
/:eventable_iid/resource_state_events"
,
feature_category:
feature_category
,
urgency: :low
do
eventable
=
find_noteable
(
eventable_class
,
params
[
:eventable_iid
])
events
=
ResourceStateEventFinder
.
new
(
current_user
,
eventable
).
execute
...
...
lib/api/suggestions.rb
View file @
bfbb962b
...
...
@@ -14,7 +14,7 @@ module API
requires
:id
,
type:
String
,
desc:
'The suggestion ID'
optional
:commit_message
,
type:
String
,
desc:
"A custom commit message to use instead of the default generated message or the project's default message"
end
put
':id/apply'
do
put
':id/apply'
,
urgency: :low
do
suggestion
=
Suggestion
.
find_by_id
(
params
[
:id
])
if
suggestion
...
...
@@ -31,7 +31,7 @@ module API
requires
:ids
,
type:
Array
[
Integer
],
coerce_with:
::
API
::
Validations
::
Types
::
CommaSeparatedToIntegerArray
.
coerce
,
desc:
"An array of suggestion ID's"
optional
:commit_message
,
type:
String
,
desc:
"A custom commit message to use instead of the default generated message or the project's default message"
end
put
'batch_apply'
do
put
'batch_apply'
,
urgency: :low
do
ids
=
params
[
:ids
]
suggestions
=
Suggestion
.
id_in
(
ids
)
...
...
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