Commit ca34c628 authored by Vladlena Shumilo's avatar Vladlena Shumilo Committed by Dylan Griffith

Mandatory active_users param for SyncSeatLinkRequestWorker#perform

Make the active_users param mandatory for SyncSeatLinkRequestWorker
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28241
made it option for backwards compatibility
parent 1d2259fd
...@@ -12,10 +12,7 @@ class SyncSeatLinkRequestWorker ...@@ -12,10 +12,7 @@ class SyncSeatLinkRequestWorker
RequestError = Class.new(StandardError) RequestError = Class.new(StandardError)
# active_users param is optional as it was added in a patch release for %12.9. def perform(date, license_key, max_historical_user_count, active_users)
# The optional nil value can be removed in the next major release, %13.0, when
# it becomes mandatory.
def perform(date, license_key, max_historical_user_count, active_users = nil)
response = Gitlab::HTTP.post( response = Gitlab::HTTP.post(
URI_PATH, URI_PATH,
base_uri: EE::SUBSCRIPTIONS_URL, base_uri: EE::SUBSCRIPTIONS_URL,
......
---
title: Make active_users param mandatory for SyncSeatLinkRequestWorker#perform
merge_request: 30810
author:
type: other
...@@ -43,29 +43,5 @@ describe SyncSeatLinkRequestWorker, type: :worker do ...@@ -43,29 +43,5 @@ describe SyncSeatLinkRequestWorker, type: :worker do
end end
it_behaves_like 'unsuccessful request' it_behaves_like 'unsuccessful request'
context 'when the active_users param is not passed' do
subject do
described_class.new.perform('2020-01-01', '123', 5)
end
it 'still processes the job and sends a request with active_users set to nil' do
stub_request(:post, seat_link_url).to_return(status: 200)
subject
expect(WebMock).to have_requested(:post, seat_link_url).with(
headers: { 'Content-Type' => 'application/json' },
body: {
date: '2020-01-01',
license_key: '123',
max_historical_user_count: 5,
active_users: nil
}.to_json
)
end
it_behaves_like 'unsuccessful request'
end
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