Starting impl Sentry and tracing
This commit is contained in:
1 parent
3984a7d3ba
commit
39c2afa0a7
10 files changed
+1456
-84
No files matched your search
+21
-2
@@ -84,9 +84,28 @@ impl GiteaAPI {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn delete_comment(&self, full_name: &str, comment_id: u64) -> anyhow::Result<()> {
|
||||
let url = format!(
|
||||
"{}/api/v1/repos/{}/issues/comments/{}",
|
||||
self.base_url, full_name, comment_id
|
||||
);
|
||||
|
||||
let res = self.client.delete(url).send().await?;
|
||||
|
||||
if !res.status().is_success() {
|
||||
return Err(anyhow::anyhow!(
|
||||
"Failed to delete comment: {}",
|
||||
res.status()
|
||||
));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn post_pull_request_review(
|
||||
&self,
|
||||
review_result: &ReviewResult,
|
||||
final_comment: &str,
|
||||
full_name: &str,
|
||||
index: u64,
|
||||
) -> anyhow::Result<()> {
|
||||
@@ -95,7 +114,7 @@ impl GiteaAPI {
|
||||
self.base_url, full_name, index
|
||||
);
|
||||
|
||||
let comments = &&review_result
|
||||
let comments = &review_result
|
||||
.reviews
|
||||
.iter()
|
||||
.filter(|r| r.line.is_some())
|
||||
@@ -117,7 +136,7 @@ impl GiteaAPI {
|
||||
.post(url)
|
||||
.json(&json!({
|
||||
"event": "COMMENT",
|
||||
"body": review_result.comment,
|
||||
"body": final_comment,
|
||||
"comments": comments
|
||||
}))
|
||||
.send()
|
||||
|
||||
Reference in new issue
Block a user