Skip to content
Snippets Groups Projects
Commit fb73ca33 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent b6b8f7dc
No related branches found
No related tags found
No related merge requests found
Showing
with 343 additions and 83 deletions
Please view this file on the master branch, on stable branches it's out of date.
 
## 12.6.1
- No changes.
## 12.6.0
 
### Fixed (32 changes, 5 of them are from the community)
Loading
Loading
Loading
Loading
@@ -4,7 +4,15 @@ entry.
 
## 12.6.1
 
- No changes.
### Fixed (2 changes)
- Handle forbidden error when checking for knative. !22170
- Fix stack trace highlight for PHP. !22258
### Performance (1 change)
- Eliminate N+1 queries in PipelinesController#index. !22189
 
## 12.6.0
 
Loading
Loading
Loading
Loading
@@ -3,6 +3,7 @@
class Projects::GitHttpClientController < Projects::ApplicationController
include ActionController::HttpAuthentication::Basic
include KerberosSpnegoHelper
include Gitlab::Utils::StrongMemoize
 
attr_reader :authentication_result, :redirected_path
 
Loading
Loading
@@ -47,7 +48,7 @@ class Projects::GitHttpClientController < Projects::ApplicationController
send_final_spnego_response
return # Allow access
end
elsif project && download_request? && http_allowed? && Guest.can?(:download_code, project)
elsif http_download_allowed?
 
@authentication_result = Gitlab::Auth::Result.new(nil, project, :none, [:download_code])
 
Loading
Loading
@@ -89,11 +90,9 @@ class Projects::GitHttpClientController < Projects::ApplicationController
end
 
def repository
repo_type.repository_for(project)
end
def wiki?
repo_type.wiki?
strong_memoize(:repository) do
repo_type.repository_for(project)
end
end
 
def repo_type
Loading
Loading
@@ -113,8 +112,10 @@ class Projects::GitHttpClientController < Projects::ApplicationController
authentication_result.ci?(project)
end
 
def http_allowed?
Gitlab::ProtocolAccess.allowed?('http')
def http_download_allowed?
Gitlab::ProtocolAccess.allowed?('http') &&
download_request? &&
project && Guest.can?(:download_code, project)
end
end
 
Loading
Loading
Loading
Loading
@@ -75,17 +75,19 @@ class Projects::GitHttpController < Projects::GitHttpClientController
end
 
def enqueue_fetch_statistics_update
return if wiki?
return unless project.daily_statistics_enabled?
return if repo_type.wiki?
return unless project&.daily_statistics_enabled?
 
ProjectDailyStatisticsWorker.perform_async(project.id)
end
 
def access
@access ||= access_klass.new(access_actor, project,
'http', authentication_abilities: authentication_abilities,
namespace_path: params[:namespace_id], project_path: project_path,
redirected_path: redirected_path, auth_result_type: auth_result_type)
@access ||= access_klass.new(access_actor, project, 'http',
authentication_abilities: authentication_abilities,
namespace_path: params[:namespace_id],
project_path: project_path,
redirected_path: redirected_path,
auth_result_type: auth_result_type)
end
 
def access_actor
Loading
Loading
Loading
Loading
@@ -95,7 +95,7 @@ class Repository
def path_to_repo
@path_to_repo ||=
begin
storage = Gitlab.config.repositories.storages[@project.repository_storage]
storage = Gitlab.config.repositories.storages[project.repository_storage]
 
File.expand_path(
File.join(storage.legacy_disk_path, disk_path + '.git')
Loading
Loading
@@ -128,7 +128,7 @@ class Repository
commits = Gitlab::Git::Commit.batch_by_oid(raw_repository, oids)
 
if commits.present?
Commit.decorate(commits, @project)
Commit.decorate(commits, project)
else
[]
end
Loading
Loading
@@ -159,14 +159,14 @@ class Repository
}
 
commits = Gitlab::Git::Commit.where(options)
commits = Commit.decorate(commits, @project) if commits.present?
commits = Commit.decorate(commits, project) if commits.present?
 
CommitCollection.new(project, commits, ref)
end
 
def commits_between(from, to)
commits = Gitlab::Git::Commit.between(raw_repository, from, to)
commits = Commit.decorate(commits, @project) if commits.present?
commits = Commit.decorate(commits, project) if commits.present?
commits
end
 
Loading
Loading
@@ -695,13 +695,13 @@ class Repository
commits = raw_repository.list_last_commits_for_tree(sha, path, offset: offset, limit: limit)
 
commits.each do |path, commit|
commits[path] = ::Commit.new(commit, @project)
commits[path] = ::Commit.new(commit, project)
end
end
 
