Follow-up to gzip encoding of request body
Created by: mrnugget
This is a follow-up to https://github.com/sourcegraph/src-cli/pull/336 and addresses this comment https://github.com/sourcegraph/src-cli/pull/336#discussion_r503788437 and the broken build (see https://github.com/sourcegraph/src-cli/pull/336#issuecomment-707605116) by
- making gzip compression for GraphQL requests an opt-in feature of the
api.Client
(vs. trying to encode every request) - making the
gzip: bool
flag a property of theapi.Request
struct to fix the data race - pulling the version/feature-flag check out of the
api.Client
and moving it into thecampaigns.Service
where it's used to determine whether gzip compression should be used or not - adding back the the unit tests that came with the original implementation of the
sourcegraphVersionCheck
function - reusing the existing GraphQL-request logic in
campaigns.Service
to query the version - adding a changelog