Skip to content

Commit

Permalink
Merge branch 'main' into upgrade_pydantic
Browse files Browse the repository at this point in the history
  • Loading branch information
James Robinson authored Oct 23, 2023
2 parents 58cd581 + bba1d48 commit 533c8b1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
For pre-1.0 releases, see [0.0.35 Changelog](https://github.com/noteable-io/origami/blob/0.0.35/CHANGELOG.md)

## [Unreleased]
### Added
- Environ variable `NOTEABLE_RTU_URL` to override RTU websocket, primarily for when apps are running in-cluster with Gate and need to use the http vs websocket service DNS
### Changed
- Removed `RuntimeError` in RTUClient catastrophic failure, top level applications (e.g. PA, Origamist) should define that behavior

### Changed
- Upgraded pydantic to 2.1.4.
Expand Down
8 changes: 3 additions & 5 deletions origami/clients/rtu.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,7 @@ async def catastrophic_failure(self):
after inconsistent_state_event and not getting a current_version_id to subscribe by or
getting Deltas that cannot be squashed into the builder
"""
logger.warning("Catastrophic failure, shutting down RTUClient")
await self.shutdown(now=True)
raise RuntimeError("Catastrophic failure, shutting down RTUClient")
logger.warning("Catastrophic failure, RTU applications can override this hook")

@property
def cell_ids(self):
Expand Down Expand Up @@ -453,8 +451,8 @@ async def load_seed_notebook(self):

# Current file version id is used in file subscribe request
if not file.current_version_id:
logger.warning(f"Gate shows now current version id for File {self.file_id}, aborting.")
await self.catastrophic_failure()
logger.warning(f"Gate shows no current version id for File {self.file_id}, aborting.")
return await self.catastrophic_failure()
self.file_version_id = file.current_version_id

logger.info("Downloading seed Notebook")
Expand Down
8 changes: 8 additions & 0 deletions tests/e2e/rtu/test_notebook.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import asyncio
import uuid

import httpx
import pytest

from origami.clients.api import APIClient
Expand Down Expand Up @@ -83,3 +85,9 @@ async def test_replace_cell_content(api_client: APIClient, notebook_maker):
assert cell.source == "2 + 2"
finally:
await rtu_client.shutdown()


async def test_connect_bad_file_id(api_client: APIClient):
with pytest.raises(httpx.HTTPStatusError) as e:
await api_client.connect_realtime(file=uuid.uuid4())
assert e.value.response.status_code == 404

0 comments on commit 533c8b1

Please sign in to comment.