refactor: Remove InterpretStatus/Error & Outcome from Topology #99
Reference in New Issue
Block a user
No description provided.
Delete Branch "remove-interpret-status-from-topology"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
InterpretStatus,InterpretError, andOutcomeleaked in places it shouldn't have: theTopology. Because of this, refactoring to better track & instrumentInterpretwas more difficult as it might have effects on theTopologyas well. Which wasn't a desirable outcome.This PR introduces a
TopologyStatealong with itsTopologyStatus, and aPreparationOutcomealong with itsPreparationError.A clear separation was introduced between the
TopologyState/TopologyStatusand thePreparationOutcome/PrepareErrorbecause they serve different purposes/were needed by different actors.TopologyState/TopologyStatusserves only theMaestroto track theTopologystate (whether it's ready or not). Whereas thePreparationOutcome/PreparationErrorserves theTopologyitself for every individual actions it might take in order to be ready (e.g. installing k8s client, configuring the k8s tenant manager, installing prometheus, etc.).For now, I couldn't find an elegant way to move the
TopologyStatemanagement inside the topology itself without pushing this responsibility back to the implementers of eachTopology. So that's why it's currently handled by theMaestroitself. Which in a way makes sense as it's part of its responsibilities.Sidequest (sorry 😅): also replace the multiple Topology events by a single
TopologyStateChangedevent. We will probably do the same for the Interpret events later on.LGTM 🎉
@@ -63,0 +73,4 @@}#[derive(Debug, Clone, new)]pub struct PreparationError {I love this! Feels natural and clean.
Also very naturally outlines a trend to eventually avoid the boilerplate of having each module define its own set of Outcome, Error. We will then refactor with a standardized approach when time comes.