Skip to content

Commit 8ff56bc

Browse files
Release 0.25.0 (#68)
* Release 0.25.0 * Format * Update body class name * Migrate tests from docker compose * Rename workflow step * Add webhook tunnel * Test fixes * Use tee for localtunnel logs * Fix notifier test setup hanging on error * Fix tests and bump protos * Remove unused imports * Increase timeouts * Exit with 1 if webhook setup failed * Wait for localtunnel and separate jobs * Fix uv sync step * Add retries to flask ready-check
1 parent b968feb commit 8ff56bc

21 files changed

+201
-362
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,82 @@ name: CI
33
on: [push]
44

55
jobs:
6-
static-checks:
6+
lint-and-format:
77
runs-on: ubuntu-latest
8-
strategy: &python-matrix
9-
matrix:
10-
python-version:
11-
- "3.11"
12-
- "3.12"
13-
- "3.13"
14-
name: static-checks
158
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v4
18-
19-
- name: Set up Python
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
24-
- name: Install uv
25-
uses: astral-sh/setup-uv@v6
9+
- uses: actions/checkout@v4
10+
- uses: astral-sh/setup-uv@v6
2611
with:
27-
python-version: ${{ matrix.python-version }}
2812
enable-cache: true
2913

3014
- name: Install project dependencies
31-
run: uv sync --locked --all-extras --dev --all-packages
15+
run: uv sync --locked --all-extras --all-packages
3216

33-
- name: Format
17+
- name: Format Check
3418
run: uv run format_check
3519

3620
- name: Lint
3721
run: uv run lint
3822

23+
type-check:
24+
runs-on: ubuntu-latest
25+
strategy: &strategy
26+
matrix:
27+
python-version: ["3.11", "3.12", "3.13"]
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: astral-sh/setup-uv@v5
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
enable-cache: true
34+
35+
- name: Install project dependencies
36+
run: uv sync --locked --all-extras --all-packages
37+
3938
- name: Type check
4039
run: uv run pyright
4140

4241
test:
4342
runs-on: ubuntu-latest
44-
strategy: *python-matrix
45-
env:
46-
PYTHON_VERSION: ${{ matrix.python-version }}
47-
name: test
43+
needs: [lint-and-format]
44+
strategy: *strategy
4845
steps:
4946
- uses: actions/checkout@v4
47+
- uses: astral-sh/setup-uv@v6
48+
with:
49+
python-version: ${{ matrix.python-version }}
50+
enable-cache: true
5051

51-
- name: Log in to GitHub Container Registry
52-
run: echo "${{ secrets.PACKAGE_ACCESS_TOKEN }}" | docker login ghcr.io -u USERNAME --password-stdin
52+
- name: Install project dependencies
53+
run: uv sync --locked --all-extras --all-packages
5354

54-
- name: Run tests
55-
run: docker compose -f docker-compose-test.yaml up test --exit-code-from test
55+
- name: Initialize Localtunnel
56+
id: tunnel
57+
run: |
58+
npx localtunnel --port 5000 > tunnel.log 2>&1 &
59+
60+
# Poll for the URL
61+
TIMEOUT=10
62+
ELAPSED=0
63+
echo "Waiting for localtunnel to generate URL..."
64+
65+
while ! grep -q "https://" tunnel.log; do
66+
if [ $ELAPSED -ge $TIMEOUT ]; then
67+
echo "Error: Localtunnel timed out after ${TIMEOUT}s"
68+
cat tunnel.log
69+
exit 1
70+
fi
71+
sleep 1
72+
ELAPSED=$((ELAPSED + 1))
73+
done
74+
75+
TUNNEL_URL=$(grep -o 'https://[^ ]*' tunnel.log | head -n 1)
76+
echo "url=$TUNNEL_URL" >> $GITHUB_OUTPUT
77+
echo "Localtunnel is live at: $TUNNEL_URL"
5678
57-
- name: Tear down test containers
58-
run: docker compose -f docker-compose-test.yaml down
79+
- name: Run tests
80+
run: uv run pytest
81+
env:
82+
WEBHOOK_SERVER_URL: ${{ steps.tunnel.outputs.url }}
83+
FISHJAM_ID: ${{ secrets.CI_FISHJAM_ID }}
84+
FISHJAM_MANAGEMENT_TOKEN: ${{ secrets.CI_FISHJAM_MANAGEMENT_TOKEN }}

docker-compose-test.yaml

Lines changed: 0 additions & 75 deletions
This file was deleted.

fishjam/_openapi_client/api/room/add_peer.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55

66
from ... import errors
77
from ...client import AuthenticatedClient, Client
8-
from ...models.add_peer_body import AddPeerBody
98
from ...models.error import Error
9+
from ...models.peer_config import PeerConfig
1010
from ...models.peer_details_response import PeerDetailsResponse
1111
from ...types import Response
1212

1313

1414
def _get_kwargs(
1515
room_id: str,
1616
*,
17-
body: AddPeerBody,
17+
body: PeerConfig,
1818
) -> dict[str, Any]:
1919
headers: dict[str, Any] = {}
2020

@@ -81,13 +81,13 @@ def sync_detailed(
8181
room_id: str,
8282
*,
8383
client: AuthenticatedClient,
84-
body: AddPeerBody,
84+
body: PeerConfig,
8585
) -> Response[Union[Error, PeerDetailsResponse]]:
8686
"""Create peer
8787
8888
Args:
8989
room_id (str):
90-
body (AddPeerBody):
90+
body (PeerConfig): Peer configuration
9191
9292
Raises:
9393
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -113,13 +113,13 @@ def sync(
113113
room_id: str,
114114
*,
115115
client: AuthenticatedClient,
116-
body: AddPeerBody,
116+
body: PeerConfig,
117117
) -> Optional[Union[Error, PeerDetailsResponse]]:
118118
"""Create peer
119119
120120
Args:
121121
room_id (str):
122-
body (AddPeerBody):
122+
body (PeerConfig): Peer configuration
123123
124124
Raises:
125125
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -140,13 +140,13 @@ async def asyncio_detailed(
140140
room_id: str,
141141
*,
142142
client: AuthenticatedClient,
143-
body: AddPeerBody,
143+
body: PeerConfig,
144144
) -> Response[Union[Error, PeerDetailsResponse]]:
145145
"""Create peer
146146
147147
Args:
148148
room_id (str):
149-
body (AddPeerBody):
149+
body (PeerConfig): Peer configuration
150150
151151
Raises:
152152
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -170,13 +170,13 @@ async def asyncio(
170170
room_id: str,
171171
*,
172172
client: AuthenticatedClient,
173-
body: AddPeerBody,
173+
body: PeerConfig,
174174
) -> Optional[Union[Error, PeerDetailsResponse]]:
175175
"""Create peer
176176
177177
Args:
178178
room_id (str):
179-
body (AddPeerBody):
179+
body (PeerConfig): Peer configuration
180180
181181
Raises:
182182
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

fishjam/_openapi_client/models/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Contains all the data models used in inputs/outputs"""
22

3-
from .add_peer_body import AddPeerBody
43
from .agent_output import AgentOutput
54
from .audio_format import AudioFormat
65
from .audio_sample_rate import AudioSampleRate
76
from .error import Error
87
from .peer import Peer
8+
from .peer_config import PeerConfig
99
from .peer_details_response import PeerDetailsResponse
1010
from .peer_details_response_data import PeerDetailsResponseData
1111
from .peer_metadata import PeerMetadata
@@ -41,12 +41,12 @@
4141
from .web_rtc_metadata import WebRTCMetadata
4242

4343
__all__ = (
44-
"AddPeerBody",
4544
"AgentOutput",
4645
"AudioFormat",
4746
"AudioSampleRate",
4847
"Error",
4948
"Peer",
49+
"PeerConfig",
5050
"PeerDetailsResponse",
5151
"PeerDetailsResponseData",
5252
"PeerMetadata",

fishjam/_openapi_client/models/agent_output.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
)
77

88
from attrs import define as _attrs_define
9-
from attrs import field as _attrs_field
109

1110
from ..models.audio_format import AudioFormat
1211
from ..models.audio_sample_rate import AudioSampleRate
@@ -26,7 +25,6 @@ class AgentOutput:
2625

2726
audio_format: Union[Unset, AudioFormat] = UNSET
2827
audio_sample_rate: Union[Unset, AudioSampleRate] = UNSET
29-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
3028

3129
def to_dict(self) -> dict[str, Any]:
3230
audio_format: Union[Unset, str] = UNSET
@@ -38,7 +36,7 @@ def to_dict(self) -> dict[str, Any]:
3836
audio_sample_rate = self.audio_sample_rate.value
3937

4038
field_dict: dict[str, Any] = {}
41-
field_dict.update(self.additional_properties)
39+
4240
field_dict.update({})
4341
if audio_format is not UNSET:
4442
field_dict["audioFormat"] = audio_format
@@ -69,21 +67,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
6967
audio_sample_rate=audio_sample_rate,
7068
)
7169

72-
agent_output.additional_properties = d
7370
return agent_output
74-
75-
@property
76-
def additional_keys(self) -> list[str]:
77-
return list(self.additional_properties.keys())
78-
79-
def __getitem__(self, key: str) -> Any:
80-
return self.additional_properties[key]
81-
82-
def __setitem__(self, key: str, value: Any) -> None:
83-
self.additional_properties[key] = value
84-
85-
def __delitem__(self, key: str) -> None:
86-
del self.additional_properties[key]
87-
88-
def __contains__(self, key: str) -> bool:
89-
return key in self.additional_properties

0 commit comments

Comments
 (0)