mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-06 22:00:40 +08:00
Msg is mandatory field for the request
This commit is contained in:
@ -350,7 +350,7 @@ class GerritProvider(GitProvider):
|
|||||||
msg.append(f'* {description}\n{full_path}')
|
msg.append(f'* {description}\n{full_path}')
|
||||||
|
|
||||||
if msg:
|
if msg:
|
||||||
add_comment(self.parsed_url, self.refspec, "---\n".join(msg))
|
add_comment(self.parsed_url, self.refspec, "\n".join(msg))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def publish_comment(self, pr_comment: str, is_temporary: bool = False):
|
def publish_comment(self, pr_comment: str, is_temporary: bool = False):
|
||||||
|
@ -30,7 +30,7 @@ class Action(str, Enum):
|
|||||||
class Item(BaseModel):
|
class Item(BaseModel):
|
||||||
refspec: str
|
refspec: str
|
||||||
project: str
|
project: str
|
||||||
msg: str = ""
|
msg: str
|
||||||
|
|
||||||
|
|
||||||
@router.post("/api/v1/gerrit/{action}")
|
@router.post("/api/v1/gerrit/{action}")
|
||||||
@ -46,7 +46,7 @@ async def handle_gerrit_request(action: Action, item: Item):
|
|||||||
)
|
)
|
||||||
await PRAgent().handle_request(
|
await PRAgent().handle_request(
|
||||||
f"{item.project}:{item.refspec}",
|
f"{item.project}:{item.refspec}",
|
||||||
f"/{action.value} {item.msg.strip()}"
|
f"/{item.msg.strip()}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user