From 0c17d76f604c70c6b607f29db8ed151bc169ba78 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 17 Mar 2026 13:17:05 +0100 Subject: [PATCH] =?UTF-8?q?=E2=AC=87=EF=B8=8F(backend)=20downgrade=20djang?= =?UTF-8?q?o-treebeard=20to=20version=20<=205.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we upgraded to django-treebeard version 5 we have anormal behavior and a high error rate on the document.path property. We must downgrade it and avoid future upgrade from renovate. --- CHANGELOG.md | 4 ++++ renovate.json | 6 ++++++ .../core/migrations/0015_set_path_on_existing_documents.py | 2 +- src/backend/pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd629256..efac567b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to ## [v4.8.0] - 2026-03-13 +### Changed + +- ⬇️(backend) downgrade django-treebeard to version < 5.0.0 + ### Added - ✨(backend) add a is_first_connection flag to the User model #1938 diff --git a/renovate.json b/renovate.json index ccc138a4..1177b2a4 100644 --- a/renovate.json +++ b/renovate.json @@ -49,6 +49,12 @@ "matchPackageNames": ["langfuse"], "allowedVersions": "<3.12.0" }, + { + "groupName": "allowed django-treebeard versions", + "matchManagers": ["pep621"], + "matchPackageNames": ["django-treebeard"], + "allowedVersions": "<5.0.0" + }, { "enabled": false, "groupName": "ignored js dependencies", diff --git a/src/backend/core/migrations/0015_set_path_on_existing_documents.py b/src/backend/core/migrations/0015_set_path_on_existing_documents.py index 27033033..1c3081fc 100644 --- a/src/backend/core/migrations/0015_set_path_on_existing_documents.py +++ b/src/backend/core/migrations/0015_set_path_on_existing_documents.py @@ -22,7 +22,7 @@ def set_path_on_existing_documents(apps, schema_editor): # Iterate over all existing documents and make them root nodes documents = Document.objects.order_by("created_at").values_list("id", flat=True) - numconv = NumConv(ALPHABET) + numconv = NumConv(len(ALPHABET), ALPHABET) updates = [] for i, pk in enumerate(documents): diff --git a/src/backend/pyproject.toml b/src/backend/pyproject.toml index a79c718f..f6fb50ae 100644 --- a/src/backend/pyproject.toml +++ b/src/backend/pyproject.toml @@ -40,7 +40,7 @@ dependencies = [ "django-storages[s3]==1.14.6", "django-timezone-field>=5.1", "django<6.0.0", - "django-treebeard==5.0.5", + "django-treebeard<5.0.0", "djangorestframework==3.16.1", "drf_spectacular==0.29.0", "dockerflow==2026.1.26",