Skip to content

Commit

Permalink
feat: user can add a message when overriding status
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulFarault committed Oct 24, 2023
1 parent 9d873e3 commit 384920c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tdp/cli/commands/status/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -81,6 +88,7 @@ def edit(
source=SCHStatusLogSourceEnum.MANUAL,
to_config=to_config,
to_restart=to_restart,
message=message,
)
)

Expand Down
3 changes: 3 additions & 0 deletions tdp/core/models/sch_status_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit 384920c

Please sign in to comment.