diff --git a/bioimageio_collection_backoffice/db_structure/version_info.py b/bioimageio_collection_backoffice/db_structure/version_info.py index 3862786..7160ec6 100644 --- a/bioimageio_collection_backoffice/db_structure/version_info.py +++ b/bioimageio_collection_backoffice/db_structure/version_info.py @@ -20,6 +20,7 @@ class _StatusBase(Node, frozen=True): timestamp: datetime = pydantic.Field(default_factory=datetime.now) run_url: Optional[str] = settings.run_url + icon: str = "๐Ÿ›ˆ" class _DraftStatusBase(_StatusBase, frozen=True): @@ -35,31 +36,36 @@ def _validate_num_steps(self): class UnpackingStatus(_DraftStatusBase, frozen=True): name: Literal["unpacking"] = "unpacking" step: Literal[1] = 1 + icon: str = "๐Ÿ“ฆ" class UnpackedStatus(_DraftStatusBase, frozen=True): name: Literal["unpacked"] = "unpacked" description: str = "staging was successful; awaiting automated tests to start โณ" step: Literal[2] = 2 + icon: str = "โณ" class TestingStatus(_DraftStatusBase, frozen=True): name: Literal["testing"] = "testing" step: Literal[3] = 3 + icon: str = "๐Ÿงช" class AwaitingReviewStatus(_DraftStatusBase, frozen=True): name: Literal["awaiting review"] = "awaiting review" description: str = ( "Thank you for your contribution! ๐Ÿ’ช" - "Our bioimage.io maintainers will take a look soon. ๐Ÿฆ’" + "Our bioimage.io maintainers will take a look soon." ) step: Literal[4] = 4 + icon: str = "๐Ÿง" class ChangesRequestedStatus(_DraftStatusBase, frozen=True): name: Literal["changes requested"] = "changes requested" step: Literal[5] = 5 + icon: str = "๐Ÿ”ง" class AcceptedStatus(_DraftStatusBase, frozen=True): @@ -68,6 +74,7 @@ class AcceptedStatus(_DraftStatusBase, frozen=True): "This staged version has been accepted by a bioimage.io maintainer and is about to be published." ) step: Literal[5] = 5 + icon: str = "๐Ÿ‘" class PublishedDraftStatus(_DraftStatusBase, frozen=True): @@ -76,6 +83,7 @@ class PublishedDraftStatus(_DraftStatusBase, frozen=True): name: Literal["published"] = "published" description: str = "published! (this draft will be deleted shortly)" step: Literal[6] = 6 + icon: str = "๐ŸŽ‰" DraftStatus = Annotated[ @@ -98,6 +106,7 @@ class ErrorStatus(_StatusBase, frozen=True): message: str traceback: List[str] during: Optional[DraftStatus] + icon: str = "๐Ÿ”ด" class DraftInfo(Node, frozen=True): diff --git a/bioimageio_collection_backoffice/remote_collection.py b/bioimageio_collection_backoffice/remote_collection.py index 7378c5e..7907610 100644 --- a/bioimageio_collection_backoffice/remote_collection.py +++ b/bioimageio_collection_backoffice/remote_collection.py @@ -867,18 +867,17 @@ def request_changes(self, reviewer: str, reason: str): # map reviewer id to name for r in self.collection.config.reviewers: if reviewer == r.id: - reviewer = r.name break + else: + raise ValueError(reviewer) - self._set_status(ChangesRequestedStatus(description=reason)) + description = ( + f' {r.name} requested changes: {reason}' + ) + plain_description = f"{r.name} requested changes: {reason}" + self._set_status(ChangesRequestedStatus(description=description)) self.extend_chat( - Chat( - messages=[ - Message( - author="system", text=f"{reviewer} requested changes: {reason}" - ) - ] - ) + Chat(messages=[Message(author="system", text=plain_description)]) ) @log