Skip to content

Implement `get_config`

Stephan Lachnit requested to merge p-cxx-implement-get-config into main

This is got a large MR for implementing the get_config command. As it turned out, there was some refactoring for existing classes needed.

TODO:

  • Add exceptions for unused keys
  • Define behavior for unused keys
  • Add getUsedKeys() and return that for get_config
  • Add unit tests

@simonspa @hanno.perrey an open question is how we handle unused keys in the configuration. The problem is that at that point, the user initialization function (or reconfigure function) already passed successfully. I see three options:

  1. Simply log a warning
  • pro: simple typo can be fixed quickly
  • con: can be easily missed/ignored
  1. Go to ERROR state
  • pro: it is obvious that there is a problem
  • con: ERROR state is undefined and requires manual intervention
  1. Go to SAFE state
  • pro: in a defined state, requires new configuration to exit it
  • con: requires a new transition from initializing and reconfiguring to SAFE

I'm leaning towards option 3: it is hard to miss/ignore and at the same easy to recover from

Edited by Stephan Lachnit

Merge request reports