fuzzylabs / matcha

A tool to provision MLOps environments in Azure
http://mymatcha.ai/
Apache License 2.0
30 stars 2 forks source link

[RPD-259] Refactor `build_state_from_terraform_output` within `matcha_state.py` to use objects defined within matcha_state.py #190

Closed swells2020 closed 1 year ago

swells2020 commented 1 year ago

This PR refactors the build_state_from_terraform_output method to make use of the custom classes within the matcha_state.py module.

Previously, the build_state_from_terraform_output method made use of the _parse_terraform_output utility function to build a dictionary representation of state. This dictionary was then converted into a MatchaState object using the from_dict method in the MatchaState class.

In this new implementation, the MatchaState object is built using the relevant classes representing underlying resources, properties and components.

This PR also updates the get_component method of the MatchaStateService by moving it to the MatchaState object and adding an ability for the method to return None. Changes have been made to the broader matcha codebase to account for this change.

Checklist

Please ensure you have done the following:

Type of change

Tick all those that apply: