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

Refactor the config_parser into multiple composable components #24

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

jordipiqueselles
Copy link
Collaborator

The config_parser.py was a file that contained all the classes and methods needed to parse the yaml config used to configure the webhook. Its purpose was to read the yaml file and generate objects that the core of the app can manage and understand.

The problem with the old approach is that it was difficult to support multiple formats of the yaml config file. Ideally, if we decide to modify the format of the yaml config file, the app should be able to handle both old and new version (backward compatibility is always welcome for end users).

This commit relocates the classes defined in config_parser.py into different files within the config_parser directory. Apart from that, now each subpiece of the yaml file is parsed by an interface. This interface can have different implementations in case we modify the format of the underlying yaml. Then, the GenericWebhookConfigManifest class has a method to instantiate the different subparsers according to the schema version of the yaml file.

@jordipiqueselles jordipiqueselles added the enhancement New feature or request label Aug 26, 2023
The config_parser.py was a file that contained all the classes and
methods needed to parse the yaml config used to configure the webhook.
Its purpose was to read the yaml file and generate objects that the core
of the app can manage and understand.

The problem with the old approach is that it was difficult to support
multiple formats of the yaml config file. Ideally, if we decide to
modify the format of the yaml config file, the app should be able to
handle both old and new version (backward compatibility is always
welcome for end users).

This commit relocates the classes defined in config_parser.py into
different files within the config_parser directory. Apart from that,
now each subpiece of the yaml file is parsed by an interface. This interface
can have different implementations in case we modify the format of the
underlying yaml. Then, the GenericWebhookConfigManifest class has a
method to instantiate the different subparsers according to the schema
version of the yaml file.
@jordipiqueselles jordipiqueselles added enhancement New feature or request and removed enhancement New feature or request labels Aug 27, 2023
@jordipiqueselles jordipiqueselles merged commit fd7e7bd into main Aug 28, 2023
1 check passed
@jordipiqueselles jordipiqueselles deleted the jordi/refactor-config-parser branch August 28, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant