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

vdk-core: inject parsed subsection configs into ConfigBuilder and support fetching by subsection #3306

Closed
DeltaMichael opened this issue Apr 15, 2024 · 0 comments
Assignees
Labels

Comments

@DeltaMichael
Copy link
Contributor

DeltaMichael commented Apr 15, 2024

Prerequisites

#3305

Overview

The parsed vdk subsection configs should be injected into the ConfigBuilder. We should also have a way to fetch the configurations by subsection key from the Config object built by the ConfigBuilder.

Suggested Implementation

    @hookimpl(tryfirst=True)
    def vdk_configure(self, config_builder: ConfigurationBuilder) -> None:
            
            for section, conf in job_config.get_vdk_options().items():
                if section is not "vdk":
                    for k, v in conf.items():
                            config_builder.add(
                                 section=section
                                 key=k,
                                 default_value=v,
                                 description=description,
                             )
               else:
                    for k, v in conf.items():
                        config_builder.set_value(section="vdk", k, v)

We should have some kind of section -> config mapping in ConfigBuilder and Config. This should be backwards-compatible. For example, if we don't pass a section, we should just default to the "vdk" section. We won't have to change any other calls to set_value this way. Same goes for add.

We should also support fetching config values by section and key, or fetching whole config objects by section name. Fetching whole config objects by section name would help with implementing multiple dbs in plugins.

Acceptance criteria

  1. Do the above implementation or a better alternative
  2. Add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants