configu / configu

Open-source ConfigOps infrastructure ⚙️

Home Page:https://configu.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ExportCommand `filter` Callback

rannn505 opened this issue · comments

Suggestion

Introduce a filter callback function to the ExportCommand. This function accepts a single EvalCommandReturn object as its parameter and returns a boolean to determine whether a specific configuration key-value pair should be included in the ExportCommandReturn dictionary. This mechanism provides the foundation for implementing CLI flags such as --omit-label, --pick-label, --omit-empty, and --include-hidden, enabling users to finely tune the output of their exported configurations.

image

Motivation

The introduction of a filter callback in the ExportCommand significantly enhances the flexibility and control users have over the configuration data they export. This feature addresses the need to selectively process and refine configuration data before it is used or deployed, catering to various operational and environmental requirements. By enabling the dynamic inclusion or exclusion of specific configurations based on custom criteria, this feature streamlines the management of configuration data across different stages of the software development lifecycle.

Context

We should unify all filtering ops including the current hidden one to be handled in a single method