From 6a2a0c32b37d2d4fc70e87fa322af247c5358236 Mon Sep 17 00:00:00 2001 From: Steve Kirkland Date: Thu, 18 Dec 2025 10:16:24 +0000 Subject: [PATCH] Amend secondary instance URL to bugsnag.smartbear.com --- CHANGELOG.md | 2 ++ bugsnag/configuration.py | 16 ++++++++-------- bugsnag/delivery.py | 8 ++++---- tests/test_configuration.py | 8 ++++---- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3495a5ba..2c96f5b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ Changelog [#394](https://github.com/bugsnag/bugsnag-python/pull/394). * Set default endpoints based on API key [#399](https://github.com/bugsnag/bugsnag-php/pull/399) +* Amend secondary instance URL to bugsnag.smartbear.com + [#400](https://github.com/bugsnag/bugsnag-php/pull/399) ## v4.7.1 (2024-05-22) diff --git a/bugsnag/configuration.py b/bugsnag/configuration.py index 20125937..954e564e 100644 --- a/bugsnag/configuration.py +++ b/bugsnag/configuration.py @@ -33,8 +33,8 @@ from bugsnag.delivery import (create_default_delivery, DEFAULT_ENDPOINT, DEFAULT_SESSIONS_ENDPOINT, - HUB_ENDPOINT, - HUB_SESSIONS_ENDPOINT) + SECONDARY_ENDPOINT, + SECONDARY_SESSIONS_ENDPOINT) from bugsnag.uwsgi import warn_if_running_uwsgi_without_threads from bugsnag.error import Error @@ -58,9 +58,9 @@ _sentinel = object() -def _is_hub_api_key(api_key: str) -> bool: - hub_prefix = "00000" - return api_key is not None and api_key.startswith(hub_prefix) +def _is_secondary_api_key(api_key: str) -> bool: + secondary_prefix = "00000" + return api_key is not None and api_key.startswith(secondary_prefix) class Configuration: @@ -599,9 +599,9 @@ def _initialize_endpoints(self, endpoint, session_endpoint, api_key): self.endpoint is None and self.session_endpoint is None ): - if _is_hub_api_key(api_key): - self.endpoint = HUB_ENDPOINT - self.session_endpoint = HUB_SESSIONS_ENDPOINT + if _is_secondary_api_key(api_key): + self.endpoint = SECONDARY_ENDPOINT + self.session_endpoint = SECONDARY_SESSIONS_ENDPOINT else: self.endpoint = DEFAULT_ENDPOINT self.session_endpoint = DEFAULT_SESSIONS_ENDPOINT diff --git a/bugsnag/delivery.py b/bugsnag/delivery.py index 1a8f03cb..758542d8 100644 --- a/bugsnag/delivery.py +++ b/bugsnag/delivery.py @@ -28,8 +28,8 @@ DEFAULT_ENDPOINT = 'https://notify.bugsnag.com' DEFAULT_SESSIONS_ENDPOINT = 'https://sessions.bugsnag.com' -HUB_ENDPOINT = 'https://notify.insighthub.smartbear.com' -HUB_SESSIONS_ENDPOINT = 'https://sessions.insighthub.smartbear.com' +SECONDARY_ENDPOINT = 'https://notify.bugsnag.smartbear.com' +SECONDARY_SESSIONS_ENDPOINT = 'https://sessions.bugsnag.smartbear.com' __all__ = ('default_headers', 'Delivery') @@ -86,8 +86,8 @@ def deliver_sessions(self, config, payload: Any, options=None): """ if ((config.endpoint != DEFAULT_ENDPOINT and config.session_endpoint == DEFAULT_SESSIONS_ENDPOINT) or - (config.endpoint != HUB_ENDPOINT and - config.session_endpoint == HUB_SESSIONS_ENDPOINT)): + (config.endpoint != SECONDARY_ENDPOINT and + config.session_endpoint == SECONDARY_SESSIONS_ENDPOINT)): if not self.sent_session_warning: warnings.warn('The session endpoint has not been configured. ' 'No sessions will be sent to Bugsnag.') diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 57dfe03e..47103b1d 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -119,10 +119,10 @@ def test_validate_endpoint_bugsnag_api_key(self): c.configure(api_key='12312312312312312312312312321312') assert c.endpoint == 'https://notify.bugsnag.com' - def test_validate_endpoint_hub_api_key(self): + def test_validate_endpoint_secondary_api_key(self): c = Configuration() c.configure(api_key='00000312312312312312312312321312') - assert c.endpoint == 'https://notify.insighthub.smartbear.com' + assert c.endpoint == 'https://notify.bugsnag.smartbear.com' def test_validate_app_type(self): c = Configuration() @@ -425,11 +425,11 @@ def test_validate_session_endpoint_bugsnag_api_key(self): c.configure(api_key='12312312312312312312312312321312') assert c.session_endpoint == 'https://sessions.bugsnag.com' - def test_validate_session_endpoint_hub_api_key(self): + def test_validate_session_endpoint_secondary_api_key(self): c = Configuration() c.configure(api_key='00000312312312312312312312321312') assert (c.session_endpoint == - 'https://sessions.insighthub.smartbear.com') + 'https://sessions.bugsnag.smartbear.com') def test_validate_traceback_exclude_modules(self): c = Configuration()