diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ea25b0..e1b9281 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [0.15.10] — 2026-06-04 + +### Fixed +- **Broken dashboard URL in `GET /` discovery payload** (`app/main.py`): the dashboard field hard-coded `https://forge.gittensor.io` — a domain that does not resolve (NXDOMAIN). Any agent following the discovery payload to find the human UI hit a dead link. Replaced with `os.environ.get("FORGE_DASHBOARD_URL", "http://143.244.191.193:8080")` — defaults to the live deploy IP, env var overrides once DNS is set up. Same env-driven pattern as `SPECS_DIR`, `DB_PATH`, `S3_BUCKET`. + +### Tests +- `test_root_discovery` asserts `dashboard` starts with `http` and is not the broken NXDOMAIN URL. +- New `test_root_discovery_dashboard_env_override` covers the `FORGE_DASHBOARD_URL` override path. Test count: 139 → 140. + +--- + ## [0.15.9] — 2026-06-04 ### Changed diff --git a/app/main.py b/app/main.py index db9174f..f7d4e5f 100644 --- a/app/main.py +++ b/app/main.py @@ -1,5 +1,6 @@ """Forge API — source of truth for specs, submissions, leaderboard, and SOTA.""" +import os from contextlib import asynccontextmanager from fastapi import FastAPI @@ -20,7 +21,7 @@ async def lifespan(app: FastAPI): app = FastAPI( title="Forge API", description="Competitive parametric CAD benchmark — specs, submissions, leaderboard, SOTA.", - version="0.15.9", + version="0.15.10", lifespan=lifespan, ) @@ -102,7 +103,7 @@ async def root(): "redoc": "/redoc", "openapi": "/openapi.json", }, - "dashboard": "https://forge.gittensor.io", + "dashboard": os.environ.get("FORGE_DASHBOARD_URL", "http://143.244.191.193:8080"), "repo": "https://github.com/PunchTheDev/forge", "endpoints": { "active_rounds": "/rounds/active", diff --git a/tests/test_health.py b/tests/test_health.py index 8f0f594..5c4dcb5 100644 --- a/tests/test_health.py +++ b/tests/test_health.py @@ -161,3 +161,14 @@ def test_root_discovery(client): assert "canonical" in body["agent_submission"] assert "pull request" in body["agent_submission"]["canonical"].lower() assert "direct_post" in body["agent_submission"] + # Dashboard URL must be reachable — default points at live deploy, env var overrides. + assert body["dashboard"].startswith("http") + assert "forge.gittensor.io" not in body["dashboard"] + + +def test_root_discovery_dashboard_env_override(client, monkeypatch): + """FORGE_DASHBOARD_URL env var overrides the default dashboard URL.""" + monkeypatch.setenv("FORGE_DASHBOARD_URL", "https://example.test/dashboard") + r = client.get("/") + assert r.status_code == 200 + assert r.json()["dashboard"] == "https://example.test/dashboard"