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

Environment Variables Suck #309

Open
thirtytwobits opened this issue Aug 2, 2023 · 1 comment
Open

Environment Variables Suck #309

thirtytwobits opened this issue Aug 2, 2023 · 1 comment

Comments

@thirtytwobits
Copy link
Member

Many many reasons why but here are two things that need to be fixed:

  1. Always recheck and rebuild the database when environment variables change. For example, I just wasted 15 minutes trying to figure out why pycyphal was trying to connect to UDP only to discover that my previous value UAVCAN__UDP__IFACE was somehow part of the db. Once I deleted this and restarted my new environment variables were found.
  2. Always accept "CYPHAL_" where "UAVCAN_" is currently required. It's really hard to remember which of the environment variables are UAVCAN and which are CYPHAL. Either should be accepted but CYPHAL should be documented.
@pavel-kirienko
Copy link
Member

  1. We can make it so that environment variables override all entries in the database during initialization, like the following but executed for all records in the db during construction:

env_val = self.environment_variables.get(get_environment_variable_name(key))
if env_val is not None:
_logger.debug("%r: Update from env: %r <- %r", self, key, env_val)
reg = self[key]
reg.assign_environment_variable(env_val)
self[key] = reg

  1. This is outside of the scope of PyCyphal because the names come from https://github.com/OpenCyphal/public_regulated_data_types/blob/935973babe11755d8070e67452b3508b4b6833e2/uavcan/register/384.Access.1.0.dsdl#L80

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

No branches or pull requests

2 participants