From 9a84d0ee8bffd14afb489df21d5d5bb6a1bc66f7 Mon Sep 17 00:00:00 2001 From: Jo Booth Date: Mon, 15 Sep 2025 14:30:11 -0400 Subject: [PATCH 1/4] chore: DOCS-999999: (fake ticket) improve Whoami docs --- label_studio/users/api.py | 4 ++-- label_studio/users/serializers.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/label_studio/users/api.py b/label_studio/users/api.py index b0b1d84735ce..28c05e43edc2 100644 --- a/label_studio/users/api.py +++ b/label_studio/users/api.py @@ -317,8 +317,8 @@ def get(self, request, *args, **kwargs): name='get', decorator=extend_schema( tags=['Users'], - summary='Retrieve my user', - description='Retrieve details of the account that you are using to access the API.', + summary='Whoami for current user', + description='Make the whoami call on behalf of the user you are using to access the API.', request=None, responses={200: WhoAmIUserSerializer}, extensions={ diff --git a/label_studio/users/serializers.py b/label_studio/users/serializers.py index 3181d7c8e947..49f46a80aff2 100644 --- a/label_studio/users/serializers.py +++ b/label_studio/users/serializers.py @@ -11,7 +11,9 @@ class BaseUserSerializer(FlexFieldsModelSerializer): # short form for user presentation initials = serializers.SerializerMethodField(default='?', read_only=True) avatar = serializers.SerializerMethodField(read_only=True) - active_organization_meta = serializers.SerializerMethodField(read_only=True) + active_organization_meta = serializers.SerializerMethodField( + help_text='Active organization metadata', read_only=True + ) last_activity = serializers.DateTimeField(read_only=True, source='last_activity_cached') def get_avatar(self, instance): From 22110d4c9b894c35c74cad916f3f653cdbb2e035 Mon Sep 17 00:00:00 2001 From: robot-ci-heartex Date: Mon, 15 Sep 2025 18:41:49 +0000 Subject: [PATCH 2/4] Sync Follow Merge dependencies Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/17743157456 --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 5194a477f4c8..cfd6400e72fb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2130,13 +2130,13 @@ testing = ["pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementat [[package]] name = "label-studio-sdk" -version = "2.0.7" +version = "2.0.8" description = "" optional = false python-versions = ">=3.9,<4" groups = ["main"] files = [ - {file = "77b0c0abd2847c914096e6054b6f1b1805ee1b7a.zip", hash = "sha256:a29f9b9db793edfb97cbf384a2c9aac780656ca37893c998e412577f4e9277ad"}, + {file = "4131d833a68ef7a46121f06c8ea57506e4edbe45.zip", hash = "sha256:205b06504cf5125b9848115e358057addab9308e37a9f9d713da2de5817986e7"}, ] [package.dependencies] @@ -2164,7 +2164,7 @@ xmljson = "0.2.1" [package.source] type = "url" -url = "https://github.com/HumanSignal/label-studio-sdk/archive/77b0c0abd2847c914096e6054b6f1b1805ee1b7a.zip" +url = "https://github.com/HumanSignal/label-studio-sdk/archive/4131d833a68ef7a46121f06c8ea57506e4edbe45.zip" [[package]] name = "launchdarkly-server-sdk" @@ -5109,4 +5109,4 @@ uwsgi = ["pyuwsgi", "uwsgitop"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<4" -content-hash = "27d1096f39b9864ce20797fcaabcdf470de9b87aedf0b2bfe0b7b109096320a0" +content-hash = "c56cc92ad33427d3849c22aa6c4334267e93e94d53ed3e32a3f47b07537e0ed7" diff --git a/pyproject.toml b/pyproject.toml index cb1a83035a58..d9d2e72a182e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ dependencies = [ "tldextract (>=5.1.3)", "uuid-utils (>=0.11.0,<1.0.0)", ## HumanSignal repo dependencies :start - "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/77b0c0abd2847c914096e6054b6f1b1805ee1b7a.zip", + "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/4131d833a68ef7a46121f06c8ea57506e4edbe45.zip", ## HumanSignal repo dependencies :end ] From 0b4cee7464bd1f0674c11c90f102779599d2d563 Mon Sep 17 00:00:00 2001 From: Jo Booth Date: Mon, 15 Sep 2025 14:51:59 -0400 Subject: [PATCH 3/4] improve type of active_organization_metadata --- label_studio/users/serializers.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/label_studio/users/serializers.py b/label_studio/users/serializers.py index 49f46a80aff2..6efa2a33140d 100644 --- a/label_studio/users/serializers.py +++ b/label_studio/users/serializers.py @@ -1,5 +1,7 @@ """This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license. """ +from typing import TypedDict + from core.utils.common import load_func from django.conf import settings from rest_flex_fields import FlexFieldsModelSerializer @@ -7,6 +9,11 @@ from users.models import User +class ActiveOrganizationMeta(TypedDict): + title: str + email: str + + class BaseUserSerializer(FlexFieldsModelSerializer): # short form for user presentation initials = serializers.SerializerMethodField(default='?', read_only=True) @@ -22,7 +29,7 @@ def get_avatar(self, instance): def get_initials(self, instance): return instance.get_initials(self._is_deleted(instance)) - def get_active_organization_meta(self, instance): + def get_active_organization_meta(self, instance) -> ActiveOrganizationMeta: organization = instance.active_organization if organization is None: return {'title': '', 'email': ''} From c815154840d5989122323ff75b1c469ab62aa001 Mon Sep 17 00:00:00 2001 From: robot-ci-heartex Date: Mon, 15 Sep 2025 19:09:16 +0000 Subject: [PATCH 4/4] Sync Follow Merge dependencies Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/17743618826 --- poetry.lock | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index cfd6400e72fb..629ff7ca99f0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2136,7 +2136,7 @@ optional = false python-versions = ">=3.9,<4" groups = ["main"] files = [ - {file = "4131d833a68ef7a46121f06c8ea57506e4edbe45.zip", hash = "sha256:205b06504cf5125b9848115e358057addab9308e37a9f9d713da2de5817986e7"}, + {file = "bb1b70dea95d5829b57021070ce5ccdd7ed60e47.zip", hash = "sha256:1c35fb3b96bfc7dce6f7a6755d7f4976e9169b086ec74ab7250a25d13c490385"}, ] [package.dependencies] @@ -2164,7 +2164,7 @@ xmljson = "0.2.1" [package.source] type = "url" -url = "https://github.com/HumanSignal/label-studio-sdk/archive/4131d833a68ef7a46121f06c8ea57506e4edbe45.zip" +url = "https://github.com/HumanSignal/label-studio-sdk/archive/bb1b70dea95d5829b57021070ce5ccdd7ed60e47.zip" [[package]] name = "launchdarkly-server-sdk" @@ -5109,4 +5109,4 @@ uwsgi = ["pyuwsgi", "uwsgitop"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<4" -content-hash = "c56cc92ad33427d3849c22aa6c4334267e93e94d53ed3e32a3f47b07537e0ed7" +content-hash = "20ef81501ff8769c6e999b65dd0c81f2a883fe97d2cecf78f3b9d608a34cb7ae" diff --git a/pyproject.toml b/pyproject.toml index d9d2e72a182e..de8f88ef8302 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ dependencies = [ "tldextract (>=5.1.3)", "uuid-utils (>=0.11.0,<1.0.0)", ## HumanSignal repo dependencies :start - "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/4131d833a68ef7a46121f06c8ea57506e4edbe45.zip", + "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/bb1b70dea95d5829b57021070ce5ccdd7ed60e47.zip", ## HumanSignal repo dependencies :end ]