mirror of
https://github.com/dredx/prole.git
synced 2026-09-24 18:44:33 +00:00
- Finalized stable, repeatable reset logic for the k3d pipeline. - Refactored installer into modular components: core, milestone, runner, and state. - Introduced new UI abstractions with support for ncurses and Tkinter. - Updated initialization scripts and configurations for CloudNativePG, Kerberos, OpenBao, and Monitoring. - Improved pipeline repair and port-forwarding mechanisms.
39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
"""Milestone abstraction for the UI-agnostic installer core."""
|
|
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
from typing import Callable, Iterable, Sequence
|
|
|
|
from .state import InstallerState
|
|
|
|
ProgressCallback = Callable[[str, float | None], None]
|
|
ValidationResult = str | Sequence[str] | None
|
|
|
|
|
|
class Milestone(ABC):
|
|
"""Base class for installer milestones.
|
|
|
|
Milestones encapsulate business logic, validation, and flow control.
|
|
They must not import or depend on UI toolkits.
|
|
"""
|
|
|
|
id: str
|
|
title: str
|
|
|
|
def __init__(self, milestone_id: str, title: str):
|
|
self.id = milestone_id
|
|
self.title = title
|
|
|
|
def validate(self, state: InstallerState) -> ValidationResult:
|
|
"""Return a validation error or None when valid."""
|
|
return None
|
|
|
|
@abstractmethod
|
|
def execute(self, state: InstallerState, progress: ProgressCallback | None = None) -> None:
|
|
"""Execute milestone logic. Use the progress callback to emit updates."""
|
|
raise NotImplementedError
|
|
|
|
def next(self, state: InstallerState) -> str | None:
|
|
"""Return the next milestone id or None to finish."""
|
|
return None
|