fix: repr WoodpeckerEvent

This commit is contained in:
Piotr Dec 2026-04-14 03:19:07 +02:00
parent 9a8bc44e09
commit 7fa243a8d4
Signed by: stawros
GPG key ID: 74B18A3F0F1E99C0
2 changed files with 5 additions and 2 deletions

View file

@ -26,7 +26,7 @@ class ReloadService:
logger.info(f"Received ReloadEvent: {event.service}") logger.info(f"Received ReloadEvent: {event.service}")
head = self._git.get_head() head = self._git.get_head()
mos = Path(f"files/{event.service}").glob('*.mo.*') mos = Path(f"files/{event.service}").glob('*.mo.*')
event = WoodpeckerEvent( we = WoodpeckerEvent(
_id=-1, _id=-1,
commit=head.sha, commit=head.sha,
ref=head.branch, ref=head.branch,
@ -34,5 +34,5 @@ class ReloadService:
started=int(datetime.now().timestamp()), started=int(datetime.now().timestamp()),
files=[f"compose/{event.service}/docker-compose.yml"] + [str(pp) for pp in list(mos)] files=[f"compose/{event.service}/docker-compose.yml"] + [str(pp) for pp in list(mos)]
) )
logger.trace(f"Sending WoodpeckerEvent: {event}") logger.trace(f"Sending WoodpeckerEvent: {we}")
await self._bus.dispatch(event) await self._bus.dispatch(event)

View file

@ -11,5 +11,8 @@ class WoodpeckerEvent(BaseEvent):
started: int started: int
files: List[str] files: List[str]
def __repr__(self):
return f"<WoodpeckerEvent _id={self._id} commit={self.commit} ref={self.ref} message={self.message} started={self.started} files={self.files}>"
class ReloadEvent(BaseEvent): class ReloadEvent(BaseEvent):
service: str service: str