Skip to content

Commit 335222d

Browse files
Add workflow checking if query complexity is reached
A safe-check for the future, if new fields are added to queries, whether max query complexity is reached in the API.
1 parent b53843b commit 335222d

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Check if query might hit max complexity
2+
3+
# Might be strange, but checking details of seasons/episodes can result with errors regarding
4+
# max complexity of query being reached.
5+
# This workflow will run actual request for "The Simpsons" ("ts20711") with "best_only=False"
6+
# (the largest response I could find) to check if it errors out.
7+
# It won't prevent errors due to too large searches, but should check if it's impossible
8+
# to get details of something "as is", due to too complex query.
9+
10+
name: Query complexity
11+
12+
on:
13+
push:
14+
branches: [ "main" ]
15+
pull_request:
16+
branches: [ "main" ]
17+
workflow_dispatch:
18+
19+
jobs:
20+
verify:
21+
name: Check if max query complexity is reached
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v6
25+
- name: "Install Python"
26+
uses: actions/setup-python@v6
27+
with:
28+
python-version-file: "pyproject.toml"
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v7
31+
- name: Install the project
32+
run: uv sync --locked --all-extras --dev
33+
- name: Check details complexity
34+
run: uv run python -c "from simplejustwatchapi import details; details('ts20711', best_only=False)"
35+
- name: Check search complexity
36+
run: uv run python -c "from simplejustwatchapi import search; search('The', count=100, best_only=False)"

0 commit comments

Comments
 (0)