Skip to content

Commit 0109512

Browse files
fm3markbader
andauthored
Adapt datastore client to use versioned routes (#1328)
* Adapt datastore client to use versioned routes * refresh test cassettes * format * adapt one test to newer wk test db * do not use datastore token as dataset sharing token * Update cassettes. * format and lint. * changelog * remove merge artifacts in changelog * implement pr feedback: do not pass api version from concrete to abstract client; remove debug curl call in test setup * Add version to manualy built routes. --------- Co-authored-by: markbader <[email protected]>
1 parent b2ee3a8 commit 0109512

File tree

61 files changed

+4231
-25885
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4231
-25885
lines changed

webknossos/Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
3131
- `my_task.update()` to update a `Task` object.
3232
- `my_task.delete()` to delete a `Task` object.
3333
- Added `TaskExperience` class to store domain and value pair.
34+
- The libs client now uses versioned datastore routes for improved compatibility across webknossos versions. [#1328](https://github.com/scalableminds/webknossos-libs/pull/1328)
3435

3536
### Changed
3637

3738
### Fixed
39+
- Fixed the tests for the newest WEBKNOSSOS version. [#1328](https://github.com/scalableminds/webknossos-libs/pull/1328)
3840

3941

4042
## [2.4.1](https://github.com/scalableminds/webknossos-libs/releases/tag/v2.4.1) - 2025-07-03

webknossos/local_wk_setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function ensure_local_test_wk {
4646
OUT=$(docker compose exec -T webknossos tools/postgres/dbtool.js prepare-test-db 2>&1) || echo "$OUT"
4747
popd > /dev/null
4848
else
49-
echo "Using the already running local webknossos setup at localhost:9000"
49+
echo "Using the already running local webknossos setup at localhost:9000. Make sure l4_sample exists and is set to public first!"
5050
fi
5151

5252
if ! curl -s -H "X-Auth-Token: $WK_TOKEN" localhost:9000/api/user | grep [email protected] > /dev/null; then

webknossos/tests/administration/test_task.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,20 @@
1414
@pytest.fixture(autouse=True)
1515
def setup_task_type_and_project() -> Iterator[None]:
1616
team = wk.Team.get_list()[0]
17+
try:
18+
wk.TaskType.get_by_name(TEST_TASK_TYPE_NAME).delete()
19+
except ValueError:
20+
pass
1721
task_type = wk.TaskType.create(
1822
name="test_task_type",
1923
description="This is a test task type",
2024
team=team,
2125
tracing_type="volume",
2226
)
27+
try:
28+
wk.Project.get_by_name(TEST_PROJECT_NAME).delete()
29+
except ValueError:
30+
pass
2331
project = wk.Project.create(
2432
name=TEST_PROJECT_NAME,
2533
priority=1,

webknossos/tests/cassettes/test_annotation/test_annotation_upload_download_roundtrip.yml

Lines changed: 102 additions & 825 deletions
Large diffs are not rendered by default.

webknossos/tests/cassettes/test_annotation/test_bounding_box_roundtrip.yml

Lines changed: 48 additions & 823 deletions
Large diffs are not rendered by default.

webknossos/tests/cassettes/test_annotation/test_dataset_access_via_annotation.yml

Lines changed: 193 additions & 1699 deletions
Large diffs are not rendered by default.

webknossos/tests/cassettes/test_annotation/test_remote_annotation_list.yml

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

webknossos/tests/cassettes/test_api_client/test_annotation_info.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ http_interactions:
22
- request:
33
method: GET
44
path: >-
5-
/api/v9/annotations/570ba0092a7c0e980056fe9b/info?timestamp=1744722468000
5+
/api/v9/annotations/570ba0092a7c0e980056fe9b/info?timestamp=1751570393000
66
headers:
77
host: localhost:9000
88
accept: '*/*'
@@ -19,12 +19,10 @@ http_interactions:
1919
status:
2020
code: 200
2121
headers:
22-
x-powered-by: Express
2322
cache-control: no-cache
2423
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2524
x-permitted-cross-domain-policies: master-only
26-
date: Tue, 15 Apr 2025 13:07:47 GMT
27-
connection: close
25+
date: Thu, 03 Jul 2025 19:19:53 GMT
2826
content-type: application/json
2927
content-length: '1911'
3028
body:

webknossos/tests/cassettes/test_api_client/test_build_info.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@ http_interactions:
1818
status:
1919
code: 200
2020
headers:
21-
x-powered-by: Express
2221
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2322
access-control-max-age: '600'
2423
access-control-allow-origin: '*'
2524
x-permitted-cross-domain-policies: master-only
26-
date: Tue, 15 Apr 2025 13:07:47 GMT
27-
connection: close
25+
date: Thu, 03 Jul 2025 19:19:54 GMT
2826
content-type: application/json
29-
content-length: '409'
27+
content-length: '426'
3028
body:
3129
encoding: utf8
3230
data: >-
33-
{"webknossos":{"name":"webknossos","ciTag":"","commitHash":"920807ab93ef60ae4fd1ba6341c72989f123e13d","ciBuild":"","scalaVersion":"2.13.16","version":"dev","sbtVersion":"1.10.11","datastoreApiVersion":"2.0","commitDate":"Tue
34-
Apr 15 13:27:44 2025
35-
+0200"},"schemaVersion":130,"httpApiVersioning":{"currentApiVersion":9,"oldestSupportedApiVersion":5},"localDataStoreEnabled":true,"localTracingStoreEnabled":true}
31+
{"webknossos":{"name":"webknossos","ciTag":"","commitHash":"f907b5377a89c9ba0f90246741cc8f4c5f521966","ciBuild":"16048991892","scalaVersion":"2.13.16","version":"16048991892","sbtVersion":"1.11.0","datastoreApiVersion":"2.0","commitDate":"Thu
32+
Jul 3 13:18:06 2025
33+
+0200"},"schemaVersion":135,"httpApiVersioning":{"currentApiVersion":9,"oldestSupportedApiVersion":5},"localDataStoreEnabled":true,"localTracingStoreEnabled":true}
3634
compression: none

webknossos/tests/cassettes/test_api_client/test_current_user_info_and_user_logged_time.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,16 @@ http_interactions:
1818
status:
1919
code: 200
2020
headers:
21-
x-powered-by: Express
2221
cache-control: no-cache
2322
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2423
x-permitted-cross-domain-policies: master-only
25-
date: Tue, 15 Apr 2025 13:07:47 GMT
26-
connection: close
24+
date: Thu, 03 Jul 2025 19:19:54 GMT
2725
content-type: application/json
28-
content-length: '682'
26+
content-length: '717'
2927
body:
3028
encoding: utf8
3129
data: >-
32-
{"id":"570b9f4d2a7c0e4d008da6ef","email":"[email protected]","firstName":"user_A","lastName":"last_A","isAdmin":true,"isOrganizationOwner":true,"isDatasetManager":true,"isActive":true,"teams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","isTeamManager":true},{"id":"59882b370d889b84020efd3f","name":"team_X3","isTeamManager":false},{"id":"59882b370d889b84020efd6f","name":"team_X4","isTeamManager":true}],"experiences":{"abc":5},"lastActivity":1460379469053,"isAnonymous":false,"isEditable":true,"organization":"Organization_X","novelUserExperienceInfos":{},"selectedTheme":"auto","created":1460379469000,"lastTaskTypeId":null,"isSuperUser":true,"isEmailVerified":true}
30+
{"id":"570b9f4d2a7c0e4d008da6ef","email":"[email protected]","firstName":"user_A","lastName":"last_A","isAdmin":true,"isOrganizationOwner":true,"isDatasetManager":true,"isActive":true,"teams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","isTeamManager":true},{"id":"59882b370d889b84020efd3f","name":"team_X3","isTeamManager":false},{"id":"59882b370d889b84020efd6f","name":"team_X4","isTeamManager":true}],"experiences":{"abc":5},"lastActivity":1460379469053,"isAnonymous":false,"isEditable":true,"organization":"Organization_X","novelUserExperienceInfos":{},"selectedTheme":"auto","created":1460379469000,"lastTaskTypeId":null,"isSuperUser":true,"isEmailVerified":true,"isUnlisted":false,"isGuest":false}
3331
compression: none
3432
- request:
3533
method: GET
@@ -50,16 +48,14 @@ http_interactions:
5048
status:
5149
code: 200
5250
headers:
53-
x-powered-by: Express
5451
cache-control: no-cache
5552
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
5653
x-permitted-cross-domain-policies: master-only
57-
date: Tue, 15 Apr 2025 13:07:47 GMT
58-
connection: close
54+
date: Thu, 03 Jul 2025 19:19:54 GMT
5955
content-type: application/json
6056
content-length: '691'
6157
body:
6258
encoding: utf8
6359
data: >-
64-
{"loggedTime":[{"paymentInterval":{"month":4,"year":2016},"durationInSeconds":58},{"paymentInterval":{"month":8,"year":2018},"durationInSeconds":265},{"paymentInterval":{"month":1,"year":2021},"durationInSeconds":112},{"paymentInterval":{"month":3,"year":2021},"durationInSeconds":24},{"paymentInterval":{"month":5,"year":2021},"durationInSeconds":158},{"paymentInterval":{"month":8,"year":2021},"durationInSeconds":14},{"paymentInterval":{"month":11,"year":2021},"durationInSeconds":12},{"paymentInterval":{"month":2,"year":2024},"durationInSeconds":114},{"paymentInterval":{"month":3,"year":2024},"durationInSeconds":200},{"paymentInterval":{"month":4,"year":2025},"durationInSeconds":0}]}
60+
{"loggedTime":[{"paymentInterval":{"month":4,"year":2016},"durationInSeconds":58},{"paymentInterval":{"month":8,"year":2018},"durationInSeconds":265},{"paymentInterval":{"month":1,"year":2021},"durationInSeconds":112},{"paymentInterval":{"month":3,"year":2021},"durationInSeconds":24},{"paymentInterval":{"month":5,"year":2021},"durationInSeconds":158},{"paymentInterval":{"month":8,"year":2021},"durationInSeconds":14},{"paymentInterval":{"month":11,"year":2021},"durationInSeconds":12},{"paymentInterval":{"month":2,"year":2024},"durationInSeconds":114},{"paymentInterval":{"month":3,"year":2024},"durationInSeconds":200},{"paymentInterval":{"month":7,"year":2025},"durationInSeconds":0}]}
6561
compression: none

0 commit comments

Comments
 (0)