Skip to content

Refactor the config validation logic #44

Description

@kimwnasptd

Context

As of right now we have 2 different functions for validating different parts of the config values:

  1. For checking if the ssh relevant configs are valid (i.e. no non-empty `repository, valid ssh url)
  2. For checking if the principals config values are not empty

The above though should be refactored, as there are currently mechanisms in place for better structure.

Two potential approaches to go with:

  1. Using pydantic for validating the config options, which is what the Data Platform is doing
  2. Use a dedicated component (from Chisme's BaseCharm)

This came also up during #39 (comment)

What needs to get done

  1. Commit in which approach we want (pydantic vs component, or both)
  2. Refactor and remove the current functions for validating the config

Definition of Done

  1. We no longer use functions for validation, but use either components or pydantic
  2. Have converted the unit tests to work with the updated code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions