Skip to content

Follow-up to gzip encoding of request body#343

Merged
mrnugget merged 6 commits into
mainfrom
mrn/fix-gzip-addition
Oct 13, 2020
Merged

Follow-up to gzip encoding of request body#343
mrnugget merged 6 commits into
mainfrom
mrn/fix-gzip-addition

Conversation

@mrnugget

@mrnugget mrnugget commented Oct 13, 2020

Copy link
Copy Markdown
Contributor

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

@eseliger eseliger left a comment

Copy link
Copy Markdown
Member

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
Comment thread internal/api/api.go
"github.com/Masterminds/semver"
"github.com/hashicorp/go-multierror"
"github.com/jig/teereadcloser"
ioaux "github.com/jig/teereadcloser"

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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