- 
                Notifications
    You must be signed in to change notification settings 
- Fork 69
gzip http requests #336
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
gzip http requests #336
Conversation
| I approved this, but I do have a concern with the migration path: since there's no way for the Sourcegraph server to indicate its version before a request is made, we may attempt to speak  One option that does occur to me would be to have the Sourcegraph server returns its version in a  (Spoiler: having a version field in the response is something I'll also be proposing in the versioning RFC.) | 
| Your point is still valid because we do evaluate the search scope before and stuff, but I think campaign specs are created at the very end, since they're bundling changeset specs :) | 
| 
 Never trust my memory on a one coffee day. 😆 | 
| 
 How about we bring back the version checks as the first step here? We had this code before switching to the new workflow: src-cli/cmd/src/patch_sets_create_from_patches.go Lines 108 to 115 in d7d4bb2 
 (Complete code here is ~40 lines and self-contained.) It does make an additional request, but I think that's negligible for now. And it gives us a back a way, today, to fence features. Once we return the version in a header we can switch out the "get the version" part and keep the check. | 
| 
 That's probably right. Why not | 
| } | ||
|  | ||
| return req, nil | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That means we try to gzip every request — GraphQL, non-GraphQL — now, right? Doesn't that break things, since we only added gzip support to the GraphQL API?
| This broke the build, because  I'll open a PR that fixes this and also try to only use gzip in the campaigns part of src-cli, so we don't unintentionally break something. | 
| I opened a follow-up PR that addresses my comments here #343 so that we can release src-cli before branch cut. | 
* gzip http requests * remove unused alias * add version checks before gzipping * swallow errors when checking backend version * I do not know why my editor keeps adding this
This gzips http requests to the backend. It relies on this and partially fixes this.