Skip to content

Test for Brotli decompressor#2066

Merged
carloseltuerto merged 9 commits intoenvoyproxy:mainfrom
carloseltuerto:cronvoy063
Mar 10, 2022
Merged

Test for Brotli decompressor#2066
carloseltuerto merged 9 commits intoenvoyproxy:mainfrom
carloseltuerto:cronvoy063

Conversation

@carloseltuerto
Copy link
Copy Markdown
Contributor

@carloseltuerto carloseltuerto commented Feb 18, 2022

@goaway : adds a hardcoded dependency to Envoy-Mobile: Brotli Decompressor extension.

Hack: The YAML config for the Brotli Decompressor is in Cronvoy only - the support for Brotli decompressor is not yet available in config.cc

BrotliTest.java in this PR is almost a perfect copy of https://source.chromium.org/chromium/chromium/src/+/main:components/cronet/android/test/javatests/src/org/chromium/net/BrotliTest.java

Description: Adds Brotli support for Cronvoy
Risk Level: Small.
Testing: BrotliTest ported from Chromium, CI
Docs Changes: N/A
Release Notes: N/A
Signed-off-by: Charles Le Borgne cleborgne@google.com

Signed-off-by: Charles Le Borgne <cleborgne@google.com>
Signed-off-by: Charles Le Borgne <cleborgne@google.com>
Signed-off-by: Charles Le Borgne <cleborgne@google.com>
Signed-off-by: Charles Le Borgne <cleborgne@google.com>
Signed-off-by: Charles Le Borgne <cleborgne@google.com>
Copy link
Copy Markdown
Contributor

@RyanTheOptimist RyanTheOptimist left a comment

Choose a reason for hiding this comment

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

Looks good to me. (Modulo one question and one optional nit). The issues with the content-encoding header is a curious one...


#include "source/common/upstream/logical_dns_cluster.h"
#include "source/extensions/clusters/dynamic_forward_proxy/cluster.h"
#include "source/extensions/compression/brotli/decompressor/config.h"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Up to you, but I think I'd be inclined to add this to the .cc file, not the .h file. (Though many similar includes seem to be in the .h file already)

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.

Admittedly, I'm going with the "monkey see, monkey do" strategy - my sense of where a .h should be included is not developed yet. That strategy has one virtue, though: it is consistent (good or bad).
If you can tell me what is the strategy here, I can rather move all the offending includes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, that's a great strategy :) My general philosophy is to only put an include in the .h file if it's needed for the .h file itself. In this case, it appears that the only "code" in the .h file is a declaration of a function with no arguments that returns void. So I would think that it shouldn't need any includes. Does it still build if you move all of 'em?

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.

I moved them all - thanks!

* @return the builder to facilitate chaining.
*/
@VisibleForTesting
public CronetEngineBuilderImpl setMockCertVerifierForTesting() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like this logic is (roughly) moving from CronetEngineBuilder to NativeCronetEngineBuilderImpl. Out of curiosity, what's that motivation?

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.

I moved this here because this is an EnvoyMobile enum that is being use, and this is the only class bridging EM and Cronet for the Configuration.

The second weaker reason is that CronetEngineBuilderImpl (where that method was before this PR) is also used by the Java implementation of Cronet, where it makes no sense.

alyssawilk
alyssawilk previously approved these changes Mar 7, 2022
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

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

wohoo!

Signed-off-by: Charles Le Borgne <cleborgne@google.com>
RyanTheOptimist
RyanTheOptimist previously approved these changes Mar 8, 2022
Signed-off-by: Charles Le Borgne <cleborgne@google.com>
Signed-off-by: Charles Le Borgne <cleborgne@google.com>
@carloseltuerto
Copy link
Copy Markdown
Contributor Author

ios_build / swift_async_await is very flaky

https://github.com/envoyproxy/envoy-mobile/runs/5478268352?check_suite_focus=true

Kicking CI again.

@carloseltuerto
Copy link
Copy Markdown
Contributor Author

/retest

#include "library/common/extensions/filters/http/network_configuration/config.h"
#include "library/common/extensions/filters/http/platform_bridge/config.h"
#include "library/common/extensions/filters/http/route_cache_reset/config.h"
#include "library/common/extensions/retry/options/network_configuration/config.h"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice cleanup.

Copy link
Copy Markdown
Contributor

@goaway goaway 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 @carloseltuerto!

@carloseltuerto carloseltuerto merged commit e388439 into envoyproxy:main Mar 10, 2022
jpsim added a commit that referenced this pull request Mar 14, 2022
* origin/main:
  [CI] Only install Android tool dependencies when needed (#2095)
  update envoy to latest (#2094)
  [CI] Fix DCO in support rotation bump PRs (#2092)
  Fix iOS async/await example app (#2093)
  Test for Brotli decompressor (#2066)
  docs: fix day (#2089)
  engine builder: add option to add a list of H2-Raw domain names (#2088)
  docs: adding the community meeting (#2083)

Signed-off-by: JP Simard <jp@jpsim.com>
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.

4 participants