Skip to content

feat: check of server and client version in response header#1443

Open
shree-iyengar-dls wants to merge 7 commits intomainfrom
1074_include_bluapi_version_in_metadata
Open

feat: check of server and client version in response header#1443
shree-iyengar-dls wants to merge 7 commits intomainfrom
1074_include_bluapi_version_in_metadata

Conversation

@shree-iyengar-dls
Copy link
Contributor

Fixes #1074

Check of version headers in the response has been added to the client side.

@shree-iyengar-dls shree-iyengar-dls requested a review from a team as a code owner March 18, 2026 09:31
@shree-iyengar-dls shree-iyengar-dls changed the title 1074 include bluapi version in metadata feat: check of server and client version in response header Mar 18, 2026
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.20%. Comparing base (8e9ce20) to head (ee9cf9e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1443      +/-   ##
==========================================
+ Coverage   95.19%   95.20%   +0.01%     
==========================================
  Files          43       43              
  Lines        3119     3129      +10     
==========================================
+ Hits         2969     2979      +10     
  Misses        150      150              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@ZohebShaikh ZohebShaikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍🏼

from fastapi.testclient import TestClient

from blueapi.service.main import get_passthrough_headers, log_request_details
import blueapi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import blueapi
from blueapi import __version__

LOGGER.warning(
f"Server version is {Version(server_version).release} and "
f"client version is {Version(__version__).release}"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this as a draft.

It can be some thing like

"Version mismatch: server is , client is {Version(version).release}"

Suggested change
)
if (server_version := Version(server_version).release) != (client_version:= Version(__version__).release):
LOGGER.warning(
f"Version mismatch : Blueapi server version is {server_version}"
f" and client version is {client_version}.Some features may not work as expected."
)

Comment on lines 36 to +38

import blueapi
import blueapi.cli
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import blueapi
import blueapi.cli
from blueapi import __version__

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include blueapi version in metadata

2 participants