Skip to content

dataconnect.py: add "X-Firebase-Sqlconnect-Affinity" header for GSLB soft stickiness - #972

Merged
dconeybe merged 1 commit into
winefrom
dconeybe/dataconnect/GslbStickiness
Aug 1, 2026
Merged

dataconnect.py: add "X-Firebase-Sqlconnect-Affinity" header for GSLB soft stickiness#972
dconeybe merged 1 commit into
winefrom
dconeybe/dataconnect/GslbStickiness

Conversation

@dconeybe

@dconeybe dconeybe commented Jul 31, 2026

Copy link
Copy Markdown

This PR adds the X-Firebase-Sqlconnect-Affinity HTTP request header to outgoing Data Connect HTTP requests. This header enables backend server affinity routing for SQL Connect to improve server resource usage efficiency and performance.

Highlights

  • SQL Connect Server Affinity Header: Added the X-Firebase-Sqlconnect-Affinity header containing f"{self._project_id}{self._connector_config.service_id}" to Data Connect API client requests.
  • Unit Test Coverage: Updated test_get_headers() in test_data_connect.py to verify the header key and formatted value.
Changelog
  • dataconnect.py
    • Added X-Firebase-Sqlconnect-Affinity header (f"{self._project_id}{self._connector_config.service_id}") in _DataConnectApiClient._get_headers().
  • test_data_connect.py
    • Added assertion for X-Firebase-Sqlconnect-Affinity header in test_get_headers().

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds the 'X-Firebase-Sqlconnect-Affinity' header to the Data Connect client requests and updates the corresponding tests. The feedback suggests removing redundant parentheses around the new header's f-string value to maintain style consistency and improve readability.

Comment thread firebase_admin/dataconnect.py
@dconeybe
dconeybe requested review from mk2023 and stephenarosaj July 31, 2026 14:31

@mk2023 mk2023 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@stephenarosaj stephenarosaj left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

@dconeybe
dconeybe merged commit b9d2733 into wine Aug 1, 2026
15 checks passed
@dconeybe
dconeybe deleted the dconeybe/dataconnect/GslbStickiness branch August 1, 2026 03:10
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.

3 participants