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

Merge branch 'bw-jira-list-performance' into 'master'

Only query for necessary Jira fields

See merge request gitlab-org/gitlab!36655
parents bbb7e353 ecb8e946
......@@ -7,6 +7,9 @@ module Jira
extend ::Gitlab::Utils::Override
PER_PAGE = 100
DEFAULT_FIELDS = %w[assignee created creator id issuetype key
labels priority project reporter resolutiondate
status statuscategorychangeddate summary updated].join(',').freeze
def initialize(jira_service, params = {})
super(jira_service, params)
......@@ -22,7 +25,7 @@ module Jira
override :url
def url
"#{base_api_url}/search?jql=#{CGI.escape(jql)}&startAt=#{start_at}&maxResults=#{per_page}&fields=*all"
"#{base_api_url}/search?jql=#{CGI.escape(jql)}&startAt=#{start_at}&maxResults=#{per_page}&fields=#{DEFAULT_FIELDS}"
end
override :build_service_response
......
......@@ -103,6 +103,12 @@ RSpec.describe Jira::Requests::Issues::ListService do
subject
end
end
it 'requests for default fields' do
expect(client).to receive(:get).with(include("fields=#{described_class::DEFAULT_FIELDS}")).and_return([])
subject
end
end
end
end
......
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