From 384920c1bb9337ce7f04c96eeb28206a682ad039 Mon Sep 17 00:00:00 2001 From: Paul Farault Date: Wed, 18 Oct 2023 17:33:41 +0200 Subject: [PATCH] feat: user can add a message when overriding status --- tdp/cli/commands/status/edit.py | 8 ++++++++ tdp/core/models/sch_status_log.py | 3 +++ 2 files changed, 11 insertions(+) diff --git a/tdp/cli/commands/status/edit.py b/tdp/cli/commands/status/edit.py index 17f90f3e..03397693 100644 --- a/tdp/cli/commands/status/edit.py +++ b/tdp/cli/commands/status/edit.py @@ -28,6 +28,12 @@ @click.command() @_common_status_options @_hosts +@click.option( + "--message", + "-m", + type=str, + help="Description of the change.", +) @click.option( "--to-config", type=bool, @@ -44,6 +50,7 @@ def edit( collections: Collections, database_dsn: str, hosts: Optional[Iterable[str]], + message: Optional[str], to_config: Optional[bool], to_restart: Optional[bool], validate: bool, @@ -81,6 +88,7 @@ def edit( source=SCHStatusLogSourceEnum.MANUAL, to_config=to_config, to_restart=to_restart, + message=message, ) ) diff --git a/tdp/core/models/sch_status_log.py b/tdp/core/models/sch_status_log.py index a066a0ee..2c950181 100644 --- a/tdp/core/models/sch_status_log.py +++ b/tdp/core/models/sch_status_log.py @@ -67,6 +67,9 @@ class SCHStatusLog(Base): ForeignKey("deployment_log.id"), doc="Related deployment log id (if applicable).", ) + message: Mapped[Optional[str]] = mapped_column( + doc="Description of the change when manually edited.", + ) def _formater(self, key: str, value: Any): """Format a value for printing."""