From 7cbb11cdf2213f86f032d15df6cdaccca2c5dfdd Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 20 Feb 2026 17:54:02 -0500 Subject: [PATCH 01/10] Added NameRes version to /status. --- api/server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/server.py b/api/server.py index 955193fc..3aba1e00 100755 --- a/api/server.py +++ b/api/server.py @@ -71,6 +71,11 @@ async def status() -> Dict: babel_version = os.environ.get("BABEL_VERSION", "unknown") babel_version_url = os.environ.get("BABEL_VERSION_URL", "") + # Figure out the NameRes version. + nameres_version = "unknown" + if 'version' in get_app_info(): + nameres_version = 'v' + get_app_info()['version'] + # We should have a status for name_lookup_shard1_replica_n1. if 'status' in result and 'name_lookup_shard1_replica_n1' in result['status']: core = result['status']['name_lookup_shard1_replica_n1'] @@ -84,6 +89,7 @@ async def status() -> Dict: 'message': 'Reporting results from primary core.', 'babel_version': babel_version, 'babel_version_url': babel_version_url, + 'nameres_version': nameres_version, 'startTime': core['startTime'], 'numDocs': index.get('numDocs', ''), 'maxDoc': index.get('maxDoc', ''), @@ -96,7 +102,8 @@ async def status() -> Dict: else: return { 'status': 'error', - 'message': 'Expected core not found.' + 'message': 'Expected core not found.', + 'nameres_version': nameres_version, } From 8d3c36c89a017d3c0edc95b87115ce482c554881 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 20 Feb 2026 17:59:50 -0500 Subject: [PATCH 02/10] Added BIOLINK_MODEL_TAG. --- api/server.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/api/server.py b/api/server.py index 3aba1e00..03050da7 100755 --- a/api/server.py +++ b/api/server.py @@ -71,10 +71,16 @@ async def status() -> Dict: babel_version = os.environ.get("BABEL_VERSION", "unknown") babel_version_url = os.environ.get("BABEL_VERSION_URL", "") + # Look up the BIOLINK_MODEL_TAG. + biolink_model_tag = os.environ.get("BIOLINK_MODEL_TAG", "master") # Note that this should be a tag from the Biolink Model repo, e.g. "master" or "v4.3.6". + biolink_model_url = f"https://github.com/biolink/biolink-model/tree/{biolink_model_tag}" + biolink_model_download_url = f"https://raw.githubusercontent.com/biolink/biolink-model/{biolink_model_tag}/biolink-model.yaml" + # Figure out the NameRes version. - nameres_version = "unknown" - if 'version' in get_app_info(): - nameres_version = 'v' + get_app_info()['version'] + nameres_version = "master" + app_info = get_app_info() + if 'version' in app_info and app_info['version']: + nameres_version = 'v' + app_info['version'] # We should have a status for name_lookup_shard1_replica_n1. if 'status' in result and 'name_lookup_shard1_replica_n1' in result['status']: @@ -89,6 +95,11 @@ async def status() -> Dict: 'message': 'Reporting results from primary core.', 'babel_version': babel_version, 'babel_version_url': babel_version_url, + 'biolink_model': { + 'tag': biolink_model_tag, + 'url': biolink_model_url, + 'download_url': biolink_model_download_url, + }, 'nameres_version': nameres_version, 'startTime': core['startTime'], 'numDocs': index.get('numDocs', ''), From a787e4d8f5bdf31aa0a9d38b51d13ba28f5e1c97 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 20 Feb 2026 18:17:41 -0500 Subject: [PATCH 03/10] Added basic tests for /status. --- tests/test_status.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/test_status.py diff --git a/tests/test_status.py b/tests/test_status.py new file mode 100644 index 00000000..9d037ac4 --- /dev/null +++ b/tests/test_status.py @@ -0,0 +1,27 @@ +import logging + +from api.server import app +from fastapi.testclient import TestClient + +# Turn on debugging for tests. +logging.basicConfig(level=logging.DEBUG) + +def test_status(): + client = TestClient(app) + response = client.get("/status") + status = response.json() + + assert status['status'] == 'ok' + assert status['message'] != '' + assert 'babel_version' in status + assert 'babel_version_url' in status + assert 'biolink_model' in status + assert 'tag' in status['biolink_model'] + assert 'nameres_version' in status + + assert status['startTime'] + assert status['numDocs'] == 32 + assert status['maxDocs'] == 32 + assert status['deletedDocs'] == 0 + assert status['version'].startswith('9.') + assert status['size'] != '' From 5c1bdd7f5fd795aaa85f200c9875f8d6f1c4b929 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 20 Feb 2026 18:20:26 -0500 Subject: [PATCH 04/10] Improved tests. --- tests/test_status.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/test_status.py b/tests/test_status.py index 9d037ac4..d6708933 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -18,10 +18,12 @@ def test_status(): assert 'biolink_model' in status assert 'tag' in status['biolink_model'] assert 'nameres_version' in status - - assert status['startTime'] - assert status['numDocs'] == 32 - assert status['maxDocs'] == 32 - assert status['deletedDocs'] == 0 assert status['version'].startswith('9.') assert status['size'] != '' + assert status['startTime'] + + # Count the specific number of test documents we load. + assert status['numDocs'] == 89 + assert status['maxDocs'] == 89 + assert status['deletedDocs'] == 0 + From 63c3b64ace25fdc53b370bc9c99c9ae842308c05 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 20 Feb 2026 18:25:03 -0500 Subject: [PATCH 05/10] Attempted to fix issues. --- tests/test_status.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_status.py b/tests/test_status.py index d6708933..47e78381 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -18,7 +18,7 @@ def test_status(): assert 'biolink_model' in status assert 'tag' in status['biolink_model'] assert 'nameres_version' in status - assert status['version'].startswith('9.') + assert status['version'] > 1 assert status['size'] != '' assert status['startTime'] From 6f43191cc90f5f4b86deef19fa7e7dcab700e7db Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 20 Feb 2026 18:32:45 -0500 Subject: [PATCH 06/10] Fixed key name. --- tests/test_status.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_status.py b/tests/test_status.py index 47e78381..b48ddc07 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -24,6 +24,6 @@ def test_status(): # Count the specific number of test documents we load. assert status['numDocs'] == 89 - assert status['maxDocs'] == 89 + assert status['maxDoc'] == 89 assert status['deletedDocs'] == 0 From 4a91fcbaccc931263dc70bb87932cae55be575d0 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 20 Feb 2026 18:35:47 -0500 Subject: [PATCH 07/10] Update api/server.py Error message should include variables we've already computed. Could be useful. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- api/server.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/server.py b/api/server.py index 03050da7..797eb784 100755 --- a/api/server.py +++ b/api/server.py @@ -114,6 +114,13 @@ async def status() -> Dict: return { 'status': 'error', 'message': 'Expected core not found.', + 'babel_version': babel_version, + 'babel_version_url': babel_version_url, + 'biolink_model': { + 'tag': biolink_model_tag, + 'url': biolink_model_url, + 'download_url': biolink_model_download_url, + }, 'nameres_version': nameres_version, } From 52af419d6e9ab7c9c7807aa0549ec0308c0d8e92 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 20 Feb 2026 18:36:04 -0500 Subject: [PATCH 08/10] Update api/server.py Improved comment. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- api/server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/server.py b/api/server.py index 797eb784..386fd5f1 100755 --- a/api/server.py +++ b/api/server.py @@ -72,7 +72,8 @@ async def status() -> Dict: babel_version_url = os.environ.get("BABEL_VERSION_URL", "") # Look up the BIOLINK_MODEL_TAG. - biolink_model_tag = os.environ.get("BIOLINK_MODEL_TAG", "master") # Note that this should be a tag from the Biolink Model repo, e.g. "master" or "v4.3.6". + # Note: this should be a tag from the Biolink Model repo, e.g. "master" or "v4.3.6". + biolink_model_tag = os.environ.get("BIOLINK_MODEL_TAG", "master") biolink_model_url = f"https://github.com/biolink/biolink-model/tree/{biolink_model_tag}" biolink_model_download_url = f"https://raw.githubusercontent.com/biolink/biolink-model/{biolink_model_tag}/biolink-model.yaml" From 47b5730f1814a884d985b12852138bc94e9d2a33 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 20 Feb 2026 18:39:40 -0500 Subject: [PATCH 09/10] Updated API documentation. --- documentation/API.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/documentation/API.md b/documentation/API.md index fc0703a3..5226d6d4 100644 --- a/documentation/API.md +++ b/documentation/API.md @@ -317,6 +317,12 @@ version and changelog URL, which can be used to determine which version of Babel "message": "Reporting results from primary core.", "babel_version": "2025sep1", "babel_version_url": "https://github.com/ncatstranslator/Babel/blob/master/releases/2025sep1.md", + "biolink_model": { + "tag": "v4.2.6-rc5", + "url": "https://github.com/biolink/biolink-model/tree/v4.2.6-rc5", + "download_url": "https://raw.githubusercontent.com/biolink/biolink-model/v4.2.6-rc5/biolink-model.yaml" + }, + "nameres_version": "v1.5.1", "startTime": "2025-12-19T11:53:09.638Z", "numDocs": 425583391, "maxDoc": 425586610, From c443d938fab91d9cd1cb50becb5ba6c43a394d8f Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 20 Feb 2026 18:40:51 -0500 Subject: [PATCH 10/10] Improved documentation. --- documentation/API.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/documentation/API.md b/documentation/API.md index 5226d6d4..57bcbdea 100644 --- a/documentation/API.md +++ b/documentation/API.md @@ -310,6 +310,9 @@ POST /synonyms with body: Returns the status of the service. Most importantly, this returns the [Babel](https://github.com/NCATSTranslator/Babel) version and changelog URL, which can be used to determine which version of Babel is currently loaded in this service. +It also includes the NameRes version (also visible in the OpenAPI documentation) +and the Biolink Model version used to build the Solr database, as well as bunch of information from the underlying +Solr database. ```json {