fix: remove issue ref from comment, use forge::FORGE_HTTP in knowledge.rs
This commit is contained in:
parent
bc0087830f
commit
5fdc3ffdbf
3 changed files with 4 additions and 5 deletions
|
|
@ -14,7 +14,7 @@ use tokio::process::Command;
|
|||
use crate::coordinator::Coordinator;
|
||||
|
||||
const FORGE_CONTAINER: &str = "hive-forge";
|
||||
const FORGE_HTTP: &str = "http://localhost:3000";
|
||||
pub(crate) const FORGE_HTTP: &str = "http://localhost:3000";
|
||||
const TOKEN_NAME_PREFIX: &str = "hyperhive";
|
||||
/// Where the host-side `core` admin token lives. Used by hive-c0re
|
||||
/// itself to push the meta repo + drive admin API calls (org
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ async fn cmd_serve(
|
|||
let mut knowledge_shutdown = coord.shutdown_rx();
|
||||
tokio::spawn(async move {
|
||||
// Initial pull — reconcile any commits that landed while c0re
|
||||
// was offline, including the push that triggered #1244.
|
||||
// was offline.
|
||||
if let Err(e) = knowledge::pull().await {
|
||||
tracing::debug!(error = ?e, "knowledge: startup pull skipped (no clone yet?)");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue