continue tracing impl
This commit is contained in:
1 parent
39c2afa0a7
commit
efb35d5a8a
7 files changed
+40
-12
No files matched your search
+6
-4
@@ -2,11 +2,9 @@ use std::time::Duration;
|
||||
|
||||
use serde::Deserialize;
|
||||
use serde_json::{Value, json};
|
||||
use tracing::instrument;
|
||||
|
||||
use crate::{
|
||||
bot::{ReviewItem, ReviewResult},
|
||||
errors::AppError,
|
||||
};
|
||||
use crate::{bot::ReviewResult, errors::AppError};
|
||||
|
||||
pub struct GiteaAPI {
|
||||
base_url: String,
|
||||
@@ -30,6 +28,7 @@ impl GiteaAPI {
|
||||
})
|
||||
}
|
||||
|
||||
#[instrument(skip(self), err)]
|
||||
pub async fn comment(
|
||||
&self,
|
||||
body: &str,
|
||||
@@ -57,6 +56,7 @@ impl GiteaAPI {
|
||||
res.json::<Comment>().await.map_err(anyhow::Error::from)
|
||||
}
|
||||
|
||||
#[instrument(skip(self), err)]
|
||||
pub async fn edit_comment(
|
||||
&self,
|
||||
body: &str,
|
||||
@@ -84,6 +84,7 @@ impl GiteaAPI {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[instrument(skip(self), err)]
|
||||
pub async fn delete_comment(&self, full_name: &str, comment_id: u64) -> anyhow::Result<()> {
|
||||
let url = format!(
|
||||
"{}/api/v1/repos/{}/issues/comments/{}",
|
||||
@@ -102,6 +103,7 @@ impl GiteaAPI {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[instrument(skip(self, review_result), err)]
|
||||
pub async fn post_pull_request_review(
|
||||
&self,
|
||||
review_result: &ReviewResult,
|
||||
|
||||
Reference in new issue
Block a user