Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow-up to gzip encoding of request body #343

Merged
merged 6 commits into from
Oct 13, 2020
Merged

Conversation

mrnugget
Copy link
Contributor

@mrnugget mrnugget commented Oct 13, 2020

This is a follow-up to #336 and addresses this comment #336 (comment) and the broken build (see #336 (comment)) 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 the api.Request struct to fix the data race
  • pulling the version/feature-flag check out of the api.Client and moving it into the campaigns.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

@mrnugget mrnugget requested a review from a team October 13, 2020 13:22
@mrnugget mrnugget mentioned this pull request Oct 13, 2020
Copy link
Member

@eseliger eseliger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌟

@mrnugget mrnugget merged commit 2ddb447 into main Oct 13, 2020
@mrnugget mrnugget deleted the mrn/fix-gzip-addition branch October 13, 2020 13:29
"github.com/hashicorp/go-multierror"
"github.com/jig/teereadcloser"
ioaux "github.com/jig/teereadcloser"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like goimports is what keeps adding the ioaux alias.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think it's correct, since the package defined in teereadcloser is called ioaux: https://github.com/jig/teereadcloser/blob/953720c48e058a8869b07daa7db756dc7823b2e1/teereadcloser.go#L5

@chrispine
Copy link
Contributor

Thanks!

scjohns pushed a commit that referenced this pull request Apr 24, 2023
* Add semver to go.mod

* Bring back tests for sourcegraphVersionCheck

* Extract version check into public function

* Move check for gzip compression to campaigns service

* Fix unmarshaling of sourcegraph version

* Add CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants