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

WIP: Revamp config management #1104

Draft
wants to merge 8 commits into
base: v1.x.x
Choose a base branch
from

Commits on Nov 15, 2024

  1. Improve load_config documentation

    Make it more explicit that this is just a wrapper to external libraries
    so users should read their documentation in full and which functions are
    used exactly.
    
    Signed-off-by: Leandro Lucarella <[email protected]>
    llucax committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    694ce64 View commit details
    Browse the repository at this point in the history
  2. Drop support for using marshmallow_dataclas.dataclass directly

    `marshmallow_dataclass.dataclass` is intended to be used only when using
    `my_dataclass.Schema` to get the schema. But using this is not very
    convenient when using type hints as they are not well supported by
    `marshmallow`, as the `load()` function can't have hints.
    
    This is actually why `load_config()` exists in the first place, so we
    are using `class_schema()` instead, so we don't really need that our
    types are decorated with `marshmallow_dataclass`, we can use the
    built-in `dataclass` instead, we just need to add the appropriate
    metadata if we want more complex validation.
    
    Using `class_shema()` is also necessary to be able to pass a
    `base_schema`, which we'll need when we want to use schemas with
    custom fields, like the ones provided by `frequenz.quantities`.
    
    Because of this, we just drop support for
    `marshmallow_dataclass.dataclass` and we'll require that built-in
    dataclasses are used in the future.
    
    Signed-off-by: Leandro Lucarella <[email protected]>
    llucax committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    0642d3a View commit details
    Browse the repository at this point in the history
  3. Make load_config() accept a base_schema

    This is necessary to use custom fields when loading configurations.
    
    Signed-off-by: Leandro Lucarella <[email protected]>
    llucax committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    9ed4030 View commit details
    Browse the repository at this point in the history
  4. Require using built-in dataclasses in load_config()

    This is just the last step to be able to enforce via the type system
    that only built-in dataclasses are used.
    
    Signed-off-by: Leandro Lucarella <[email protected]>
    llucax committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    e89fa91 View commit details
    Browse the repository at this point in the history
  5. Rename _config_managing.py to _actor.py

    As this package gets more stuff, the old name used when the actor was
    stored in the `frequenz.actor` package doesn't make much sense and is
    confusing.
    
    Signed-off-by: Leandro Lucarella <[email protected]>
    llucax committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    bbaa2c8 View commit details
    Browse the repository at this point in the history
  6. Rename LoggingConfigUpdater to LoggingConfigUpdatingActor

    This is to follow the naming convention of actors and make it more
    obvious that it is an actor.
    
    Signed-off-by: Leandro Lucarella <[email protected]>
    llucax committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    1b08f33 View commit details
    Browse the repository at this point in the history
  7. Ignore pylint checks that are covered by mypy

    `pylint` is much more flaky than `mypy`, so better just have `mypy`
    doing those checks.
    
    Signed-off-by: Leandro Lucarella <[email protected]>
    llucax committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    d49cddb View commit details
    Browse the repository at this point in the history
  8. WIP

    llucax committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    7954aa8 View commit details
    Browse the repository at this point in the history