enhancement(common): extend PermissiveBool to match Go's strconv.ParseBool#1290
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits intoMar 31, 2026
Merged
Conversation
…ool string set Accepts "1", "t", "T", "TRUE", "true", "True" as truthy and "0", "f", "F", "FALSE", "false", "False" as falsy, matching the exact set of Go's strconv.ParseBool. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s, drop serde_json dev-dep Add a case-insensitive fallback for "true"/"false" after the Go strconv.ParseBool exact matches so arbitrary case variants (e.g. "tRuE") continue to be accepted, preventing regression from prior behavior. Rewrite tests using serde's own value deserializers to remove the serde_json dev-dependency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sfy clippy Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…strconv.ParseBool Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…allback for true/false The explicit TRUE/true/True and FALSE/false/False arms are redundant now that the case-insensitive fallback handles them. Keep only the short forms (1/t/T, 0/f/F). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PermissiveBool to match Go's strconv.ParseBool
tobz
requested changes
Mar 31, 2026
Member
tobz
left a comment
There was a problem hiding this comment.
Seems like we're missing basic unit tests that it actually accepts the short forms?
…falsy tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tobz
approved these changes
Mar 31, 2026
tobz
approved these changes
Mar 31, 2026
4a0848b
into
main
58 of 60 checks passed
dd-octo-sts Bot
pushed a commit
that referenced
this pull request
Mar 31, 2026
…arseBool` (#1290) Noticed this as part of working on config support for `DD_NO_PROXY_NONEXACT_MATCH` which is a boolean config value. Within the existing Agent there is a wide variety of bool parsing going on, but it looks like `nodetreemodel` is eventually calling out to `spf13/cast` which eventually gets to `strconv.ParseBool`. This Go stdlib function allows some string values which will currently error out in Saluki: > ParseBool returns the boolean value represented by the string. It accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False. Any other value returns an error. This PR extends `PermissiveBool` to accommodate all of these cases, in addition to its current support for case-insensitive "true" and "false". Co-authored-by: travis.thieman <travis.thieman@datadoghq.com> 4a0848b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Noticed this as part of working on config support for
DD_NO_PROXY_NONEXACT_MATCHwhich is a boolean config value. Within the existing Agent there is a wide variety of bool parsing going on, but it looks likenodetreemodelis eventually calling out tospf13/castwhich eventually gets tostrconv.ParseBool. This Go stdlib function allows some string values which will currently error out in Saluki:This PR extends
PermissiveBoolto accommodate all of these cases, in addition to its current support for case-insensitive "true" and "false".