Skip to content

source: more GCOVR removal#19707

Merged
alyssawilk merged 3 commits intoenvoyproxy:mainfrom
alyssawilk:gcovr_nextnext
Feb 4, 2022
Merged

source: more GCOVR removal#19707
alyssawilk merged 3 commits intoenvoyproxy:mainfrom
alyssawilk:gcovr_nextnext

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk commented Jan 26, 2022

Risk Level: medium
Testing: existing tests
Docs Changes: n/a
Release Notes: n/a
part of #19172

@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #19707 was opened by alyssawilk.

see: more, trace.

@alyssawilk alyssawilk force-pushed the gcovr_nextnext branch 3 times, most recently from 9c379d0 to 7bc57f8 Compare January 27, 2022 18:45
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk marked this pull request as ready for review January 31, 2022 14:12
Copy link
Copy Markdown
Contributor

@snowp snowp 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, a few questions

Network::DnsLookupFamily
getDnsLookupFamilyFromEnum(envoy::config::cluster::v3::Cluster::DnsLookupFamily family) {
switch (family) {
PANIC_ON_PROTO_ENUM_SENTINEL_VALUES;
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.

For my understanding, when do we need this? Why don't we specify this for the enum in matchers.cc for example?

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.

More detail in linked issue, but proto creates sentinel values so it can test to see if you go beyond MIN and MAX, and if you want to do an exhaustive switch you need to handle those.

If you don't do exhaustive switch you end up introducing bugs when you add new fields, like the fact this switch was missing handling for ALL and would have panic'd if that config path was hit in production :-(

Comment on lines -326 to +328
NOT_REACHED_GCOVR_EXCL_LINE;
PANIC("unexpected");
}
NOT_REACHED_GCOVR_EXCL_LINE;
PANIC("unexpected");
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.

Fallthrough here as elsewhere?

"source/common/protobuf:94.8"
"source/common/quic:91.8"
"source/common/router:96.5"
"source/common/router:96.3"
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.

Is there no way to maintain coverage of this new code? Is it going down because of lines of code we need in order to satisfy the compiler but that won't actually get hit?

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.

unfortunately the only way to test PANIC is with death test, which doesn't help coverage.
there's a follow-up issue to move these panics over sensible defaults and actual error handling and that should come with unit tests. As this shows, we have WAY too many PANICs in the data plane, due to this macro being misleading

@snowp snowp self-assigned this Feb 1, 2022
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk
Copy link
Copy Markdown
Contributor Author

CI sorted.

@alyssawilk alyssawilk enabled auto-merge (squash) February 2, 2022 20:32
@alyssawilk alyssawilk merged commit 695a42a into envoyproxy:main Feb 4, 2022
joshperry pushed a commit to joshperry/envoy that referenced this pull request Feb 13, 2022
Risk Level: medium
Testing: existing tests
Docs Changes: n/a
Release Notes: n/a
part of envoyproxy#19172

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Josh Perry <josh.perry@mx.com>
@alyssawilk alyssawilk deleted the gcovr_nextnext branch August 4, 2022 01:09
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.

2 participants