def last_commit_for_path(sha, path)
commit = raw_repository.last_commit_for_path(sha, path)
::Commit.new(commit, @project) if commit
::Commit.new(commit, project) if commit
end
 
def last_commit_id_for_path(sha, path)
Loading
Loading
@@ -1136,7 +1136,7 @@ class Repository
Gitlab::Git::Commit.find(raw_repository, oid_or_ref)
end
 
::Commit.new(commit, @project) if commit
::Commit.new(commit, project) if commit
end
 
def cache
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ module MergeRequests
end
 
def execute(changes)
return [] unless project.printing_merge_request_link_enabled
return [] unless project&.printing_merge_request_link_enabled
 
branches = get_branches(changes)
merge_requests_map = opened_merge_requests_from_source_branches(branches)
Loading
Loading
---
title: Fix stack trace highlight for PHP
merge_request: 22258
author:
type: fixed
---
title: Expose full reference path for issuables in API
merge_request: 20354
author:
type: changed
---
title: Handle forbidden error when checking for knative
merge_request: 22170
author:
type: fixed
---
title: Eliminate N+1 queries in PipelinesController#index
merge_request: 22189
author:
type: performance
Loading
Loading
@@ -29,6 +29,14 @@ are paginated.
 
Read more on [pagination](README.md#pagination).
 
CAUTION: **Deprecation**
> `reference` attribute in response is deprecated in favour of `references`.
> Introduced [GitLab 12.6](https://gitlab.com/gitlab-org/gitlab/merge_requests/20354)
NOTE: **Note**
> `references.relative` is relative to the group that the epic is being requested. When epic is fetched from its origin group
> `relative` format would be the same as `short` format and when requested cross groups it is expected to be the same as `full` format.
## List epics for a group
 
Gets all epics of the requested group and its subgroups.
Loading
Loading
@@ -73,6 +81,51 @@ Example response:
"state": "opened",
"web_url": "http://localhost:3001/groups/test/-/epics/4",
"reference": "&4",
"references": {
"short": "&4",
"relative": "&4",
"full": "test&4"
},
"author": {
"id": 10,
"name": "Lu Mayer",
"username": "kam",
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/018729e129a6f31c80a6327a30196823?s=80&d=identicon",
"web_url": "http://localhost:3001/kam"
},
"start_date": null,
"start_date_is_fixed": false,
"start_date_fixed": null,
"start_date_from_milestones": null, //deprecated in favor of start_date_from_inherited_source
"start_date_from_inherited_source": null,
"end_date": "2018-07-31", //deprecated in favor of due_date
"due_date": "2018-07-31",
"due_date_is_fixed": false,
"due_date_fixed": null,
"due_date_from_milestones": "2018-07-31", //deprecated in favor of start_date_from_inherited_source
"due_date_from_inherited_source": "2018-07-31",
"created_at": "2018-07-17T13:36:22.770Z",
"updated_at": "2018-07-18T12:22:05.239Z",
"closed_at": "2018-08-18T12:22:05.239Z",
"labels": [],
"upvotes": 4,
"downvotes": 0
},
{
"id": 50,
"iid": 35,
"group_id": 17,
"title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.",
"description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.",
"state": "opened",
"web_url": "http://localhost:3001/groups/test/sample/-/epics/4",
"reference": "&4",
"references": {
"short": "&4",
"relative": "sample&4",
"full": "test/sample&4"
},
"author": {
"id": 10,
"name": "Lu Mayer",
Loading
Loading
@@ -131,6 +184,11 @@ Example response:
"state": "opened",
"web_url": "http://localhost:3001/groups/test/-/epics/5",
"reference": "&5",
"references": {
"short": "&5",
"relative": "&5",
"full": "test&5"
},
"author":{
"id": 7,
"name": "Pamella Huel",
Loading
Loading
@@ -199,8 +257,13 @@ Example response:
"title": "Epic",
"description": "Epic description",
"state": "opened",
"web_url": "http://localhost:3001/groups/test/-/epics/5",
"web_url": "http://localhost:3001/groups/test/-/epics/6",
"reference": "&6",
"references": {
"short": "&6",
"relative": "&6",
"full": "test&6"
},
"author": {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
Loading
Loading
@@ -269,8 +332,13 @@ Example response:
"title": "New Title",
"description": "Epic description",
"state": "opened",
"web_url": "http://localhost:3001/groups/test/-/epics/5",
"web_url": "http://localhost:3001/groups/test/-/epics/6",
"reference": "&6",
"references": {
"short": "&6",
"relative": "&6",
"full": "test&6"
},
"author": {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
Loading
Loading
@@ -372,6 +440,13 @@ Example response:
"avatar_url": "http://www.gravatar.com/avatar/a2f5c6fcef64c9c69cb8779cb292be1b?s=80&d=identicon",
"web_url": "http://localhost:3001/arnita"
},
"web_url": "http://localhost:3001/groups/test/-/epics/5",
"reference": "&5",
"references": {
"short": "&5",
"relative": "&5",
"full": "test&5"
},
"start_date": null,
"end_date": null,
"created_at": "2018-01-21T06:21:13.165Z",
Loading
Loading
Loading
Loading
@@ -12,6 +12,14 @@ are paginated.
 
Read more on [pagination](README.md#pagination).
 
CAUTION: **Deprecation**
> `reference` attribute in response is deprecated in favour of `references`.
> Introduced [GitLab 12.6](https://gitlab.com/gitlab-org/gitlab/merge_requests/20354)
NOTE: **Note**
> `references.relative` is relative to the group / project that the issue is being requested. When issue is fetched from its project
> `relative` format would be the same as `short` format and when requested across groups / projects it is expected to be the same as `full` format.
## List issues
 
Get all issues the authenticated user has access to. By default it
Loading
Loading
@@ -121,7 +129,12 @@ Example response:
"merge_requests_count": 0,
"user_notes_count": 1,
"due_date": "2016-07-22",
"web_url": "http://example.com/example/example/issues/6",
"web_url": "http://example.com/my-group/my-project/issues/6",
"references": {
"short": "#6",
"relative": "my-group/my-project#6",
"full": "my-group/my-project#6"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -270,7 +283,12 @@ Example response:
"closed_by" : null,
"user_notes_count": 1,
"due_date": null,
"web_url": "http://example.com/example/example/issues/1",
"web_url": "http://example.com/my-group/my-project/issues/1",
"references": {
"short": "#1",
"relative": "my-project#1",
"full": "my-group/my-project#1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -426,7 +444,12 @@ Example response:
},
"user_notes_count": 1,
"due_date": "2016-07-22",
"web_url": "http://example.com/example/example/issues/1",
"web_url": "http://example.com/my-group/my-project/issues/1",
"references": {
"short": "#1",
"relative": "#1",
"full": "my-group/my-project#1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -543,7 +566,12 @@ Example response:
"subscribed": false,
"user_notes_count": 1,
"due_date": null,
"web_url": "http://example.com/example/example/issues/1",
"web_url": "http://example.com/my-group/my-project/issues/1",
"references": {
"short": "#1",
"relative": "#1",
"full": "my-group/my-project#1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -668,7 +696,12 @@ Example response:
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
"web_url": "http://example.com/my-group/my-project/issues/14",
"references": {
"short": "#14",
"relative": "#14",
"full": "my-group/my-project#14"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -778,7 +811,12 @@ Example response:
"subscribed" : true,
"user_notes_count": 0,
"due_date": "2016-07-22",
"web_url": "http://example.com/example/example/issues/15",
"web_url": "http://example.com/my-group/my-project/issues/15",
"references": {
"short": "#15",
"relative": "#15",
"full": "my-group/my-project#15"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -900,7 +938,12 @@ Example response:
"web_url": "https://gitlab.example.com/solon.cremin"
},
"due_date": null,
"web_url": "http://example.com/example/example/issues/11",
"web_url": "http://example.com/my-group/my-project/issues/11",
"references": {
"short": "#11",
"relative": "#11",
"full": "my-group/my-project#11"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -1001,7 +1044,12 @@ Example response:
"web_url": "https://gitlab.example.com/solon.cremin"
},
"due_date": null,
"web_url": "http://example.com/example/example/issues/11",
"web_url": "http://example.com/my-group/my-project/issues/11",
"references": {
"short": "#11",
"relative": "#11",
"full": "my-group/my-project#11"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -1095,7 +1143,12 @@ Example response:
},
"subscribed": false,
"due_date": null,
"web_url": "http://example.com/example/example/issues/12",
"web_url": "http://example.com/my-group/my-project/issues/12",
"references": {
"short": "#12",
"relative": "#12",
"full": "my-group/my-project#12"
},
"confidential": false,
"discussion_locked": false,
"task_completion_status":{
Loading
Loading
@@ -1197,7 +1250,12 @@ Example response:
"downvotes": 0,
"merge_requests_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/110",
"web_url": "http://example.com/my-group/my-project/issues/10",
"references": {
"short": "#10",
"relative": "#10",
"full": "my-group/my-project#10"
},
"confidential": false,
"discussion_locked": false,
"task_completion_status":{
Loading
Loading
@@ -1436,6 +1494,11 @@ Example response:
"force_remove_source_branch": false,
"reference": "!11",
"web_url": "https://gitlab.example.com/twitter/flight/merge_requests/4",
"references": {
"short": "!4",
"relative": "!4",
"full": "twitter/flight!4"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -1566,6 +1629,12 @@ Example response:
"should_remove_source_branch": null,
"force_remove_source_branch": false,
"web_url": "https://gitlab.example.com/gitlab-org/gitlab-test/merge_requests/6432",
"reference": "!6432",
"references": {
"short": "!6432",
"relative": "!6432",
"full": "gitlab-org/gitlab-test!6432"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
Loading
Loading
@@ -2,6 +2,14 @@
 
Every API call to merge requests must be authenticated.
 
CAUTION: **Deprecation**
> `reference` attribute in response is deprecated in favour of `references`.
> Introduced [GitLab 12.6](https://gitlab.com/gitlab-org/gitlab/merge_requests/20354)
NOTE: **Note**
> `references.relative` is relative to the group / project that the merge request is being requested. When merge request is fetched from its project
> `relative` format would be the same as `short` format and when requested across groups / projects it is expected to be the same as `full` format.
## List merge requests
 
> [Introduced][ce-13060] in GitLab 9.5.
Loading
Loading
@@ -134,6 +142,11 @@ Parameters:
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "my-group/my-project!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -296,6 +309,11 @@ Parameters:
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -448,6 +466,11 @@ Parameters:
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "my-project!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -574,6 +597,11 @@ Parameters:
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -779,7 +807,12 @@ Parameters:
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"squash": false,
"web_url": "http://example.com/example/example/merge_requests/1",
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"discussion_locked": false,
"time_stats": {
"time_estimate": 0,
Loading
Loading
@@ -989,6 +1022,11 @@ order for it to take effect:
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -1143,6 +1181,11 @@ Must include at least one non-required attribute from above.
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -1313,6 +1356,11 @@ Parameters:
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -1486,6 +1534,11 @@ Parameters:
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -1772,6 +1825,11 @@ Example response:
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -1918,6 +1976,11 @@ Example response:
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"web_url": "http://gitlab.example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
Loading
Loading
@@ -2078,7 +2141,12 @@ Example response:
"should_remove_source_branch": true,
"force_remove_source_branch": false,
"squash": false,
"web_url": "http://example.com/example/example/merge_requests/1"
"web_url": "http://example.com/my-group/my-project/merge_requests/1",
"references": {
"short": "!1",
"relative": "!1",
"full": "my-group/my-project!1"
},
},
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-ci/merge_requests/7",
"body": "Et voluptas laudantium minus nihil recusandae ut accusamus earum aut non.",
Loading
Loading
Loading
Loading
@@ -569,6 +569,20 @@ module API
end
end
 
class IssuableReferences < Grape::Entity
expose :short do |issuable|
issuable.to_reference
end
expose :relative do |issuable, options|
issuable.to_reference(options[:group] || options[:project])
end
expose :full do |issuable|
issuable.to_reference(full: true)
end
end
class Diff < Grape::Entity
expose :old_path, :new_path, :a_mode, :b_mode
expose :new_file?, as: :new_file
Loading
Loading
@@ -676,6 +690,10 @@ module API
end
end
 
expose :references, with: IssuableReferences do |issue|
issue
end
# Calculating the value of subscribed field triggers Markdown
# processing. We can't do that for multiple issues / merge
# requests in a single API request.
Loading
Loading
@@ -787,10 +805,16 @@ module API
# Deprecated
expose :allow_collaboration, as: :allow_maintainer_to_push, if: -> (merge_request, _) { merge_request.for_fork? }
 
# reference is deprecated in favour of references
# Introduced [Gitlab 12.6](https://gitlab.com/gitlab-org/gitlab/merge_requests/20354)
expose :reference do |merge_request, options|
merge_request.to_reference(options[:project])
end
 
expose :references, with: IssuableReferences do |merge_request|
merge_request
end
expose :web_url do |merge_request|
Gitlab::UrlBuilder.build(merge_request)
end
Loading
Loading
Loading
Loading
@@ -120,21 +120,13 @@ module API
end
 
def gl_project_path
if wiki?
project.wiki.full_path
else
project.full_path
end
repository.full_path
end
 
# Return the repository depending on whether we want the wiki or the
# regular repository
def repository
if repo_type.wiki?
project.wiki.repository
else
project.repository
end
@repository ||= repo_type.repository_for(project)
end
 
# Return the Gitaly Address if it is enabled
Loading
Loading
Loading
Loading
@@ -224,9 +224,9 @@ module API
 
response.add_merge_request_urls(merge_request_urls)
 
# A user is not guaranteed to be returned; an orphaned write deploy
# Neither User nor Project are guaranteed to be returned; an orphaned write deploy
# key could be used
if user
if user && project
redirect_message = Gitlab::Checks::ProjectMoved.fetch_message(user.id, project.id)
project_created_message = Gitlab::Checks::ProjectCreated.fetch_message(user.id, project.id)
 
Loading
Loading
Loading
Loading
@@ -122,16 +122,15 @@ module API
use :issues_params
end
get ":id/issues" do
group = find_group!(params[:id])
issues = paginate(find_issues(group_id: group.id, include_subgroups: true))
issues = paginate(find_issues(group_id: user_group.id, include_subgroups: true))
 
options = {
with: Entities::Issue,
with_labels_details: declared_params[:with_labels_details],
current_user: current_user,
issuable_metadata: issuable_meta_data(issues, 'Issue', current_user),
include_subscribed: false
include_subscribed: false,
group: user_group
}
 
present issues, options
Loading
Loading
@@ -142,9 +141,7 @@ module API
use :issues_stats_params
end
get ":id/issues_statistics" do
group = find_group!(params[:id])
present issues_statistics(group_id: group.id, include_subgroups: true), with: Grape::Presenters::Presenter
present issues_statistics(group_id: user_group.id, include_subgroups: true), with: Grape::Presenters::Presenter
end
end
 
Loading
Loading
@@ -161,9 +158,7 @@ module API
use :issues_params
end
get ":id/issues" do
project = find_project!(params[:id])
issues = paginate(find_issues(project_id: project.id))
issues = paginate(find_issues(project_id: user_project.id))
 
options = {
with: Entities::Issue,
Loading
Loading
@@ -182,9 +177,7 @@ module API
use :issues_stats_params
end
get ":id/issues_statistics" do
project = find_project!(params[:id])
present issues_statistics(project_id: project.id), with: Grape::Presenters::Presenter
present issues_statistics(project_id: user_project.id), with: Grape::Presenters::Presenter
end
 
desc 'Get a single project issue' do
Loading
Loading
Loading
Loading
@@ -157,11 +157,9 @@ module API
use :merge_requests_params
end
get ":id/merge_requests" do
group = find_group!(params[:id])
merge_requests = find_merge_requests(group_id: user_group.id, include_subgroups: true)
 
merge_requests = find_merge_requests(group_id: group.id, include_subgroups: true)
present merge_requests, serializer_options_for(merge_requests)
present merge_requests, serializer_options_for(merge_requests).merge(group: user_group)
end
end
 
Loading
Loading
@@ -215,7 +213,7 @@ module API
 
merge_requests = find_merge_requests(project_id: user_project.id)
 
options = serializer_options_for(merge_requests)
options = serializer_options_for(merge_requests).merge(project: user_project)
options[:project] = user_project
 
present merge_requests, options
Loading
Loading
# frozen_string_literal: true
module Gitlab
module BacktraceCleaner
IGNORE_BACKTRACES = %w[
config/initializers
ee/lib/gitlab/middleware/
lib/gitlab/correlation_id.rb
lib/gitlab/database/load_balancing/
lib/gitlab/etag_caching/
lib/gitlab/i18n.rb
lib/gitlab/metrics/
lib/gitlab/middleware/
lib/gitlab/performance_bar/
lib/gitlab/profiler.rb
lib/gitlab/query_limiting/
lib/gitlab/request_context.rb
lib/gitlab/request_profiler/
lib/gitlab/sidekiq_logging/
lib/gitlab/sidekiq_middleware/
lib/gitlab/sidekiq_status/
lib/gitlab/tracing/
lib/gitlab/webpack/dev_server_middleware.rb
].freeze
IGNORED_BACKTRACES_REGEXP = Regexp.union(IGNORE_BACKTRACES).freeze
def self.clean_backtrace(backtrace)
return unless backtrace
Array(Rails.backtrace_cleaner.clean(backtrace)).reject do |line|
line.match(IGNORED_BACKTRACES_REGEXP)
end
end
end
end
Loading
Loading
@@ -42,7 +42,7 @@ module Gitlab
end
 
def store_pull_request_error(pull_request, ex)
backtrace = Gitlab::Profiler.clean_backtrace(ex.backtrace)
backtrace = Gitlab::BacktraceCleaner.clean_backtrace(ex.backtrace)
error = { type: :pull_request, iid: pull_request.iid, errors: ex.message, trace: backtrace, raw_response: pull_request.raw }
 
Gitlab::ErrorTracking.log_exception(ex, error)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment