Commit f8d30ad2 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Remove subscribed field from APIs listing issues

Remove the subscribed field from todos, related issues, and epic issues
API. We do not intend to include this in APIs that render multiple
issuables because this triggers Markdown processing for all notes and
is very expensive to compute.

Changelog: fixed
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60981
parent 3fed90cd
---
title: Remove subscribed field from todos, related issues, and epic issues API
merge_request: 60981
author:
type: fixed
......@@ -107,7 +107,6 @@ Example response:
"award_emoji": "http://localhost:3001/api/v4/projects/8/issues/6/award_emoji",
"project": "http://localhost:3001/api/v4/projects/8"
},
"subscribed": true,
"epic_issue_id": 2
}
]
......
......@@ -51,7 +51,6 @@ Parameters:
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
......
......@@ -102,7 +102,6 @@ Example Response:
},
"merge_when_pipeline_succeeds": false,
"merge_status": "cannot_be_merged",
"subscribed": true,
"user_notes_count": 7
},
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7",
......@@ -176,7 +175,6 @@ Example Response:
},
"merge_when_pipeline_succeeds": false,
"merge_status": "cannot_be_merged",
"subscribed": true,
"user_notes_count": 7
},
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7",
......
......@@ -71,7 +71,8 @@ module API
present paginate(related_issues(epic)),
with: EE::API::Entities::EpicIssue,
current_user: current_user
current_user: current_user,
include_subscribed: false
end
end
......
......@@ -21,12 +21,12 @@ module API
related_issues = source_issue.related_issues(current_user) do |issues|
issues.with_api_entity_associations.preload_awardable
end
related_issues.each { |issue| issue.lazy_subscription(current_user, user_project) } # preload subscriptions
present related_issues,
with: Entities::RelatedIssue,
current_user: current_user,
project: user_project
project: user_project,
include_subscribed: false
end
desc 'Relate issues' do
......
......@@ -79,7 +79,7 @@ module API
next unless collection
targets = collection.map(&:target)
options[type] = { issuable_metadata: Gitlab::IssuableMetadata.new(current_user, targets).data }
options[type] = { issuable_metadata: Gitlab::IssuableMetadata.new(current_user, targets).data, include_subscribed: false }
end
end
end
......
......@@ -195,7 +195,6 @@ RSpec.describe API::Issues do
milestone = create(:milestone, project: project)
create(:issue, project: project, milestone: milestone, closed_by: create(:user))
create(:note_on_issue, project: project, noteable: issues[0])
create(:note_on_issue, project: project, noteable: issues[0])
create(:note_on_issue, project: project, noteable: issues[1])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment