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

Change behavior of Param::Get<bool> #1397

Merged
merged 4 commits into from
Apr 10, 2024

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Apr 9, 2024

🦟 Bug fix

Implements a behavior change from a TODO comment in the Fortress era

Summary

A comment was added in d353294 to #638 suggesting a behavior change in Param::Get<bool> that should be done for Fortress. I just noticed it recently and have implemented the behavior change and updated a test and the migration guide.

Description of behavior change:

Previously when a Param was set from a string, the
Get<bool> method would always return true, and
the value would be true if the lowercase value string
matched "1" or "true". Otherwise the value would
be false.

Now, the Get<bool> method returns true only if the
lowercase value string matches one of "0", "1",
"true", or "false". Otherwise Get<bool> returns
false and the value is not written.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Previously when a Param was set from a string, the
`Get<bool>` method would always return `true`, and
the value would be `true` if the lowercase value string
matched `"1"` or `"true"`. Otherwise the value would
be `false`.

Now, the `Get<bool>` method returns `true` only if the
lowercase value string matches one of `"0"`, `"1"`,
`"true"`, or `"false"`. Otherwise `Get<bool>` returns
`false` and the value is not written.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters requested a review from azeey as a code owner April 9, 2024 00:20
@github-actions github-actions bot added the 🏛️ ionic Gazebo Ionic label Apr 9, 2024
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters merged commit c0dbc0c into main Apr 10, 2024
8 checks passed
@scpeters scpeters deleted the scpeters/param_get_bool_behavior_change branch April 10, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏛️ ionic Gazebo Ionic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants