From 418a3af6487a08c8fcafb23769b5949441c8fa67 Mon Sep 17 00:00:00 2001 From: Agustin Isasmendi Date: Mon, 22 Jun 2026 09:55:48 +0000 Subject: [PATCH] feat(rest): register /health liveness endpoint via go-grpc-helper Bumps go-grpc-helper to v0.16.0 and registers GET /health on the gateway mux. SP-4474. --- CHANGELOG.md | 7 +++++++ go.mod | 2 +- go.sum | 4 ++-- pkg/protocol/rest/server.go | 4 ++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4add09..447e199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.0] - 2026-06-22 +### Added +- `/health` liveness endpoint (GET) on the REST gateway +### Changed +- Upgraded `scanoss/go-grpc-helper` to `v0.16.0` + ## [0.10.0] - 2026-04-30 ### Added - Enhanced component search to recover missing components @@ -53,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated project dependencies to latest versions +[0.11.0]: https://github.com/scanoss/components/compare/v0.10.0...v0.11.0 [0.10.0]: https://github.com/scanoss/components/compare/v0.9.0...v0.10.0 [0.9.0]: https://github.com/scanoss/components/compare/v0.8.0...v0.9.0 [0.8.0]: https://github.com/scanoss/components/compare/v0.7.0...v0.8.0 diff --git a/go.mod b/go.mod index 13b691f..f52ebdc 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/jmoiron/sqlx v1.4.0 github.com/lib/pq v1.12.3 github.com/scanoss/go-component-helper v0.7.0 - github.com/scanoss/go-grpc-helper v0.15.1 + github.com/scanoss/go-grpc-helper v0.16.0 github.com/scanoss/go-models v0.10.0 github.com/scanoss/go-purl-helper v0.3.0 github.com/scanoss/papi v0.42.0 diff --git a/go.sum b/go.sum index 13391e7..781d5fe 100644 --- a/go.sum +++ b/go.sum @@ -626,8 +626,8 @@ github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0t github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/scanoss/go-component-helper v0.7.0 h1:NB0gJdzYQ8kg/UEifAkVnXzdrVT1IaoyipRaYopdsj0= github.com/scanoss/go-component-helper v0.7.0/go.mod h1:rvdEl0tRWndm7LeaN1m7iD4QoIryI70fIfzdS+EHylY= -github.com/scanoss/go-grpc-helper v0.15.1 h1:tiI7JXVj2LYpktkYVqCcUd6XyMi6aVcAKRecNR5QGCA= -github.com/scanoss/go-grpc-helper v0.15.1/go.mod h1:UjrF9hewgZxstUC3+F0PJnuOXH0bChmsbcJp7e7OsH4= +github.com/scanoss/go-grpc-helper v0.16.0 h1:RwFY2iZQ9JQWR0kewBviF1MevfpCBdkijoh+KaYRuEI= +github.com/scanoss/go-grpc-helper v0.16.0/go.mod h1:UjrF9hewgZxstUC3+F0PJnuOXH0bChmsbcJp7e7OsH4= github.com/scanoss/go-models v0.10.0 h1:x+9XirwTpbLQBj3X9J+D8Lauu0oYB9bxjLafkEMpFtI= github.com/scanoss/go-models v0.10.0/go.mod h1:vRSlL4kxtprSwTIAARXVcVZ820tCQfkx6yn6038oY6A= github.com/scanoss/go-purl-helper v0.3.0 h1:zH5rcYbmYTvKms2oWrYV+8rWZ2ElLgDIOy2jZ9XhAg0= diff --git a/pkg/protocol/rest/server.go b/pkg/protocol/rest/server.go index d331d13..032d0e6 100644 --- a/pkg/protocol/rest/server.go +++ b/pkg/protocol/rest/server.go @@ -38,6 +38,10 @@ func RunServer(config *myconfig.ServerConfig, ctx context.Context, grpcPort, htt if err != nil { return nil, err } + // register the liveness /health endpoint on the gateway mux + if err = gw.RegisterHealthEndpoint(mux); err != nil { + return nil, err + } // Open TCP port (in the background) and listen for requests go func() { ctx2, cancel := context.WithCancel(ctx)