diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f68649..c7e4940 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: MIX_ENV: test GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/examples/gunicorn/gunicorn_conf.py b/examples/gunicorn/gunicorn_conf.py index 7312c2e..35fe79e 100644 --- a/examples/gunicorn/gunicorn_conf.py +++ b/examples/gunicorn/gunicorn_conf.py @@ -1,22 +1,22 @@ import logging -import prefab_cloud_python -from prefab_cloud_python import Options +import sdk_reforge +from sdk_reforge import Options def on_starting(server): logging.warning("Starting server") - prefab_cloud_python.set_options(Options(collect_sync_interval=5)) + sdk_reforge.set_options(Options(collect_sync_interval=5)) logging.warning( - f"current value of 'foobar' is {prefab_cloud_python.get_client().get('foobar')}" + f"current value of 'foobar' is {sdk_reforge.get_client().get('foobar')}" ) def post_worker_init(worker): # Initialize the client for each worker - prefab_cloud_python.reset_instance() + sdk_reforge.reset_instance() def on_exit(server): - logging.warning("shutting down prefab") - prefab_cloud_python.reset_instance() + logging.warning("shutting down reforge") + sdk_reforge.reset_instance() diff --git a/examples/gunicorn/test_app.py b/examples/gunicorn/test_app.py index 60f4df6..8b7e52e 100644 --- a/examples/gunicorn/test_app.py +++ b/examples/gunicorn/test_app.py @@ -1,8 +1,8 @@ -import prefab_cloud_python +import sdk_reforge def app(environ, start_response): - output = f"value of 'test.config' is {prefab_cloud_python.get_client().config_client().get('test.config')}".encode() + output = f"value of 'test.config' is {sdk_reforge.get_client().config_client().get('test.config')}".encode() start_response( "200 OK", [("Content-Type", "text/plain"), ("Content-Length", str(len(output)))] ) diff --git a/tests/test_sse_connection_manager.py b/tests/test_sse_connection_manager.py index fe8a9e8..1c74a44 100644 --- a/tests/test_sse_connection_manager.py +++ b/tests/test_sse_connection_manager.py @@ -54,8 +54,8 @@ def test_backoff_on_failed_response(self, mock_sleep): mock_sleep.assert_has_calls(expected_calls, any_order=False) self.api_client.resilient_request.assert_called_with( - "/api/v1/sse/config", - headers={"x-prefab-start-at-id": "123", "accept": "text/event-stream"}, + "/api/v2/sse/config", + headers={"Last-Event-ID": "123", "accept": "text/event-stream"}, stream=True, auth=("authuser", "test_api_key"), timeout=(5, 60), @@ -110,8 +110,8 @@ def test_backoff_on_too_quick_connection(self, mock_sleep, mock_timing): mock_sleep.assert_has_calls(expected_calls, any_order=False) self.api_client.resilient_request.assert_called_with( - "/api/v1/sse/config", - headers={"x-prefab-start-at-id": "123", "accept": "text/event-stream"}, + "/api/v2/sse/config", + headers={"Last-Event-ID": "123", "accept": "text/event-stream"}, stream=True, auth=("authuser", "test_api_key"), timeout=(5, 60), @@ -149,8 +149,8 @@ def test_backoff_on_general_exception(self, mock_sleep): mock_sleep.assert_has_calls(expected_calls, any_order=False) self.api_client.resilient_request.assert_called_with( - "/api/v1/sse/config", - headers={"x-prefab-start-at-id": "123", "accept": "text/event-stream"}, + "/api/v2/sse/config", + headers={"Last-Event-ID": "123", "accept": "text/event-stream"}, stream=True, auth=("authuser", "test_api_key"), timeout=(5, 60), @@ -202,8 +202,8 @@ def test_backoff_reset_on_successful_connection(self, mock_sleep, mock_timing): mock_sleep.assert_has_calls(expected_calls, any_order=False) self.api_client.resilient_request.assert_called_with( - "/api/v1/sse/config", - headers={"x-prefab-start-at-id": "123", "accept": "text/event-stream"}, + "/api/v2/sse/config", + headers={"Last-Event-ID": "123", "accept": "text/event-stream"}, stream=True, auth=("authuser", "test_api_key"), timeout=(5, 60),