fix: remove issue ref from comment, use forge::FORGE_HTTP in knowledge.rs

This commit is contained in:
damocles 2026-06-04 11:40:45 +02:00
commit 5fdc3ffdbf
3 changed files with 4 additions and 5 deletions

View file

@ -145,7 +145,6 @@ async fn seed_readme(core_token: &str) -> Result<()> {
/// Called at startup alongside [`ensure_local_clone`]. No-op when the
/// core token is absent (forge not yet provisioned).
pub async fn ensure_webhook(core_token: &str, dashboard_port: u16) -> Result<()> {
const FORGE_HTTP: &str = "http://localhost:3000";
let target_url = format!("http://127.0.0.1:{dashboard_port}/webhook/knowledge");
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(10))
@ -153,7 +152,7 @@ pub async fn ensure_webhook(core_token: &str, dashboard_port: u16) -> Result<()>
.context("build reqwest client for webhook setup")?;
// List existing hooks — skip creation if ours is already there.
let list_url = format!("{FORGE_HTTP}/api/v1/repos/{ORG}/{REPO}/hooks");
let list_url = format!("{}/api/v1/repos/{ORG}/{REPO}/hooks", crate::forge::FORGE_HTTP);
let resp = client
.get(&list_url)
.header("Authorization", format!("token {core_token}"))
@ -175,7 +174,7 @@ pub async fn ensure_webhook(core_token: &str, dashboard_port: u16) -> Result<()>
}
// Create the webhook.
let create_url = format!("{FORGE_HTTP}/api/v1/repos/{ORG}/{REPO}/hooks");
let create_url = format!("{}/api/v1/repos/{ORG}/{REPO}/hooks", crate::forge::FORGE_HTTP);
let body = serde_json::json!({
"type": "forgejo",
"config": {