Fix missing env var error #5
@@ -16,3 +16,4 @@ GITEA_TIMEOUT=30
|
||||
# Optional
|
||||
SENTRY_DSN=
|
||||
RUST_LOG=info
|
||||
RUST_BACKTRACE=1
|
||||
|
||||
+5
-2
@@ -3,6 +3,9 @@ name = "herald"
|
||||
version = "1.0.1"
|
||||
edition = "2024"
|
||||
|
||||
[profile.release]
|
||||
debug = 1
|
||||
|
qpismont marked this conversation as resolved
|
||||
|
||||
[dependencies]
|
||||
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
|
||||
tokio = { version = "1.52", features = ["full"] }
|
||||
@@ -12,7 +15,7 @@ futures-util = "0.3"
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
sentry = { version = "0.48", features = ["tower-axum-matched-path"] }
|
||||
sentry-anyhow = "0.48"
|
||||
sentry-anyhow = { version = "0.48", features = ["backtrace"] }
|
||||
openrouter-rs = "0.10"
|
||||
dotenvy = "0.15"
|
||||
tower = "0.5"
|
||||
@@ -20,7 +23,7 @@ tower-http = {version = "0.6", features = ["trace"] }
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3", features=["env-filter"] }
|
||||
axum = "0.8"
|
||||
anyhow = "1.0"
|
||||
anyhow = { version = "1.0", features = ["backtrace"] }
|
||||
thiserror = "2.0"
|
||||
hmac = "0.13"
|
||||
sha2 = "0.11"
|
||||
|
||||
+7
-2
@@ -97,9 +97,14 @@ impl Bot {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[instrument(skip(self))]
|
||||
#[instrument(skip(self), fields(repo, pr))]
|
||||
pub async fn exec(&self, webhook: WebhookType) {
|
||||
tracing::Span::current().record("webhook_type", tracing::field::debug(&webhook));
|
||||
match &webhook {
|
||||
WebhookType::Review(p) => {
|
||||
tracing::Span::current().record("repo", &p.repository.full_name);
|
||||
tracing::Span::current().record("pr", p.pull_request.number);
|
||||
}
|
||||
}
|
||||
let exec_result = match webhook {
|
||||
WebhookType::Review(review_payload) => crate::bot_actions::review::exec_review(
|
||||
&self.gitea_api,
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::{
|
||||
open_router::OpenRouterClient,
|
||||
};
|
||||
|
||||
#[instrument(skip(gitea_api, open_router_client, http_client, review_payload), err)]
|
||||
#[instrument(skip(gitea_api, open_router_client, http_client, review_payload))]
|
||||
pub async fn exec_review(
|
||||
gitea_api: &GiteaAPI,
|
||||
open_router_client: &OpenRouterClient,
|
||||
|
||||
+4
-4
@@ -29,7 +29,7 @@ impl GiteaAPI {
|
||||
})
|
||||
}
|
||||
|
||||
#[instrument(skip(self), err)]
|
||||
#[instrument(skip(self))]
|
||||
pub async fn comment(
|
||||
&self,
|
||||
body: &str,
|
||||
@@ -57,7 +57,7 @@ impl GiteaAPI {
|
||||
res.json::<Comment>().await.map_err(anyhow::Error::from)
|
||||
}
|
||||
|
||||
#[instrument(skip(self), err)]
|
||||
#[instrument(skip(self))]
|
||||
pub async fn edit_comment(
|
||||
&self,
|
||||
body: &str,
|
||||
@@ -85,7 +85,7 @@ impl GiteaAPI {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[instrument(skip(self), err)]
|
||||
#[instrument(skip(self))]
|
||||
pub async fn delete_comment(&self, full_name: &str, comment_id: u64) -> anyhow::Result<()> {
|
||||
let url = format!(
|
||||
"{}/api/v1/repos/{}/issues/comments/{}",
|
||||
@@ -104,7 +104,7 @@ impl GiteaAPI {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[instrument(skip(self, review_result), err)]
|
||||
#[instrument(skip(self, review_result))]
|
||||
pub async fn post_pull_request_review(
|
||||
&self,
|
||||
review_result: &ReviewResult,
|
||||
|
||||
Reference in New Issue
Block a user
L'ajout d'informations de débogage (
debug = 1) dans le profilreleaseaugmente la taille du binaire. Si cela est nécessaire pour le diagnostic en production (par exemple pour les backtraces), c'est acceptable. Sinon, il serait préférable de ne l'activer que pour un profilrelease-with-debugdédié ou d'ajouter un commentaire expliquant la décision.