Msg is mandatory field for the request

This commit is contained in:
Nikolay Telepenin
2023-09-04 15:49:30 +01:00
parent 7584ec84ce
commit 53ce609266
2 changed files with 3 additions and 3 deletions

View File

@ -350,7 +350,7 @@ class GerritProvider(GitProvider):
msg.append(f'* {description}\n{full_path}')
if msg:
add_comment(self.parsed_url, self.refspec, "---\n".join(msg))
add_comment(self.parsed_url, self.refspec, "\n".join(msg))
return True
def publish_comment(self, pr_comment: str, is_temporary: bool = False):

View File

@ -30,7 +30,7 @@ class Action(str, Enum):
class Item(BaseModel):
refspec: str
project: str
msg: str = ""
msg: str
@router.post("/api/v1/gerrit/{action}")
@ -46,7 +46,7 @@ async def handle_gerrit_request(action: Action, item: Item):
)
await PRAgent().handle_request(
f"{item.project}:{item.refspec}",
f"/{action.value} {item.msg.strip()}"
f"/{item.msg.strip()}"
)