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

runtime: load rtds bool correctly as true/false instead of 1/0 #36044

Merged
merged 10 commits into from
Sep 11, 2024

Conversation

gordon-wang-lyft
Copy link
Contributor

@gordon-wang-lyft gordon-wang-lyft commented Sep 9, 2024

Commit Message: Load RTDS boolean config correctly as true/false instead of 1/0
Additional Description: Currently, RTDS boolean values are being loaded as 1 or 0, which is inconsistent with the expected true or false values. This discrepancy needs to be corrected so that boolean values are consistently loaded and represented as true or false. For further details, please refer to the issue comment where this inconsistency is discussed.
Risk Level: Low (to be consistent with initially loaded true/false value)
Testing: new Unit Test
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a
[Optional Fixes #Issue] #35762

Copy link

Hi @gordon-wang-lyft, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #36044 was opened by gordon-wang-lyft.

see: more, trace.

@gordon-wang-lyft gordon-wang-lyft changed the title runtime: load rtds bool correctly as true/false instead of 0/1 runtime: load rtds bool correctly as true/false instead of 1/0 Sep 9, 2024
@gordon-wang-lyft gordon-wang-lyft force-pushed the main branch 2 times, most recently from c233209 to 9f47dbb Compare September 9, 2024 19:22
Copy link
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.

code LGTM but let's runtime guard just in case it causes problems for anyone.
/wait

)EOF");
EXPECT_CALL(rtds_init_callback_, Call());
doOnConfigUpdateVerifyNoThrow(runtime);

EXPECT_EQ("bar", loader_->snapshot().get("foo").value().get());
EXPECT_EQ("yar", loader_->snapshot().get("bar").value().get());
EXPECT_EQ("meh", loader_->snapshot().get("baz").value().get());
EXPECT_EQ("true", loader_->snapshot().get("toggle").value().get());
Copy link
Contributor

Choose a reason for hiding this comment

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

just to confirm, this check fails prior to your change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. This is a newly added check.

Without the source code change, it will fail, since snapshot().get("toggle").value().get() will return "1" instead of "true".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also updated a comment so it is more clear why absl::StrCat is not used for boolean case

Copy link
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.

I do still think it's worth a runtime guard
/wait

@gordon-wang-lyft
Copy link
Contributor Author

/retest

@gordon-wang-lyft
Copy link
Contributor Author

I do still think it's worth a runtime guard /wait

Will add and update soon.

Copy link

CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).

🐱

Caused by: #36044 was synchronize by gordon-wang-lyft.

see: more, trace.

@gordon-wang-lyft gordon-wang-lyft force-pushed the main branch 3 times, most recently from 9b6d4ac to d1efd5b Compare September 10, 2024 18:59
@gordon-wang-lyft
Copy link
Contributor Author

I do still think it's worth a runtime guard /wait

Will add and update soon.

Updated with runtime guard and specific test cases. Let me know how it looks like. Thanks @alyssawilk !

Signed-off-by: Gordon Wang <[email protected]>
Signed-off-by: Gordon Wang <[email protected]>
Signed-off-by: Gordon Wang <[email protected]>
Signed-off-by: Gordon Wang <[email protected]>
Signed-off-by: Gordon Wang <[email protected]>
Signed-off-by: Gordon Wang <[email protected]>
Signed-off-by: Gordon Wang <[email protected]>
Signed-off-by: Gordon Wang <[email protected]>
@alyssawilk alyssawilk merged commit cd3346d into envoyproxy:main Sep 11, 2024
39 checks passed
unicell added a commit to unicell/envoy that referenced this pull request Sep 11, 2024
* upstream/main: (21 commits)
  Add a CPU utilization resource monitor for overload manager (envoyproxy#34713)
  jwks: Add UA string to headers (envoyproxy#35977)
  exceptions: cleaning up macros (envoyproxy#35694)
  coverage: ratcheting (envoyproxy#36058)
  runtime: load rtds bool correctly as true/false instead of 1/0 (envoyproxy#36044)
  Typo in documentation of http original_src filter (envoyproxy#36060)
  docs: updating meeting info (envoyproxy#36052)
  quic: removes more references to spdy::Http2HeaderBlock. (envoyproxy#36057)
  json: add null support to the streamer (envoyproxy#36051)
  json: make the streamer a template class (envoyproxy#36001)
  docs: Add `apt.envoyproxy.io` install information (envoyproxy#36050)
  ext_proc: elide redundant copy in ext_proc filter factory callback (envoyproxy#36015)
  build(deps): bump yarl from 1.11.0 to 1.11.1 in /tools/base (envoyproxy#36049)
  build(deps): bump multidict from 6.0.5 to 6.1.0 in /tools/base (envoyproxy#36048)
  quic: enable certificate compression/decompression (envoyproxy#35999)
  Geoip fix asan failure (envoyproxy#36043)
  mobile: Fix missing logging output in Swift integration tests (envoyproxy#36040)
  http: minor code clean up to the http filter manager (envoyproxy#36027)
  ci/example: Dont build/test the filter example in Envoy CI (envoyproxy#36038)
  ci/codeql: Fix build setup (envoyproxy#36021)
  ...

Signed-off-by: Qiu Yu <[email protected]>
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