From 042ad90cf0f4945f6f38a4c0ae1660e45051f0d8 Mon Sep 17 00:00:00 2001 From: Patrick Arminio Date: Thu, 13 Aug 2026 13:44:55 +0200 Subject: [PATCH 1/2] Update Strawberry to 0.324.0 --- backend/pyproject.toml | 2 +- backend/schema.graphql | 2 +- backend/uv.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 3d8df373c6..2f3e652674 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -67,7 +67,7 @@ dependencies = [ "django-queryinspect<2.0.0,>=1.1.0", "lxml==6.1.0", "unidecode<2.0.0,>=1.1.1", - "strawberry-graphql==0.318.1", + "strawberry-graphql==0.324.0", "Werkzeug>=1.0.1,<4.0.0", "django-import-export<4.0.0,>=3.2.0", "dal-admin-filters==1.1.0", diff --git a/backend/schema.graphql b/backend/schema.graphql index 0093739ed2..275d0c762d 100644 --- a/backend/schema.graphql +++ b/backend/schema.graphql @@ -112,7 +112,7 @@ type BillingAddress { pec: String! } -union Block = NewsGridSection | CommunitiesSection | SliderCardsSection | SponsorsSection | SchedulePreviewSection | TextSection | DynamicContentDisplaySection | SpecialGuestSection | LiveStreamingSection | InformationSection | CheckoutSection | SocialsSection | KeynotersSection | HomepageHero | HomeIntroSection | CMSMap +union Block = HomeIntroSection | SponsorsSection | CheckoutSection | SchedulePreviewSection | HomepageHero | SliderCardsSection | CommunitiesSection | SocialsSection | LiveStreamingSection | TextSection | SpecialGuestSection | KeynotersSection | DynamicContentDisplaySection | InformationSection | NewsGridSection | CMSMap enum BodyTextSize { TEXT_1 diff --git a/backend/uv.lock b/backend/uv.lock index 4b00a0ec09..6b4d819c2a 100644 --- a/backend/uv.lock +++ b/backend/uv.lock @@ -273,7 +273,7 @@ requires-dist = [ { name = "scikit-learn", specifier = ">=1.5.0" }, { name = "sentence-transformers", specifier = ">=3.0.0" }, { name = "sentry-sdk", specifier = ">=2.14.0" }, - { name = "strawberry-graphql", specifier = "==0.318.1" }, + { name = "strawberry-graphql", specifier = "==0.324.0" }, { name = "stripe", specifier = "==10.5.0" }, { name = "tinycss2", specifier = ">=1.4.0" }, { name = "torch", specifier = ">=2.12.1", index = "https://download.pytorch.org/whl/cpu" }, @@ -3092,7 +3092,7 @@ wheels = [ [[package]] name = "strawberry-graphql" -version = "0.318.1" +version = "0.324.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cross-web" }, @@ -3101,9 +3101,9 @@ dependencies = [ { name = "python-dateutil" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/55/3f/21dec16d4088d1f8141885e5a04da3b732f5c294d1a334174d1391a3139e/strawberry_graphql-0.318.1.tar.gz", hash = "sha256:8eb21d16f8847d156e445fd3b9d9fb0ac40a2646accea4cb7ac9ef5aad03265b", size = 226803 } +sdist = { url = "https://files.pythonhosted.org/packages/6b/f9/7e121f55c93864cbedf2bbcf8920e2456da3adf05d9f3eef101db6633fec/strawberry_graphql-0.324.0.tar.gz", hash = "sha256:4eb6decf0c33524374f24e07ff6d1915da26655a49fa6f656544c293404e2d35", size = 235911 } wheels = [ - { url = "https://files.pythonhosted.org/packages/f6/66/5913d3ba9dc693db71f6381fdb623727680dd17bd2c701175a9b6b86cb1e/strawberry_graphql-0.318.1-py3-none-any.whl", hash = "sha256:9199c84bd249e9ea339c5b38b2b857e225924e4eb3114c406789d86e6f457bb6", size = 329398 }, + { url = "https://files.pythonhosted.org/packages/bc/56/52b78a3e8de057aadc42f61c82727a914fbb95accc6aae1b5ff0d54e43c9/strawberry_graphql-0.324.0-py3-none-any.whl", hash = "sha256:08c8b3256a1c909c7721f3c1d8e161ac40505ca14991c39d8492898b17e77b6d", size = 338683 }, ] [[package]] From 9669f516c8295fd43c9d9c5dc68236d69b4d8672 Mon Sep 17 00:00:00 2001 From: Patrick Arminio Date: Thu, 13 Aug 2026 14:17:33 +0200 Subject: [PATCH 2/2] Sort CMS block discovery --- backend/api/cms/page/registry.py | 2 +- backend/api/cms/tests/test_registry.py | 37 ++++++++++++++++++++++++++ backend/schema.graphql | 2 +- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 backend/api/cms/tests/test_registry.py diff --git a/backend/api/cms/page/registry.py b/backend/api/cms/page/registry.py index 218545a158..906600c582 100644 --- a/backend/api/cms/page/registry.py +++ b/backend/api/cms/page/registry.py @@ -27,7 +27,7 @@ def get_block_union(): import glob # Import all blocks to register them - for file_ in glob.glob("api/cms/*/blocks/*.py"): + for file_ in sorted(glob.glob("api/cms/*/blocks/*.py")): module_path = file_.replace("/", ".").replace(".py", "") importlib.import_module(module_path) diff --git a/backend/api/cms/tests/test_registry.py b/backend/api/cms/tests/test_registry.py new file mode 100644 index 0000000000..b21d5104e5 --- /dev/null +++ b/backend/api/cms/tests/test_registry.py @@ -0,0 +1,37 @@ +from unittest.mock import call, patch + +import strawberry + +from api.cms.page.registry import REGISTRY, get_block_union + + +def test_get_block_union_imports_blocks_in_sorted_order(): + @strawberry.type + class FirstBlock: + value: str + + @strawberry.type + class SecondBlock: + value: str + + with ( + patch( + "glob.glob", + return_value=[ + "api/cms/page/blocks/second.py", + "api/cms/page/blocks/first.py", + ], + ), + patch("importlib.import_module") as import_module, + patch.dict( + REGISTRY, + {"first": FirstBlock, "second": SecondBlock}, + clear=True, + ), + ): + get_block_union() + + assert import_module.call_args_list == [ + call("api.cms.page.blocks.first"), + call("api.cms.page.blocks.second"), + ] diff --git a/backend/schema.graphql b/backend/schema.graphql index 275d0c762d..0c9cf4ebe6 100644 --- a/backend/schema.graphql +++ b/backend/schema.graphql @@ -112,7 +112,7 @@ type BillingAddress { pec: String! } -union Block = HomeIntroSection | SponsorsSection | CheckoutSection | SchedulePreviewSection | HomepageHero | SliderCardsSection | CommunitiesSection | SocialsSection | LiveStreamingSection | TextSection | SpecialGuestSection | KeynotersSection | DynamicContentDisplaySection | InformationSection | NewsGridSection | CMSMap +union Block = CMSMap | HomeIntroSection | NewsGridSection | CheckoutSection | CommunitiesSection | DynamicContentDisplaySection | HomepageHero | InformationSection | KeynotersSection | LiveStreamingSection | SchedulePreviewSection | SliderCardsSection | SocialsSection | SpecialGuestSection | SponsorsSection | TextSection enum BodyTextSize { TEXT_1