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

chore(node): normalize config.sh to return empty string #3502

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

andrewbattat
Copy link
Member

normalize config.sh get_config_value:

  • If key not found or value is "null", returns empty string. Otherwise, returns value

@andrewbattat andrewbattat self-assigned this Jan 17, 2025
@andrewbattat andrewbattat changed the title chore(node) normalize config.sh to return empty string chore(node): normalize config.sh to return empty string Jan 17, 2025
@github-actions github-actions bot added the chore label Jan 17, 2025
@andrewbattat andrewbattat marked this pull request as ready for review January 17, 2025 17:11
@andrewbattat andrewbattat requested a review from a team as a code owner January 17, 2025 17:11
@github-actions github-actions bot added the @node label Jan 17, 2025
Comment on lines +9 to +10
# If key is not found or value is "null", returns empty string.
# Otherwise, returns value.
Copy link
Member

Choose a reason for hiding this comment

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

We talked offline about opening a thread here to discuss. I don't think this is super critical, but still something to think about.


Combining these two cases removes our ability to differentiate between "unset" and "empty" fields in any scripts that use this shim.

We're not using it now, but one example I could think of was for defaults.
Say we have a list of DNS servers to use as default if none are provided via config. We would have no way to set a truly empty list of servers if the "unset" case is also represented by the empty string.

We won't have this issue in Rust - None and Some("") are still two distinct cases - but this means scripts and binaries will see the same config differently.

@Bownairo Bownairo requested a review from frankdavid January 17, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants