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

feat: implement response compression #5001

Merged
merged 19 commits into from
Jan 14, 2025
Merged

Conversation

zhaohuabing
Copy link
Member

@zhaohuabing zhaohuabing commented Jan 3, 2025

This PR introduces support for response compression in the BackendTrafficPolicy.

Currently, brotli and gzip are supported.

Implements #2451

Release Notes: Yes

@zhaohuabing zhaohuabing requested a review from a team as a code owner January 3, 2025 09:04
@zhaohuabing zhaohuabing marked this pull request as draft January 3, 2025 09:04
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 73.61963% with 43 lines in your changes missing coverage. Please review.

Project coverage is 66.71%. Comparing base (f6bb7f8) to head (4e827e8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/xds/translator/compressor.go 71.03% 30 Missing and 12 partials ⚠️
internal/gatewayapi/clustersettings.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5001      +/-   ##
==========================================
+ Coverage   66.70%   66.71%   +0.01%     
==========================================
  Files         210      211       +1     
  Lines       32647    32811     +164     
==========================================
+ Hits        21777    21891     +114     
- Misses       9554     9591      +37     
- Partials     1316     1329      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhaohuabing zhaohuabing force-pushed the compression branch 5 times, most recently from 76681e4 to 0d5cc71 Compare January 6, 2025 04:56
@zhaohuabing zhaohuabing marked this pull request as ready for review January 6, 2025 04:57
@@ -32,8 +32,8 @@ func init() {
// Copied from the conformance suite because it's needed in casePreservingRoundTrip
var startLineRegex = regexp.MustCompile(`(?m)^`)

func formatDump(data []byte, prefix string) string {
data = startLineRegex.ReplaceAllLiteral(data, []byte(prefix))
func formatDump(data []byte) string {
Copy link
Member Author

@zhaohuabing zhaohuabing Jan 6, 2025

Choose a reason for hiding this comment

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

To fix lint error:

test/e2e/tests/preservecase.go:35:30: `formatDump` - `prefix` always receives `"< "` (unparam)

@zhaohuabing zhaohuabing marked this pull request as draft January 8, 2025 00:33
@zhaohuabing zhaohuabing changed the title implement compression feat: implement response compression Jan 8, 2025
@zhaohuabing zhaohuabing marked this pull request as ready for review January 8, 2025 08:29
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
This reverts commit 969d0db.

Signed-off-by: Huabing Zhao <[email protected]>
arkodg
arkodg previously approved these changes Jan 10, 2025
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks !

@arkodg arkodg requested review from a team January 10, 2025 19:31
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
@arkodg arkodg requested review from a team January 13, 2025 21:14
@arkodg arkodg merged commit 743e5e0 into envoyproxy:main Jan 14, 2025
10 checks passed
@zhaohuabing zhaohuabing deleted the compression branch January 14, 2025 01:57
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