diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e0063b..df1c606 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ # Changelog +## [Unreleased] + +### Fixed +- Go and Raw registries missing from Prometheus metrics (`detect_registry` labeled both as "other") +- Go and Raw registries missing from `/health` endpoint `registries` object + ## [0.4.0] - 2026-04-05 ### Added diff --git a/nora-registry/src/health.rs b/nora-registry/src/health.rs index 2adeba6..da53646 100644 --- a/nora-registry/src/health.rs +++ b/nora-registry/src/health.rs @@ -31,6 +31,8 @@ pub struct RegistriesHealth { pub npm: String, pub cargo: String, pub pypi: String, + pub go: String, + pub raw: String, } pub fn routes() -> Router> { @@ -70,6 +72,8 @@ async fn health_check(State(state): State>) -> (StatusCode, Json String { "cargo".to_string() } else if path.starts_with("/simple") || path.starts_with("/packages") { "pypi".to_string() + } else if path.starts_with("/go/") { + "go".to_string() + } else if path.starts_with("/raw/") { + "raw".to_string() } else if path.starts_with("/ui") { "ui".to_string() } else { @@ -205,8 +209,19 @@ mod tests { fn test_detect_registry_go_path() { assert_eq!( detect_registry("/go/github.com/user/repo/@v/v1.0.0.info"), - "other" + "go" ); + assert_eq!(detect_registry("/go/github.com/user/repo/@latest"), "go"); + // Bare prefix without trailing slash should not match + assert_eq!(detect_registry("/goblin/something"), "other"); + } + + #[test] + fn test_detect_registry_raw_path() { + assert_eq!(detect_registry("/raw/my-project/artifact.tar.gz"), "raw"); + assert_eq!(detect_registry("/raw/data/file.bin"), "raw"); + // Bare prefix without trailing slash should not match + assert_eq!(detect_registry("/rawdata/file"), "other"); } #[test]