Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

fix: address v1.4.3 release review comments (#9925)

sriram veeraghanta90717e584289
diff --git a/apps/admin/Dockerfile.admin b/apps/admin/Dockerfile.admin
index 16c06af6dc..038a8f36b1 100644
--- a/apps/admin/Dockerfile.admin
+++ b/apps/admin/Dockerfile.admin
@@ -13,7 +13,7 @@ RUN corepack enable pnpm
FROM base AS builder
-RUN pnpm add -g [email protected]
+RUN pnpm add -g [email protected]
COPY . .
diff --git a/apps/api/plane/api/views/intake.py b/apps/api/plane/api/views/intake.py
index 9310960b30..69e9a892c7 100644
--- a/apps/api/plane/api/views/intake.py
+++ b/apps/api/plane/api/views/intake.py
@@ -384,7 +384,12 @@ class IntakeIssueDetailAPIEndpoint(BaseAPIView):
"description_json": description_json,
}
- issue_serializer = IssueSerializer(issue, data=issue_data, partial=True)
+ issue_serializer = IssueSerializer(
+ issue,
+ data=issue_data,
+ context={"project_id": project_id, "workspace_id": issue.workspace_id},
+ partial=True,
+ )
if not issue_serializer.is_valid():
return Response(issue_serializer.errors, status=status.HTTP_400_BAD_REQUEST)
diff --git a/apps/api/plane/tests/contract/api/test_intake_issue_update.py b/apps/api/plane/tests/contract/api/test_intake_issue_update.py
new file mode 100644
index 0000000000..d6db01f197
--- /dev/null
+++ b/apps/api/plane/tests/contract/api/test_intake_issue_update.py
@@ -0,0 +1,87 @@
+# Copyright (c) 2023-present Plane Software, Inc. and contributors
+# SPDX-License-Identifier: AGPL-3.0-only
+# See the LICENSE file for details.
+
+import pytest
+from rest_framework import status
+
+from plane.celery import app as celery_app
+from plane.db.models import Intake, IntakeIssue, Issue, Label, Project, ProjectMember, State
+
+
[email protected](autouse=True)
+def celery_eager():
+ """Run the issue activity task in-process; there is no broker in the test stack."""
+ original_always_eager = celery_app.conf.task_always_eager
+ original_eager_propagates = celery_app.conf.task_eager_propagates
+ celery_app.conf.task_always_eager = True
+ celery_app.conf.task_eager_propagates = False
+ yield
+ celery_app.conf.task_always_eager = original_always_eager
+ celery_app.conf.task_eager_propagates = original_eager_propagates
+
+
+def project(db, workspace, create_user):
+ project = Project.objects.create(
+ name="Intake Project", identifier="IP", workspace=workspace, created_by=create_user, intake_view=True
+ )
+ ProjectMember.objects.create(project=project, member=create_user, role=20, is_active=True)
+ State.objects.create(
+ name="Triage",
+ color="#000000",
+ group="triage",
+ default=True,
+ project=project,
+ workspace=workspace,
+ created_by=create_user,
+ )
+ return project
+
+
+def intake_issue(db, project, workspace, create_user):
+ intake = Intake.objects.create(name="Intake", project=project, workspace=workspace, is_default=True)
+ issue = Issue.objects.create(name="Intake Issue", project=project, workspace=workspace, created_by=create_user)
+ IntakeIssue.objects.create(intake=intake, issue=issue, project=project, workspace=workspace)
+ return issue
+
+
+class TestIntakeIssueUpdateContract:
+ """
+ Contract: updating the work item behind an intake issue through the external
+ REST API validates assignees/labels against the intake's project, so
+ in-project ids are accepted and foreign ids are rejected.
+ """
+
+ def get_detail_url(self, workspace_slug, project_id, issue_id):
+ return f"/api/v1/workspaces/{workspace_slug}/projects/{project_id}/intake-issues/{issue_id}/"
+
+ @pytest.mark.django_db
+ def test_update_with_project_assignee_and_label_succeeds(
+ self, api_key_client, workspace, project, intake_issue, create_user
+ ):
+ label = Label.objects.create(name="Bug", project=project, workspace=workspace)
+ url = self.get_detail_url(workspace.slug, project.id, intake_issue.id)
+
+ response = api_key_client.patch(
+ url,
+ {"issue": {"assignees": [str(create_user.id)], "labels": [str(label.id)]}},
+ format="json",
+ )
+
+ assert response.status_code == status.HTTP_200_OK, response.data
+ assert list(intake_issue.assignees.values_list("id", flat=True)) == [create_user.id]
+ assert list(intake_issue.labels.values_list("id", flat=True)) == [label.id]
+
+ @pytest.mark.django_db
+ def test_update_with_foreign_label_is_rejected(self, api_key_client, workspace, project, intake_issue):
+ other_project = Project.objects.create(name="Other", identifier="OTH", workspace=workspace)
+ foreign_label = Label.objects.create(name="Foreign", project=other_project, workspace=workspace)
+ url = self.get_detail_url(workspace.slug, project.id, intake_issue.id)
+
+ response = api_key_client.patch(url, {"issue": {"labels": [str(foreign_label.id)]}}, format="json")
+
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
+ assert list(intake_issue.labels.all()) == []
diff --git a/apps/api/plane/tests/contract/api/test_issue_assignee_label_validation.py b/apps/api/plane/tests/contract/api/test_issue_assignee_label_validation.py
index 768a2b6e44..b5bdfc6222 100644
--- a/apps/api/plane/tests/contract/api/test_issue_assignee_label_validation.py
+++ b/apps/api/plane/tests/contract/api/test_issue_assignee_label_validation.py
@@ -16,11 +16,13 @@ def celery_eager():
broker. There's no RabbitMQ/broker in this local sandbox, and these
tests only care about the HTTP response contract, not async delivery.
"""
- original = celery_app.conf.task_always_eager
+ original_always_eager = celery_app.conf.task_always_eager
+ original_eager_propagates = celery_app.conf.task_eager_propagates
celery_app.conf.task_always_eager = True
celery_app.conf.task_eager_propagates = False
yield
- celery_app.conf.task_always_eager = original
+ celery_app.conf.task_always_eager = original_always_eager
+ celery_app.conf.task_eager_propagates = original_eager_propagates
@pytest.fixture
diff --git a/apps/api/plane/tests/contract/app/test_authentication.py b/apps/api/plane/tests/contract/app/test_authentication.py
index c83a673e37..ec5933b967 100644
--- a/apps/api/plane/tests/contract/app/test_authentication.py
+++ b/apps/api/plane/tests/contract/app/test_authentication.py
@@ -74,21 +74,6 @@ def django_client():
return client
[email protected](autouse=True)
-def _reset_authentication_throttle():
- """
- Reset the shared AuthenticationThrottle bucket around every test in this module.
-
- All auth endpoints share one per-IP throttle bucket (scope "authentication")
- and the test client always presents the same IP, so without clearing the cache
- between tests the request count accumulates across tests and later ones trip
- RATE_LIMIT_EXCEEDED. Clearing here keeps each test's rate-limit budget isolated.
- """
- cache.clear()
- yield
- cache.clear()
-
-
@pytest.mark.contract
class TestMagicLinkGenerate:
"""Test magic link generation functionality"""
@@ -500,12 +485,12 @@ class TestMagicSignInVerifyAttempts:
@pytest.fixture(autouse=True)
def _clear_state(self):
"""Reset throttle cache and magic-link redis state between tests in this class."""
- cache.clear()
+ _clear_auth_throttle_keys()
ri = redis_instance()
ri.delete(f"magic_{self.EMAIL}")
ri.delete(f"magic_{self.EMAIL}:verify_attempts")
yield
- cache.clear()
+ _clear_auth_throttle_keys()
ri.delete(f"magic_{self.EMAIL}")
ri.delete(f"magic_{self.EMAIL}:verify_attempts")
@@ -603,12 +588,12 @@ class TestMagicSignUpVerifyAttempts:
@pytest.fixture(autouse=True)
def _clear_state(self):
- cache.clear()
+ _clear_auth_throttle_keys()
ri = redis_instance()
ri.delete(f"magic_{self.EMAIL}")
ri.delete(f"magic_{self.EMAIL}:verify_attempts")
yield
- cache.clear()
+ _clear_auth_throttle_keys()
ri.delete(f"magic_{self.EMAIL}")
ri.delete(f"magic_{self.EMAIL}:verify_attempts")
@@ -638,9 +623,9 @@ class TestAuthenticationThrottle:
@pytest.fixture(autouse=True)
def _clear_state(self):
- cache.clear()
+ _clear_auth_throttle_keys()
yield
- cache.clear()
+ _clear_auth_throttle_keys()
@pytest.mark.django_db
def test_magic_sign_in_throttled(self, django_client, setup_instance):
@@ -738,12 +723,12 @@ class TestBotUserLoginBlocked:
@pytest.fixture(autouse=True)
def _clear_state(self):
"""Reset throttle cache and the bot's magic-link redis state around each test."""
- cache.clear()
+ _clear_auth_throttle_keys()
ri = redis_instance()
ri.delete(f"magic_{self.BOT_EMAIL}")
ri.delete(f"magic_{self.BOT_EMAIL}:verify_attempts")
yield
- cache.clear()
+ _clear_auth_throttle_keys()
ri.delete(f"magic_{self.BOT_EMAIL}")
ri.delete(f"magic_{self.BOT_EMAIL}:verify_attempts")
@@ -822,9 +807,9 @@ class TestBotUserAdminSignInBlocked:
@pytest.fixture(autouse=True)
def _clear_state(self):
- cache.clear()
+ _clear_auth_throttle_keys()
yield
- cache.clear()
+ _clear_auth_throttle_keys()
@pytest.fixture
def bot_user(self, db):
diff --git a/apps/live/Dockerfile.live b/apps/live/Dockerfile.live
index 9cecc2e01c..93e1ffd703 100644
--- a/apps/live/Dockerfile.live
+++ b/apps/live/Dockerfile.live
@@ -15,7 +15,7 @@ RUN apk update
RUN apk add --no-cache libc6-compat
# Set working directory
WORKDIR /app
-ARG TURBO_VERSION=2.9.18
+ARG TURBO_VERSION=2.10.11
RUN corepack enable pnpm && pnpm add -g turbo@${TURBO_VERSION}
COPY . .
RUN turbo prune --scope=live --docker
diff --git a/apps/space/Dockerfile.space b/apps/space/Dockerfile.space
index ee5e3c300b..13a82444cb 100644
--- a/apps/space/Dockerfile.space
+++ b/apps/space/Dockerfile.space
@@ -13,7 +13,7 @@ RUN corepack enable pnpm
FROM base AS builder
-RUN pnpm add -g [email protected]
+RUN pnpm add -g [email protected]
COPY . .
diff --git a/apps/web/Dockerfile.web b/apps/web/Dockerfile.web
index abec4739d8..a8c425153a 100644
--- a/apps/web/Dockerfile.web
+++ b/apps/web/Dockerfile.web
@@ -14,7 +14,7 @@ RUN apk add --no-cache libc6-compat
# Set working directory
WORKDIR /app
-ARG TURBO_VERSION=2.9.18
+ARG TURBO_VERSION=2.10.11
RUN corepack enable pnpm && pnpm add -g turbo@${TURBO_VERSION}
COPY . .
diff --git a/deployments/aio/community/Dockerfile b/deployments/aio/community/Dockerfile
index 7ef66f2cd5..e6c88ab705 100644
--- a/deployments/aio/community/Dockerfile
+++ b/deployments/aio/community/Dockerfile
@@ -26,14 +26,14 @@ WORKDIR /app
ARG APK_SECURITY_PATCH=2026-09-07
RUN echo "apk-security-patch ${APK_SECURITY_PATCH}" && apk update && apk upgrade --no-cache --available
-# All apk work must happen BEFORE the `COPY --from=node /usr/lib` below: that
-# copy overwrites /usr/lib/libapk.so.* with node:22-alpine's copy, which is a
-# different Alpine release, leaving /sbin/apk linked against a libapk that no
-# longer exports the symbols it needs. Every later apk call then dies with
-# "Error relocating /sbin/apk: ... symbol not found" (exit 127), and apk cannot
-# repair itself because apk is the broken binary. So the runtime tools that used
-# to be installed further down are folded in here.
+# The node binary only links libstdc++ and libgcc_s from /usr/lib, so install
+# them from apk instead of copying node:22-alpine's whole /usr/lib. That copy
+# overwrote the libraries upgraded above (libcrypto, libssl, libz, libapk) with
+# node's copies from a different Alpine release, shipping unpatched versions
+# and breaking /sbin/apk.
RUN apk add --no-cache \
+ "libstdc++" \
+ "libgcc" \
"libpq" \
"libxslt" \
"xmlsec" \
@@ -44,8 +44,6 @@ RUN apk add --no-cache \
"ncdu" \
"vim"
-
-COPY --from=node /usr/lib /usr/lib
COPY --from=node /usr/local/lib /usr/local/lib
COPY --from=node /usr/local/include /usr/local/include
COPY --from=node /usr/local/bin /usr/local/bin