diff --git a/.github/workflows/Update_Docker_Images.yml b/.github/workflows/Update_Docker_Images.yml index 57dbb4a67..64b7eb085 100644 --- a/.github/workflows/Update_Docker_Images.yml +++ b/.github/workflows/Update_Docker_Images.yml @@ -2,7 +2,7 @@ name: Update Docker Images for Plane on Release on: release: - types: [released] + types: [released, prereleased] jobs: build_push_backend: diff --git a/apiserver/plane/api/views/gpt.py b/apiserver/plane/api/views/gpt.py index f8065f6d0..63c3f4f18 100644 --- a/apiserver/plane/api/views/gpt.py +++ b/apiserver/plane/api/views/gpt.py @@ -41,9 +41,9 @@ class GPTIntegrationEndpoint(BaseAPIView): final_text = task + "\n" + prompt openai.api_key = settings.OPENAI_API_KEY - response = openai.Completion.create( + response = openai.ChatCompletion.create( model=settings.GPT_ENGINE, - prompt=final_text, + messages=[{"role": "user", "content": final_text}], temperature=0.7, max_tokens=1024, ) @@ -51,7 +51,7 @@ class GPTIntegrationEndpoint(BaseAPIView): workspace = Workspace.objects.get(slug=slug) project = Project.objects.get(pk=project_id) - text = response.choices[0].text.strip() + text = response.choices[0].message.content.strip() text_html = text.replace("\n", "
") return Response( { diff --git a/apiserver/plane/api/views/issue.py b/apiserver/plane/api/views/issue.py index a390f7b81..334ad2514 100644 --- a/apiserver/plane/api/views/issue.py +++ b/apiserver/plane/api/views/issue.py @@ -1575,7 +1575,7 @@ class IssueCommentPublicViewSet(BaseViewSet): ) ) .distinct() - ) + ).order_by("created_at") else: return IssueComment.objects.none() except ProjectDeployBoard.DoesNotExist: @@ -2100,6 +2100,12 @@ class ProjectIssuesPublicEndpoint(BaseAPIView): queryset=IssueReaction.objects.select_related("actor"), ) ) + .prefetch_related( + Prefetch( + "votes", + queryset=IssueVote.objects.select_related("actor"), + ) + ) .filter(**filters) .annotate(cycle_id=F("issue_cycle__cycle_id")) .annotate(module_id=F("issue_module__module_id")) @@ -2189,6 +2195,7 @@ class ProjectIssuesPublicEndpoint(BaseAPIView): states = ( State.objects.filter( + ~Q(name="Triage"), workspace__slug=slug, project_id=project_id, ) diff --git a/apiserver/plane/api/views/project.py b/apiserver/plane/api/views/project.py index a83bbca25..093c8ff78 100644 --- a/apiserver/plane/api/views/project.py +++ b/apiserver/plane/api/views/project.py @@ -482,7 +482,7 @@ class UserProjectInvitationsViewset(BaseViewSet): # Delete joined project invites project_invitations.delete() - return Response(status=status.HTTP_200_OK) + return Response(status=status.HTTP_204_NO_CONTENT) except Exception as e: capture_exception(e) return Response( @@ -924,8 +924,7 @@ class ProjectUserViewsEndpoint(BaseAPIView): project_member.save() - return Response(status=status.HTTP_200_OK) - + return Response(status=status.HTTP_204_NO_CONTENT) except Project.DoesNotExist: return Response( {"error": "The requested resource does not exists"}, diff --git a/apiserver/plane/api/views/workspace.py b/apiserver/plane/api/views/workspace.py index ce425185e..2ec3f324a 100644 --- a/apiserver/plane/api/views/workspace.py +++ b/apiserver/plane/api/views/workspace.py @@ -116,7 +116,7 @@ class WorkSpaceViewSet(BaseViewSet): ) issue_count = ( - Issue.objects.filter(workspace=OuterRef("id")) + Issue.issue_objects.filter(workspace=OuterRef("id")) .order_by() .annotate(count=Func(F("id"), function="Count")) .values("count") @@ -203,7 +203,7 @@ class UserWorkSpacesEndpoint(BaseAPIView): ) issue_count = ( - Issue.objects.filter(workspace=OuterRef("id")) + Issue.issue_objects.filter(workspace=OuterRef("id")) .order_by() .annotate(count=Func(F("id"), function="Count")) .values("count") @@ -532,7 +532,7 @@ class UserWorkspaceInvitationsEndpoint(BaseViewSet): # Delete joined workspace invites workspace_invitations.delete() - return Response(status=status.HTTP_200_OK) + return Response(status=status.HTTP_204_NO_CONTENT) except Exception as e: capture_exception(e) return Response( @@ -846,7 +846,7 @@ class WorkspaceMemberUserViewsEndpoint(BaseAPIView): workspace_member.view_props = request.data.get("view_props", {}) workspace_member.save() - return Response(status=status.HTTP_200_OK) + return Response(status=status.HTTP_204_NO_CONTENT) except WorkspaceMember.DoesNotExist: return Response( {"error": "User not a member of workspace"}, @@ -1075,7 +1075,7 @@ class WorkspaceUserProfileStatsEndpoint(BaseAPIView): priority_order = ["urgent", "high", "medium", "low", None] priority_distribution = ( - Issue.objects.filter( + Issue.issue_objects.filter( workspace__slug=slug, assignees__in=[user_id], project__project_projectmember__member=request.user, diff --git a/apiserver/plane/bgtasks/issue_automation_task.py b/apiserver/plane/bgtasks/issue_automation_task.py index a1f4a3e92..645772c94 100644 --- a/apiserver/plane/bgtasks/issue_automation_task.py +++ b/apiserver/plane/bgtasks/issue_automation_task.py @@ -32,7 +32,7 @@ def archive_old_issues(): archive_in = project.archive_in # Get all the issues whose updated_at in less that the archive_in month - issues = Issue.objects.filter( + issues = Issue.issue_objects.filter( Q( project=project_id, archived_at__isnull=True, @@ -64,21 +64,22 @@ def archive_old_issues(): issues_to_update.append(issue) # Bulk Update the issues and log the activity - updated_issues = Issue.objects.bulk_update( - issues_to_update, ["archived_at"], batch_size=100 - ) - [ - issue_activity.delay( - type="issue.activity.updated", - requested_data=json.dumps({"archived_at": str(issue.archived_at)}), - actor_id=str(project.created_by_id), - issue_id=issue.id, - project_id=project_id, - current_instance=None, - subscriber=False, + if issues_to_update: + updated_issues = Issue.objects.bulk_update( + issues_to_update, ["archived_at"], batch_size=100 ) - for issue in updated_issues - ] + [ + issue_activity.delay( + type="issue.activity.updated", + requested_data=json.dumps({"archived_at": str(issue.archived_at)}), + actor_id=str(project.created_by_id), + issue_id=issue.id, + project_id=project_id, + current_instance=None, + subscriber=False, + ) + for issue in updated_issues + ] return except Exception as e: if settings.DEBUG: @@ -99,7 +100,7 @@ def close_old_issues(): close_in = project.close_in # Get all the issues whose updated_at in less that the close_in month - issues = Issue.objects.filter( + issues = Issue.issue_objects.filter( Q( project=project_id, archived_at__isnull=True, @@ -136,19 +137,20 @@ def close_old_issues(): issues_to_update.append(issue) # Bulk Update the issues and log the activity - updated_issues = Issue.objects.bulk_update(issues_to_update, ["state"], batch_size=100) - [ - issue_activity.delay( - type="issue.activity.updated", - requested_data=json.dumps({"closed_to": str(issue.state_id)}), - actor_id=str(project.created_by_id), - issue_id=issue.id, - project_id=project_id, - current_instance=None, - subscriber=False, - ) - for issue in updated_issues - ] + if issues_to_update: + updated_issues = Issue.objects.bulk_update(issues_to_update, ["state"], batch_size=100) + [ + issue_activity.delay( + type="issue.activity.updated", + requested_data=json.dumps({"closed_to": str(issue.state_id)}), + actor_id=str(project.created_by_id), + issue_id=issue.id, + project_id=project_id, + current_instance=None, + subscriber=False, + ) + for issue in updated_issues + ] return except Exception as e: if settings.DEBUG: diff --git a/apiserver/plane/utils/analytics_plot.py b/apiserver/plane/utils/analytics_plot.py index 033452e0d..60e751459 100644 --- a/apiserver/plane/utils/analytics_plot.py +++ b/apiserver/plane/utils/analytics_plot.py @@ -96,7 +96,7 @@ def burndown_plot(queryset, slug, project_id, cycle_id=None, module_id=None): chart_data = {str(date): 0 for date in date_range} completed_issues_distribution = ( - Issue.objects.filter( + Issue.issue_objects.filter( workspace__slug=slug, project_id=project_id, issue_cycle__cycle_id=cycle_id, @@ -118,7 +118,7 @@ def burndown_plot(queryset, slug, project_id, cycle_id=None, module_id=None): chart_data = {str(date): 0 for date in date_range} completed_issues_distribution = ( - Issue.objects.filter( + Issue.issue_objects.filter( workspace__slug=slug, project_id=project_id, issue_module__module_id=module_id, diff --git a/apiserver/requirements/base.txt b/apiserver/requirements/base.txt index ca9d881ef..969ab3c89 100644 --- a/apiserver/requirements/base.txt +++ b/apiserver/requirements/base.txt @@ -1,36 +1,36 @@ # base requirements -Django==4.2.3 +Django==4.2.5 django-braces==1.15.0 django-taggit==4.0.0 -psycopg==3.1.9 +psycopg==3.1.10 django-oauth-toolkit==2.3.0 mistune==3.0.1 djangorestframework==3.14.0 redis==4.6.0 django-nested-admin==4.0.2 -django-cors-headers==4.1.0 +django-cors-headers==4.2.0 whitenoise==6.5.0 -django-allauth==0.54.0 +django-allauth==0.55.2 faker==18.11.2 django-filter==23.2 jsonmodels==2.6.0 -djangorestframework-simplejwt==5.2.2 -sentry-sdk==1.27.0 +djangorestframework-simplejwt==5.3.0 +sentry-sdk==1.30.0 django-s3-storage==0.14.0 django-crum==0.7.9 django-guardian==2.4.0 dj_rest_auth==2.2.5 -google-auth==2.21.0 -google-api-python-client==2.92.0 +google-auth==2.22.0 +google-api-python-client==2.97.0 django-redis==5.3.0 -uvicorn==0.22.0 +uvicorn==0.23.2 channels==4.0.0 -openai==0.27.8 +openai==0.28.0 slack-sdk==3.21.3 -celery==5.3.1 +celery==5.3.4 django_celery_beat==2.5.0 -psycopg-binary==3.1.9 -psycopg-c==3.1.9 +psycopg-binary==3.1.10 +psycopg-c==3.1.10 scout-apm==2.26.1 openpyxl==3.1.2 \ No newline at end of file diff --git a/apiserver/requirements/production.txt b/apiserver/requirements/production.txt index 4da619d49..5e3483a96 100644 --- a/apiserver/requirements/production.txt +++ b/apiserver/requirements/production.txt @@ -1,11 +1,11 @@ -r base.txt -dj-database-url==2.0.0 -gunicorn==20.1.0 +dj-database-url==2.1.0 +gunicorn==21.2.0 whitenoise==6.5.0 -django-storages==1.13.2 -boto3==1.27.0 -django-anymail==10.0 +django-storages==1.14 +boto3==1.28.40 +django-anymail==10.1 django-debug-toolbar==4.1.0 gevent==23.7.0 psycogreen==1.0.2 \ No newline at end of file diff --git a/docker-compose-hub.yml b/docker-compose-hub.yml index 56dbbe670..0e42c83a8 100644 --- a/docker-compose-hub.yml +++ b/docker-compose-hub.yml @@ -85,7 +85,7 @@ services: plane-worker: container_name: planebgworker - image: makeplane/plane-worker:latest + image: makeplane/plane-backend:latest restart: always command: ./bin/worker env_file: @@ -99,7 +99,7 @@ services: plane-beat-worker: container_name: planebeatworker - image: makeplane/plane-worker:latest + image: makeplane/plane-backend:latest restart: always command: ./bin/beat env_file: diff --git a/docker-compose.yml b/docker-compose.yml index e51f88c55..cf631face 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -90,8 +90,6 @@ services: DOCKER_BUILDKIT: 1 restart: always command: ./bin/takeoff - ports: - - 8000:8000 env_file: - .env environment: diff --git a/package.json b/package.json index eb6a23994..793a1922f 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "packages/*" ], "scripts": { - "prepare": "husky install", "build": "turbo run build", "dev": "turbo run dev", "start": "turbo run start", diff --git a/space/components/accounts/onboarding-form.tsx b/space/components/accounts/onboarding-form.tsx index c40465b3f..4cca97a64 100644 --- a/space/components/accounts/onboarding-form.tsx +++ b/space/components/accounts/onboarding-form.tsx @@ -131,7 +131,7 @@ export const OnBoardingForm: React.FC = observer(({ user }) => { type="button" className={`flex items-center justify-between gap-1 w-full rounded-md border border-custom-border-300 shadow-sm duration-300 focus:outline-none px-3 py-2 text-sm`} > - {value || "Select your role..."} + {value || "Select your role..."}